/**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
     // Add a custom media button to the editor.
     add_filter('media_buttons_context', array($this, 'media_button'));
 }
 /**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
     // Delete any gallery association on attachment deletion. Also delete any extra cropped images.
     add_action('delete_attachment', array($this, 'delete_gallery_association'));
     add_action('delete_attachment', array($this, 'delete_cropped_image'));
     // Ensure gallery display is correct when trashing/untrashing galleries.
     add_action('wp_trash_post', array($this, 'trash_gallery'));
     add_action('untrash_post', array($this, 'untrash_gallery'));
 }
 /**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
     // Build the labels for the post type.
     $labels = apply_filters('hw_gallery_post_type_labels', array('name' => __('Envira Gallery', 'hw-gallery'), 'singular_name' => __('Envira Gallery', 'hw-gallery'), 'add_new' => __('Add New', 'hw-gallery'), 'add_new_item' => __('Add New Envira Gallery', 'hw-gallery'), 'edit_item' => __('Edit Envira Gallery', 'hw-gallery'), 'new_item' => __('New Envira Gallery', 'hw-gallery'), 'view_item' => __('View Envira Gallery', 'hw-gallery'), 'search_items' => __('Search Envira Galleries', 'hw-gallery'), 'not_found' => __('No Envira galleries found.', 'hw-gallery'), 'not_found_in_trash' => __('No Envira galleries found in trash.', 'hw-gallery'), 'parent_item_colon' => '', 'menu_name' => __('Envira Gallery', 'hw-gallery')));
     // Build out the post type arguments.
     $args = apply_filters('hw_gallery_post_type_args', array('labels' => $labels, 'public' => false, 'exclude_from_search' => false, 'show_ui' => true, 'show_in_admin_bar' => true, 'rewrite' => false, 'query_var' => false, 'menu_position' => apply_filters('hw_gallery_post_type_menu_position', 247), 'menu_icon' => plugins_url('assets/css/images/menu-icon@2x.png', $this->base->file), 'supports' => array('title')));
     // Register the post type with WordPress.
     register_post_type('hw-gallery', $args);
 }
 /**
  * init gallery skin
  */
 public function load_gallery()
 {
     // Load the metabox class.
     if (empty($this->gallery) && class_exists('HW_Gallery_Lite')) {
         $this->gallery = HW_Gallery_Lite::get_instance();
         // Load the base class object.
     }
     if (empty($this->gallery_metaboxes) && class_exists('HW_Gallery_Metaboxes_Lite')) {
         $this->gallery_metaboxes = HW_Gallery_Metaboxes_Lite::get_instance();
         // Load the base class object.
     }
 }
 /**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
     // Remove quick editing from the Envira post type row actions.
     add_filter('post_row_actions', array($this, 'row_actions'));
     // Manage post type columns.
     add_filter('manage_edit-hw-gallery_columns', array($this, '_gallery_columns'));
     add_filter('manage_hw-gallery_posts_custom_column', array($this, '_gallery_custom_columns'), 10, 2);
     // Update post type messages.
     add_filter('post_updated_messages', array($this, 'messages'));
     // Force the menu icon to be scaled to proper size (for Retina displays).
     add_action('admin_head', array($this, 'menu_icon'));
 }
 /**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
     // Load metabox assets.
     add_action('admin_enqueue_scripts', array($this, 'meta_box_styles'));
     add_action('admin_enqueue_scripts', array($this, 'meta_box_scripts'));
     // Load the metabox hooks and filters.
     add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 100);
     // Load all tabs.
     add_action('hw_gallery_tab_images', array($this, 'images_tab'));
     add_action('hw_gallery_tab_config', array($this, 'config_tab'));
     add_action('hw_gallery_tab_lightbox', array($this, 'lightbox_tab'));
     add_action('hw_gallery_tab_misc', array($this, 'misc_tab'));
     // Add action to save metabox config options.
     add_action('save_post', array($this, 'save_meta_boxes'), 10, 2);
 }
 /**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
     /*wp_enqueue_script($this->base->plugin_slug. '-fancybox.js', HW_GALLERY_ENVIRA_PLUGIN_URL . '/assets/js/lib/fancybox.js', array('jquery'));
       wp_enqueue_script($this->base->plugin_slug. '-isotope.js', HW_GALLERY_ENVIRA_PLUGIN_URL . '/assets/js/lib/isotope.js', array('jquery'));
       wp_enqueue_script($this->base->plugin_slug. '-touchsupport.js', HW_GALLERY_ENVIRA_PLUGIN_URL . '/assets/js/lib/touchsupport.js', array('jquery'));*/
     // Register main gallery style.
     wp_register_style($this->base->plugin_slug . '-style', plugins_url('assets/css/gallery.css', $this->base->file), array(), $this->base->version);
     // Register main gallery script.
     //wp_register_script( $this->base->plugin_slug . '-script', plugins_url( 'assets/js/min/envira-min.js', $this->base->file ), array( 'jquery' ), $this->base->version, true );
     /**
      * assets/js/gallery.js
      * note: hw-gallery.min.js = js/gallery.js + lib/*
      */
     wp_register_script($this->base->plugin_slug . '-script', plugins_url('assets/js/min/hw-gallery.min.js', $this->base->file), array('jquery'), $this->base->version, true);
     // Load hooks and filters.
     add_shortcode('hw-gallery', array($this, 'shortcode'));
 }
Example #8
0
 /**
  * Primary class constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load the base class object.
     $this->base = HW_Gallery_Lite::get_instance();
 }
 /**
  * Returns the singleton instance of the class.
  *
  * @since 1.0.0
  *
  * @return object The HW_Gallery_Lite object.
  */
 public static function get_instance()
 {
     if (!isset(self::$instance) && !self::$instance instanceof HW_Gallery_Lite) {
         self::$instance = new HW_Gallery_Lite();
     }
     return self::$instance;
 }