function Search_Filter_Register_Widget()
 {
     // Instantiate the parent object
     parent::__construct(false, 'Search & Filter Form');
     $plugin = Search_Filter::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
 }
 public function __construct()
 {
     /*
      * Call $plugin_slug from public plugin class.
      */
     $plugin = Search_Filter::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
 }
Ejemplo n.º 3
0
 /**
  * Initialize the plugin by loading admin scripts & styles and adding a
  * settings page and menu.
  *
  * @since     1.0.0
  */
 private function __construct()
 {
     /*
      * @TODO :
      *
      * - Uncomment following lines if the admin class should only be available for super admins
      */
     /* if( ! is_super_admin() ) {
     			return;
     		} */
     /*
      * Call $plugin_slug from public plugin class.
      */
     $plugin = Search_Filter::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Add the options page and menu item.
     add_action('admin_menu', array($this, 'add_plugin_admin_menu'));
     //plugin activation
     add_action('admin_init', array($this, 'search_filter_register_option'));
     add_action('admin_init', array($this, 'search_filter_activate_license'));
     add_action('admin_init', array($this, 'search_filter_deactivate_license'));
     //new blog created
     add_action('wpmu_new_blog', array($this, 'on_create_blog'), 10, 6);
     $this->post_cache = new Search_Filter_Post_Cache();
     // Add an action link pointing to the options page.
     $plugin_basename = plugin_basename(plugin_dir_path(dirname(__FILE__)) . $this->plugin_slug . '.php');
     add_filter('plugin_action_links_' . $plugin_basename, array($this, 'add_action_links'));
     /*
      * Define custom functionality.
      *
      * Read more about actions and filters:
      * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
      */
     add_action('admin_notices', array($this, 'action_display_welcome_header'));
     $this->admin_notices = new Search_Filter_Admin_Notices($this->plugin_slug);
     add_action('admin_head', array($this, 'action_setup_screens'));
     add_action('admin_action_sf_duplicate_form', array($this, 'action_duplicate_post_as_draft'));
     add_filter('page_row_actions', array($this, 'action_duplicate_post_link'), 10, 2);
     /* AJAX */
     add_action('wp_ajax_meta_prefs_set', array($this, 'meta_prefs_set'));
     //if logged in
     add_action('wp_ajax_get_meta_values', array($this, 'get_meta_values'));
     //if logged in
     add_action('wp_ajax_get_taxonomy_terms', array($this, 'get_taxonomy_terms'));
     //if logged in
     add_action('wp_ajax_search_filter_build_cache_table', array($this, 'search_filter_build_cache_tables'));
     //if logged in
     add_filter('manage_edit-' . $this->plugin_slug . '-widget_columns', array($this, 'set_custom_sf_columns'));
     add_action('manage_' . $this->plugin_slug . '-widget_posts_custom_column', array($this, 'custom_sf_column'), 10, 2);
     add_filter('post_updated_messages', array($this, 'sf_updated_messages'));
     //add_action('init', array($this, 'admin_init'));
 }
 public function __construct()
 {
     /*
      * Call $plugin_slug from public plugin class.
      */
     $plugin = Search_Filter::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     // Load widgets admin style she	et and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     /* AJAX */
     /*
     add_action( 'wp_ajax_meta_prefs_set', array($this, 'meta_prefs_set') ); //if logged in
     add_action( 'wp_ajax_nopriv_meta_prefs_set', array($this, 'meta_prefs_set') ); //if not logged in
     */
 }
 public function __construct()
 {
     /*
      * Call $plugin_slug from public plugin class.
      */
     $plugin = Search_Filter::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     // Load widgets admin style she	et and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     add_action('add_meta_boxes', array($this, 'add_posts_meta_boxes'));
     add_action('admin_notices', array($this, 'sf_posts_admin_notice'));
     /* Save post meta on the 'save_post' hook. */
     add_action('save_post', array($this, 'save_search_form_meta'), 10, 2);
     /* AJAX */
     /*
     add_action( 'wp_ajax_meta_prefs_set', array($this, 'meta_prefs_set') ); //if logged in
     add_action( 'wp_ajax_nopriv_meta_prefs_set', array($this, 'meta_prefs_set') ); //if not logged in
     */
 }
Ejemplo n.º 6
0
 /**
  * Return an instance of this class.
  *
  * @since     1.0.0
  *
  * @return    object    A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }