start_controls_section( 'section_content', [ 'label' => esc_html__('Content', 'king-addons'), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'query_id', [ 'label' => esc_html__('Query ID', 'king-addons'), 'type' => Controls_Manager::TEXT, 'description' => esc_html__('Must match the grid Query ID.', 'king-addons'), ] ); $this->add_control( 'meta_key', [ 'label' => esc_html__('Meta/ACF key', 'king-addons'), 'type' => Controls_Manager::TEXT, 'placeholder' => 'custom_field', ] ); $this->add_control( 'control_type', [ 'label' => esc_html__('Control type', 'king-addons'), 'type' => Controls_Manager::SELECT, 'options' => [ 'text' => esc_html__('Text', 'king-addons'), 'select' => esc_html__('Select', 'king-addons'), 'range' => esc_html__('Range', 'king-addons'), ], 'default' => 'text', ] ); $this->add_control( 'placeholder', [ 'label' => esc_html__('Placeholder', 'king-addons'), 'type' => Controls_Manager::TEXT, ] ); $this->end_controls_section(); } protected function render(): void { $settings = $this->get_settings_for_display(); $query_id = $settings['query_id'] ?? ''; $meta_key = $settings['meta_key'] ?? ''; if (empty($query_id) || empty($meta_key)) { if (class_exists(Woo_Context::class) && Woo_Context::is_editor()) { echo '