Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 public function __construct($core)
 {
     $this->core = $core;
     # Define filters
     Add_Action('widgets_init', array($this, 'Find_WPML'));
     Add_Filter('gettext_with_context', array($this, 'Filter_Gettext_with_Context'), 1, 4);
 }
 static function Init()
 {
     Add_Filter('query_vars', array(__CLASS__, 'registerQueryVars'));
     Add_Filter('pre_get_posts', array(__CLASS__, 'filterQuery'));
     Add_Filter('posts_where', array(__CLASS__, 'filterPostsWhere'), 10, 2);
     Add_Filter('posts_fields', array(__CLASS__, 'filterPostsFields'), 10, 2);
     Add_Filter('posts_orderby', array(__CLASS__, 'filterPostsOrderBy'), 10, 2);
 }
Ejemplo n.º 4
0
 static function Init($plugin_file)
 {
     self::$plugin_file = $plugin_file;
     self::$plugin_folder = DirName(self::$plugin_file);
     self::loadBaseURL();
     Register_Activation_Hook(self::$plugin_file, array(__CLASS__, 'installPlugin'));
     Add_Action('loop_start', array(__CLASS__, 'printPrefixFilter'));
     Add_Filter('the_content', array(__CLASS__, 'filterContent'));
 }
Ejemplo n.º 5
0
 function __construct($core)
 {
     $this->core = $core;
     $this->arr_meta_box = array();
     Add_Action('init', array($this, 'Register_Post_Type'));
     Add_Action('init', array($this, 'Register_Taxonomies'));
     Add_Action('init', array($this, 'Add_Taxonomy_Archive_Urls'), 99);
     Add_Filter('image_upload_iframe_src', array($this, 'Image_Upload_Iframe_Src'));
     Add_Filter('post_updated_messages', array($this, 'Updated_Messages'));
     Add_Action(SPrintF('save_post_%s', $this->name), array($this, 'Save_Meta_Box'), 10, 2);
     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'));
     }
 }
Ejemplo n.º 6
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;
 }
Ejemplo n.º 7
0
 static function Init()
 {
     Add_Filter('gettext_with_context', array(__CLASS__, 'filterGettextWithContext'), 1, 4);
     Add_Filter('glossary_available_prefix_filters', array(__CLASS__, 'filterAvailablePrefixFilters'));
 }
Ejemplo n.º 8
0
 static function Init()
 {
     Add_Filter('post_updated_messages', array(__CLASS__, 'filterUpdatedMessages'));
     Add_Action('init', array(__CLASS__, 'registerPostType'), 11);
 }
Ejemplo n.º 9
0
 static function Init()
 {
     Add_Filter('admin_init', array(__CLASS__, 'defineRewriteRules'));
     Add_Filter('rewrite_rules_array', array(__CLASS__, 'addRewriteRules'));
     Add_Action('admin_init', array(__CLASS__, 'flushRewriteRules'));
 }
 function Add_Gallery_Meta_Boxes()
 {
     global $post_type_object;
     // Enqueue Edit Gallery JavaScript/CSS
     WP_Enqueue_Script('fancy-gallery-meta-boxes', $this->base_url . '/meta-boxes.js', array('jquery'), $this->version);
     WP_Enqueue_Style('fancy-gallery-meta-boxes', $this->base_url . '/meta-boxes.css', False, $this->version);
     // Remove Meta Boxes
     Remove_Meta_Box('authordiv', $this->gallery_post_type, 'normal');
     Remove_Meta_Box('postexcerpt', $this->gallery_post_type, 'normal');
     // Change some core texts
     Add_Filter('gettext', array($this, 'Filter_GetText'), 10, 3);
     // Register Meta Boxes
     $this->Add_Gallery_Meta_Box($this->t('Images'), DirName(__FILE__) . '/gallery-meta-box-images.php', 'normal', 'high');
     if (!$this->get_option('disable_excerpts')) {
         $this->Add_Gallery_Meta_Box($this->t('Excerpt'), DirName(__FILE__) . '/gallery-meta-box-excerpt.php', 'normal', 'high');
     }
     $this->Add_Gallery_Meta_Box($this->t('Template'), DirName(__FILE__) . '/gallery-meta-box-template.php', 'normal', 'high');
     if (Current_User_Can($post_type_object->cap->edit_others_posts)) {
         $this->Add_Gallery_Meta_Box($this->t('Owner'), DirName(__FILE__) . '/gallery-meta-box-owner.php');
     }
     $this->Add_Gallery_Meta_Box($this->t('Gallery ShortCode'), DirName(__FILE__) . '/gallery-meta-box-show-code.php', 'side', 'high');
     $this->Add_Gallery_Meta_Box($this->t('Thumbnails'), DirName(__FILE__) . '/gallery-meta-box-thumbnails.php', 'side');
     // Add Meta Boxes
     foreach ($this->arr_gallery_meta_box as $box_index => $meta_box) {
         Add_Meta_Box(BaseName($meta_box['include_file'], '.php'), $meta_box['title'], array($this, 'Print_Gallery_Meta_Box'), $this->gallery_post_type, $meta_box['column'], $meta_box['priority'], $box_index);
     }
 }
Ejemplo n.º 11
0
 static function Init()
 {
     Add_Filter('search_template', array(__CLASS__, 'changeSearchTemplate'));
 }
Ejemplo n.º 12
0
 public static function Init()
 {
     Add_Filter('gettext_with_context', array(__CLASS__, 'Filter_Gettext_with_Context'), 1, 4);
 }