plugin_url = theme_dir_url(__FILE__); //Call the parent constructor with the required arguments. parent::__construct( // The unique id for your widget. 'apt_mmenu', // The name of the widget for display purposes. __('APT Mobile Menu', 'apt-news'), // The $widget_options array, which is passed through to WP_Widget. // It has a couple of extras like the optional help URL, which should link to your sites help or support page. array( 'description' => __('Display burger button and responsive menu after clicking it.', 'apt-news'), 'help' => 'http://seedthemes.com/hello-world-widget-docs', 'panels_groups' => array('apt_widgets'), ), //The $control_options array, which is passed through to WP_Widget array( ), //The $form_options array, which describes the form fields used to configure SiteOrigin widgets. We'll explain these in more detail later. array( 'menu' => array( 'type' => 'select', 'label' => __('Select menu to show after clicking burger button.', 'apt-news'), 'default' => 'not_selected', 'options' => $this->get_all_menus() ), 'burger_bar_background_color' => array( 'type' => 'color', 'label' => __('Select color of burger bar', 'apt-news'), 'default' => '#999', ), $this->get_float_id() => $this->get_float_options(), $this->get_media_query_id() => $this->get_media_query_options(), ), //The $base_folder path string. plugin_dir_path(__FILE__) ); } function widget($args, $instance) { APT_Mmenu::$obj_sequence++; parent::widget($args, $instance); wp_enqueue_style( 'apt_mmenu_style', $this->plugin_url . 'styles/jquery.mmenu.all.css' ); wp_enqueue_script( 'apt_mmenu_lib', $this->plugin_url . 'scripts/jquery.mmenu.all.min.js', array( 'jquery' ) ); } /* Get template file */ function get_template_name($instance) { return 'template'; } /* Get less file */ function get_style_name($instance) { return 'style'; } /* set less variable */ function get_less_variables($instance){ return array( ); } } // siteorigin_widget_register($desired_widget_id, $path_to_widget, $class_used_to_create_widget) siteorigin_widget_register('apt_mmenu', __FILE__, 'APT_Mmenu');