editor->is_edit_mode() || \Elementor\Plugin::$instance->preview->is_preview_mode() ) { $scripts[] = 'gridmaster-builder-preview'; } return $scripts; } /** * Style dependencies. */ public function get_style_depends() { $styles = array( 'gridmaster-frontend-v2' ); if ( \Elementor\Plugin::$instance->editor->is_edit_mode() || \Elementor\Plugin::$instance->preview->is_preview_mode() ) { $styles[] = 'gridmaster-builder-preview'; } return $styles; } /** * Register widget controls. */ protected function register_controls() { $this->start_controls_section( 'section_grid_settings', array( 'label' => __( 'Grid Settings', 'ajax-filter-posts' ), 'tab' => Controls_Manager::TAB_CONTENT, ) ); $choices = Embed_Helper::get_grid_choices(); $this->add_control( 'grid_id', array( 'label' => __( 'Select Grid', 'ajax-filter-posts' ), 'type' => Controls_Manager::SELECT2, 'label_block' => true, 'default' => '0', 'options' => $choices, 'description' => __( 'Choose a saved GridMaster layout to display.', 'ajax-filter-posts' ), ) ); if ( current_user_can( 'manage_options' ) ) { $this->add_control( 'edit_grid_button', array( 'type' => Controls_Manager::BUTTON, 'text' => __( 'Edit Selected Grid ↗', 'ajax-filter-posts' ), 'event' => 'gridmaster:edit_grid', 'button_type' => 'default', 'condition' => array( 'grid_id!' => array( '0', 0, '' ), ), ) ); $create_url = Embed_Helper::get_create_url(); $manage_url = Embed_Helper::get_manage_url(); $links_html = '