/** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Load the base class object. $this->base = Envira_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 = Envira_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 = Envira_Gallery_Lite::get_instance(); // Build the labels for the post type. $labels = apply_filters('envira_gallery_post_type_labels', array('name' => __('Envira Gallery', 'envira-gallery-lite'), 'singular_name' => __('Envira Gallery', 'envira-gallery-lite'), 'add_new' => __('Add New', 'envira-gallery-lite'), 'add_new_item' => __('Add New Envira Gallery', 'envira-gallery-lite'), 'edit_item' => __('Edit Envira Gallery', 'envira-gallery-lite'), 'new_item' => __('New Envira Gallery', 'envira-gallery-lite'), 'view_item' => __('View Envira Gallery', 'envira-gallery-lite'), 'search_items' => __('Search Envira Galleries', 'envira-gallery-lite'), 'not_found' => __('No Envira galleries found.', 'envira-gallery-lite'), 'not_found_in_trash' => __('No Envira galleries found in trash.', 'envira-gallery-lite'), 'parent_item_colon' => '', 'menu_name' => __('Envira Gallery', 'envira-gallery-lite'))); // Build out the post type arguments. $args = apply_filters('envira_gallery_post_type_args', array('labels' => $labels, 'public' => false, 'exclude_from_search' => false, 'show_ui' => true, 'show_in_admin_bar' => false, 'rewrite' => false, 'query_var' => false, 'menu_position' => apply_filters('envira_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('envira', $args); }
/** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Load the base class object. $this->base = Envira_Gallery_Lite::get_instance(); // Register main gallery style. wp_register_style($this->base->plugin_slug . '-style', plugins_url('assets/css/envira.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); // Load hooks and filters. add_shortcode('envira-gallery', array($this, 'shortcode')); }
/** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Load the base class object. $this->base = Envira_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-envira_columns', array($this, 'envira_columns')); add_filter('manage_envira_posts_custom_column', array($this, 'envira_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 = Envira_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('envira_gallery_tab_images', array($this, 'images_tab')); add_action('envira_gallery_tab_config', array($this, 'config_tab')); add_action('envira_gallery_tab_lightbox', array($this, 'lightbox_tab')); add_action('envira_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 = Envira_Gallery_Lite::get_instance(); }
/** * Returns the singleton instance of the class. * * @since 1.0.0 * * @return object The Envira_Gallery_Lite object. */ public static function get_instance() { if (!isset(self::$instance) && !self::$instance instanceof Envira_Gallery_Lite) { self::$instance = new Envira_Gallery_Lite(); } return self::$instance; }
/** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Load the base class object. $this->base = Envira_Gallery_Lite::get_instance(); add_filter('wp_handle_upload', array($this, 'fix_image_orientation')); }