function op_remove_ngg_parse_content_filter()
{
    global $wp_filter;
    if (DOING_AJAX && class_exists('C_NextGen_Shortcode_Manager') && 0 === strpos($_POST['action'], 'optimizepress')) {
        remove_filter('the_content', array(C_NextGen_Shortcode_Manager::get_instance(), 'parse_content'), PHP_INT_MAX - 1);
    }
}
Пример #2
0
 function _register_hooks()
 {
     if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) {
         C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode'));
         C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode'));
     }
 }
Пример #3
0
 function _register_hooks()
 {
     if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) {
         C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode'));
     }
     C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode'));
 }
 function _register_hooks()
 {
     if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) {
         C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'render_shortcode'));
     }
     C_NextGen_Shortcode_Manager::add('nggimagebrowser', array(&$this, 'render_shortcode'));
 }
 /**
  * Registers hooks for the WordPress framework
  */
 function _register_hooks()
 {
     // Add a shortcode for displaying galleries
     C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
     add_action('init', array(&$this, '_register_resources'));
     add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100);
 }
 function _register_hooks()
 {
     if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) {
         C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'render_shortcode'));
         C_NextGen_Shortcode_Manager::add('nggimagebrowser', array(&$this, 'render_shortcode'));
     }
     add_action('ngg_routes', array(&$this, 'define_routes'));
 }
 /**
  * Gets an instance of the class
  * @return C_NextGen_Shortcode_Manager
  */
 static function get_instance()
 {
     if (is_null(self::$_instance)) {
         $klass = get_class();
         self::$_instance = new $klass();
     }
     return self::$_instance;
 }
 function _register_hooks()
 {
     if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) {
         C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
     }
     C_NextGen_Shortcode_Manager::add('nggtagcloud', array(&$this, 'render_shortcode'));
     add_filter('the_posts', array($this->get_registry()->get_utility('I_Taxonomy_Controller'), 'detect_ngg_tag'), -10, 2);
 }
 function _register_hooks()
 {
     if (!is_admin() && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) {
         C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'render_shortcode'));
         C_NextGen_Shortcode_Manager::add('nggimagebrowser', array(&$this, 'render_shortcode'));
     }
     add_action('ngg_routes', array(&$this, 'define_routes'));
 }
 function _register_hooks()
 {
     if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) {
         C_NextGen_Shortcode_Manager::add('singlepic', array(&$this, 'render_singlepic'));
         C_NextGen_Shortcode_Manager::add('nggsinglepic', array(&$this, 'render_singlepic'));
         // enqueue the singlepic CSS if an inline image has the ngg-singlepic class
         add_filter('the_content', array(&$this, 'enqueue_singlepic_css'), PHP_INT_MAX, 1);
     }
 }
 function _register_hooks()
 {
     if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) {
         C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
         C_NextGen_Shortcode_Manager::add('nggtagcloud', array(&$this, 'render_shortcode'));
         add_filter('the_posts', array(C_Taxonomy_Controller::get_instance(), 'detect_ngg_tag'), -10, 2);
     }
     add_action('ngg_routes', array(&$this, 'define_routes'));
 }
 function _register_hooks()
 {
     C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'render'));
     C_NextGen_Shortcode_Manager::add('nggtags', array(&$this, 'render_based_on_tags'));
     C_NextGen_Shortcode_Manager::add('random', array(&$this, 'render_random_images'));
     C_NextGen_Shortcode_Manager::add('recent', array(&$this, 'render_recent_images'));
     C_NextGen_Shortcode_Manager::add('thumb', array(&$this, 'render_thumb_shortcode'));
     C_NextGen_Shortcode_Manager::add('slideshow', array(&$this, 'render_slideshow'));
     C_NextGen_Shortcode_Manager::add('nggslideshow', array(&$this, 'render_slideshow'));
 }
 /**
  * Registers hooks for the WordPress framework
  */
 function _register_hooks()
 {
     // Add a shortcode for displaying galleries
     C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
     add_action('init', array(&$this, '_register_resources'));
     add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100);
     add_filter('the_content', array($this, '_render_related_images'));
     add_action('wp_enqueue_scripts', array(&$this, 'no_resources_mode'), PHP_INT_MAX - 1);
     add_filter('run_ngg_resource_manager', array(&$this, 'no_resources_mode'));
 }
 function _register_hooks()
 {
     if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) {
         C_NextGen_Shortcode_Manager::add('random', array(&$this, 'render_random_images'));
         C_NextGen_Shortcode_Manager::add('recent', array(&$this, 'render_recent_images'));
         C_NextGen_Shortcode_Manager::add('thumb', array(&$this, 'render_thumb_shortcode'));
         C_NextGen_Shortcode_Manager::add('slideshow', array(&$this, 'render_slideshow'));
     }
     C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'render'));
     C_NextGen_Shortcode_Manager::add('nggtags', array(&$this, 'render_based_on_tags'));
     C_NextGen_Shortcode_Manager::add('nggslideshow', array(&$this, 'render_slideshow'));
     C_NextGen_Shortcode_Manager::add('nggrandom', array(&$this, 'render_random_images'));
     C_NextGen_Shortcode_Manager::add('nggrecent', array(&$this, 'render_recent_images'));
     C_NextGen_Shortcode_Manager::add('nggthumb', array(&$this, 'render_thumb_shortcode'));
 }
 function initialize()
 {
     parent::initialize();
     if (!is_admin()) {
         // adds lightbox JS overrides
         if (version_compare(NGG_PLUGIN_VERSION, '2.0.67') >= 0) {
             M_NextGen_Pro_Lightbox::add_component('photocrati-nextgen_pro_proofing', 'C_NextGen_Pro_Proofing_Lightbox');
         } else {
             M_NextGen_Pro_Lightbox_Legacy::add_component('photocrati-nextgen_pro_proofing', 'C_NextGen_Pro_Proofing_Lightbox');
         }
         $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance();
         $triggers->add(NGG_PRO_PROOFING_TRIGGER, 'C_NextGen_Pro_Proofing_Trigger');
         C_NextGen_Shortcode_Manager::add('ngg_pro_proofing', array(&$this, 'render_proofed_images'));
     }
 }
Пример #16
0
 function _register_hooks()
 {
     if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) {
         C_NextGen_Shortcode_Manager::add('random', array(&$this, 'render_random_images'));
         C_NextGen_Shortcode_Manager::add('recent', array(&$this, 'render_recent_images'));
         C_NextGen_Shortcode_Manager::add('thumb', array(&$this, 'render_thumb_shortcode'));
         C_NextGen_Shortcode_Manager::add('slideshow', array(&$this, 'render_slideshow'));
         C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'render'));
         C_NextGen_Shortcode_Manager::add('nggtags', array(&$this, 'render_based_on_tags'));
         C_NextGen_Shortcode_Manager::add('nggslideshow', array(&$this, 'render_slideshow'));
         C_NextGen_Shortcode_Manager::add('nggrandom', array(&$this, 'render_random_images'));
         C_NextGen_Shortcode_Manager::add('nggrecent', array(&$this, 'render_recent_images'));
         C_NextGen_Shortcode_Manager::add('nggthumb', array(&$this, 'render_thumb_shortcode'));
     }
     add_action('ngg_routes', array(&$this, 'define_routes'));
 }
 /**
  * Registers hooks for the WordPress framework
  */
 function _register_hooks()
 {
     if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) {
         C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
         add_action('wp_enqueue_scripts', array(&$this, 'no_resources_mode'), PHP_INT_MAX - 1);
         add_filter('the_content', array($this, '_render_related_images'));
     }
     add_action('init', array(&$this, 'register_resources'), 12);
     add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100);
     add_filter('run_ngg_resource_manager', array(&$this, 'no_resources_mode'));
     add_action('init', array(&$this, 'serve_fontawesome'), 15);
     // Add hook to delete displayed galleries when removed from a post
     add_action('pre_post_update', array(&$this, 'locate_stale_displayed_galleries'));
     add_action('before_delete_post', array(&$this, 'locate_stale_displayed_galleries'));
     add_action('post_updated', array(&$this, 'cleanup_displayed_galleries'));
     add_action('after_delete_post', array(&$this, 'cleanup_displayed_galleries'));
     add_action('wp_print_styles', array($this, 'fix_nextgen_custom_css_order'), PHP_INT_MAX - 1);
 }
Пример #18
0
 /**
  * Filter support for WordPress SEO by Yoast 0.4.0 or higher ( http://wordpress.org/extend/plugins/wordpress-seo/ )
  *
  * @since Version 1.8.0
  * @param array $images
  * @param int $post ID
  * @return array $image list of all founded images
  */
 function add_wpseo_xml_sitemap_images($images, $post_id)
 {
     $this->images = $images;
     // first get the content of the post/page
     $p = get_post($post_id);
     // Backward check for older images
     $p->post_content = NextGEN_Shortcodes::convert_shortcode($p->post_content);
     // Don't process the images in the normal way
     remove_all_shortcodes();
     // We cannot parse at this point a album, just galleries & single images
     C_NextGen_Shortcode_Manager::add('singlepic', array(&$this, 'add_images'));
     C_NextGen_Shortcode_Manager::add('thumb', array(&$this, 'add_images'));
     C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'add_gallery'));
     C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'add_gallery'));
     C_NextGen_Shortcode_Manager::add('slideshow', array(&$this, 'add_gallery'));
     // Search now for shortcodes
     do_shortcode($p->post_content);
     return $this->images;
 }
 function initialize()
 {
     parent::initialize();
     if (!is_admin()) {
         // Add lightbox components
         if (version_compare(NGG_PLUGIN_VERSION, '2.0.67') >= 0) {
             M_NextGen_Pro_Lightbox::add_component('photocrati-add_to_cart', 'C_NextGen_Pro_Add_To_Cart');
         } else {
             M_NextGen_Pro_Lightbox_Legacy::add_component('photocrati-add_to_cart', 'C_NextGen_Pro_Add_To_Cart');
         }
         // Add trigger
         $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance();
         $triggers->add(NGG_ECOMMERCE_TRIGGER, 'C_NextGen_Pro_Ecommerce_Trigger');
         C_NextGen_Shortcode_Manager::add('ngg_pro_cart_count', array(&$this, 'render_cart_count'));
         C_NextGen_Shortcode_Manager::add('ngg_pro_checkout', array(&$this, 'render_checkout_form'));
         C_NextGen_Shortcode_Manager::add('ngg_pro_digital_downloads', array(&$this, 'render_digital_downloads'));
         C_NextGen_Shortcode_Manager::add('ngg_pro_order_details', array(&$this, 'render_order_details'));
         C_NextGen_Shortcode_Manager::add('ngg_pro_verify_order', array(&$this, 'render_order_verification'));
     }
     // Add pricelist sources
     $sources = C_Pricelist_Source_Manager::get_instance();
     $sources->register(NGG_PRO_MANUAL_PRICELIST_SOURCE, array('title' => __('Manual Pricelist', 'nextgen-gallery-pro'), 'shipping_method' => 'C_NextGen_Pro_Flat_Rate_Shipping_Calculator', 'settings_field' => 'manual_settings'));
     $sources->register(NGG_PRO_DIGITAL_DOWNLOADS_SOURCE, array('title' => __('Digital Downloads', 'nextgen-gallery-pro'), 'shipping_method' => NULL, 'settings_field' => 'digital_download_settings'));
 }
 function _register_hooks()
 {
     C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
 }
 function _register_hooks()
 {
     C_NextGen_Shortcode_Manager::add('singlepic', array(&$this, 'render_singlepic'));
 }
Пример #22
0
 function _load_non_pope()
 {
     // Load caching component
     include_once 'non_pope/class.photocrati_transient_manager.php';
     if (isset($_REQUEST['ngg_flush']) or isset($_REQUEST['ngg_flush_expired'])) {
         C_Photocrati_Transient_Manager::flush();
         die("Flushed all caches");
     }
     // Load Settings Manager
     include_once 'non_pope/class.photocrati_settings_manager.php';
     include_once 'non_pope/class.nextgen_settings.php';
     C_Photocrati_Global_Settings_Manager::$option_name = $this->_settings_option_name;
     C_Photocrati_Settings_Manager::$option_name = $this->_settings_option_name;
     // Load the installer
     include_once 'non_pope/class.photocrati_installer.php';
     // Load the resource manager
     include_once 'non_pope/class.photocrati_resource_manager.php';
     C_Photocrati_Resource_Manager::init();
     // Load the style manager
     include_once 'non_pope/class.nextgen_style_manager.php';
     // Load the shortcode manager
     include_once 'non_pope/class.nextgen_shortcode_manager.php';
     C_NextGen_Shortcode_Manager::get_instance();
 }
Пример #23
0
 /**
  * Weaver II's 'weaver_show_posts' shortcode creates a new wp-query, causing a second round of 'the_content'
  * filters to apply. This checks for WeaverII and enables all NextGEN shortcodes that would otherwise be left
  * disabled by our shortcode manager. See https://core.trac.wordpress.org/ticket/17817 for more.
  *
  * @param $content
  * @return $content
  */
 function check_weaverii($content)
 {
     if (function_exists('weaverii_show_posts_shortcode')) {
         C_NextGen_Shortcode_Manager::get_instance()->activate_all();
     }
     return $content;
 }
 function _register_hooks()
 {
     C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
     add_filter('the_posts', array($this->get_registry()->get_utility('I_Taxonomy_Controller'), 'detect_ngg_tag'), -10, 2);
 }
 function _register_hooks()
 {
     C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'render_shortcode'));
 }
Пример #26
0
 function _register_hooks()
 {
     C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode'));
     C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode'));
 }