示例#1
0
 function __construct($plugin_file)
 {
     # Read base
     $this->Load_Base_Url();
     # Template directory
     $this->template_dir = WP_CONTENT_DIR . '/fancy-gallery-templates';
     # Helper classes
     $this->gallery_post_type = new Gallery_Post_Type($this);
     $this->i18n = new I18n($this);
     $this->lightbox = new Lightbox($this);
     $this->mocking_bird = new Mocking_Bird($this);
     $this->options = new Options($this);
     $this->wpml = new WPML($this);
     # This Plugin supports post thumbnails
     Add_Theme_Support('post-thumbnails');
     # Set Hooks
     Register_Activation_Hook($plugin_file, array($this, 'Plugin_Activation'));
     Add_Filter('the_content', array($this, 'Filter_Content'), 11);
     Add_Filter('the_content_feed', array($this, 'Filter_Feed_Content'));
     Add_Filter('the_excerpt_rss', array($this, 'Filter_Feed_Content'));
     Add_Action('wp_enqueue_scripts', array($this, 'Enqueue_Frontend_Scripts'));
     Add_Action('widgets_init', array($this, 'Register_Widgets'));
     Add_Filter('post_class', array($this, 'Filter_Post_Class'));
     Add_ShortCode('gallery', array($this, 'ShortCode_Gallery'));
     if (!$this->options->Get('disable_excerpts')) {
         Add_Filter('get_the_excerpt', array($this, 'Filter_Excerpt'), 9);
     }
     # Add to GLOBALs
     $GLOBALS[__CLASS__] = $this;
 }
 function __construct()
 {
     // Read base
     $this->base_url = get_bloginfo('wpurl') . '/' . SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH));
     $this->base_url = Str_Replace("\\", '/', $this->base_url);
     // Windows Workaround
     // Option boxes
     $this->arr_option_box = array('main' => array(), 'side' => array());
     // Meta Boxes
     $this->arr_gallery_meta_box = array();
     // Template directory
     $this->template_dir = WP_CONTENT_DIR . '/fancy-gallery-templates';
     // Get ready to translate
     Add_Action('widgets_init', array($this, 'Load_TextDomain'));
     // This Plugin supports post thumbnails
     if (Function_Exists('Add_Theme_Support')) {
         Add_Theme_Support('post-thumbnails');
     }
     // Load Update class
     $this->Load_Construct(DirName(__FILE__) . '/construct.updates.php', 'Fancy_Gallery_Pro_Updates');
     new Fancy_Gallery_Pro_Updates(__FILE__, $this->Get_Option('update_username'), $this->Get_Option('update_password'), !$this->get_option('disable_update_notification'));
     // Set Hooks
     Register_Activation_Hook(__FILE__, array($this, 'Plugin_Activation'));
     Add_Action('init', array($this, 'Register_Gallery_Post_Type'));
     Add_Action('init', array($this, 'Register_Gallery_Taxonomies'));
     Add_Action('init', array($this, 'Add_Taxonomy_Archive_Urls'), 99);
     Add_Action('init', array($this, 'Add_GetTextFilter'), 99);
     Add_Filter('post_updated_messages', array($this, 'Gallery_Updated_Messages'));
     Add_Action('admin_menu', array($this, 'Add_Options_Page'));
     Add_Filter('the_content', array($this, 'Filter_Content'), 9);
     Add_Filter('the_content_feed', array($this, 'Filter_Feed_Content'));
     Add_Filter('the_excerpt_rss', array($this, 'Filter_Feed_Content'));
     Add_Filter('image_upload_iframe_src', array($this, 'Image_Upload_Iframe_Src'));
     Add_Filter('post_class', array($this, 'Filter_Post_Class'));
     Add_Action('wp_enqueue_scripts', array($this, 'enqueue_frontend_scripts'));
     Add_Action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     Add_Action('save_post', array($this, 'Save_Meta_Box'));
     Add_ShortCode('gallery', array($this, 'ShortCode_Gallery'));
     if (isset($_REQUEST['strip_tabs'])) {
         Add_Action('media_upload_gallery', array($this, 'Add_Media_Upload_Style'));
         Add_Action('media_upload_image', array($this, 'Add_Media_Upload_Style'));
         Add_Filter('media_upload_tabs', array($this, 'Media_Upload_Tabs'));
         Add_Filter('media_upload_form_url', array($this, 'Media_Upload_Form_URL'));
         Add_Action('media_upload_import_images', array($this, 'Import_Images'));
     }
     if (!$this->get_option('disable_excerpts')) {
         Add_Filter('get_the_excerpt', array($this, 'Filter_Excerpt'), 9);
     }
     // Add to GLOBALs
     $GLOBALS[__CLASS__] = $this;
 }
示例#3
0
 function __construct($plugin_file)
 {
     self::$plugin_file = $plugin_file;
     self::$plugin_folder = DirName(self::$plugin_file);
     # Read base
     $this->Load_Base_Url();
     # Template directory
     $this->template_dir = WP_CONTENT_DIR . '/fancy-gallery-templates';
     # Helper classes
     #I18n::Load_TextDomain();
     $this->options = new Options($this);
     $this->gallery_post_type = new Gallery_Post_Type($this);
     if ($this->options->Get('lightbox') == 'on') {
         $this->lightbox = new Lightbox($this);
     }
     $this->mocking_bird = new Mocking_Bird($this);
     # This Plugin supports post thumbnails
     Add_Theme_Support('post-thumbnails');
     # Set Hooks
     Register_Activation_Hook(self::$plugin_file, array($this, 'Plugin_Activation'));
     Add_Filter('the_content', array($this, 'Filter_Content'), 11);
     Add_Filter('the_content_feed', array($this, 'Filter_Feed_Content'));
     Add_Filter('the_excerpt_rss', array($this, 'Filter_Feed_Content'));
     Add_Action('wp_enqueue_scripts', array($this, 'Enqueue_Frontend_Scripts'));
     Add_Action('widgets_init', array($this, 'Register_Widgets'));
     Add_Filter('post_class', array($this, 'Filter_Post_Class'));
     Add_Action('pre_get_posts', array($this, 'Filter_Attachment_Query'));
     Add_Filter('get_the_categories', array($this, 'Filter_Get_The_Categories'));
     Add_Filter('the_category', array($this, 'Filter_The_Category'), 10, 3);
     Add_Filter('get_the_tags', array($this, 'Filter_Get_The_Tags'));
     Add_Filter('the_tags', array($this, 'Filter_The_Tags'), 10, 5);
     Add_ShortCode('gallery', array($this, 'ShortCode_Gallery'));
     if (!$this->options->Get('disable_excerpts')) {
         Add_Filter('get_the_excerpt', array($this, 'Filter_Excerpt'), 9);
     }
     # Add to GLOBALs
     $GLOBALS[__CLASS__] = $this;
 }