get_page_templates(); $templates = array( '' => __( 'Select...', 'jet-theme-core' ) ) + $templates; return array( 'template' => array( 'label' => __( 'Select Template', 'jet-theme-core' ), 'type' => Elementor\Controls_Manager::SELECT, 'default' => '', 'options' => $templates, ), ); } public function verbose_args( $args ) { if ( empty( $args['template'] ) ) { return __( 'Not Selected', 'jet-theme-core' ); } return $args['template']; } /** * Condition check callback * * @return bool */ public function check( $args ) { if ( empty( $args['template'] ) ) { return false; } if ( ! is_page() ) { return false; } global $post; $page_template_slug = get_page_template_slug( $post->ID ); return $page_template_slug === $args['template']; } } }