• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_cache_add_non_persistent_groups函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_cache_add_non_persistent_groups函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_cache_add_non_persistent_groups函数的具体用法?PHP wp_cache_add_non_persistent_groups怎么用?PHP wp_cache_add_non_persistent_groups使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_cache_add_non_persistent_groups函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: loadAllOptions

 public static function loadAllOptions()
 {
     global $wpdb;
     $options = wp_cache_get('alloptions', 'wordfence');
     if (!$options) {
         $table = self::table();
         self::updateTableExists();
         $suppress = $wpdb->suppress_errors();
         if (!($rawOptions = $wpdb->get_results("SELECT name, val FROM {$table} WHERE autoload = 'yes'"))) {
             $rawOptions = $wpdb->get_results("SELECT name, val FROM {$table}");
         }
         $wpdb->suppress_errors($suppress);
         $options = array();
         foreach ((array) $rawOptions as $o) {
             if (in_array($o->name, self::$serializedOptions)) {
                 $val = maybe_unserialize($o->val);
                 if ($val) {
                     $options[$o->name] = $val;
                 }
             } else {
                 $options[$o->name] = $o->val;
             }
         }
         wp_cache_add_non_persistent_groups('wordfence');
         wp_cache_add('alloptions', $options, 'wordfence');
     }
     return $options;
 }
开发者ID:adamplabarge,项目名称:bermstyle,代码行数:28,代码来源:wfConfig.php


示例2: __construct

 /**
  * PHP 5 constructor
  *
  * @since 1.0-beta
  */
 function __construct()
 {
     // Define post type and taxonomy names for use in the register functions
     $this->post_type_name = apply_filters('bp_docs_post_type_name', 'bp_doc');
     $this->associated_item_tax_name = apply_filters('bp_docs_associated_item_tax_name', 'bp_docs_associated_item');
     $this->access_tax_name = apply_filters('bp_docs_access_tax_name', 'bp_docs_access');
     // :'(
     wp_cache_add_non_persistent_groups(array('bp_docs_nonpersistent'));
     // Let plugins know that BP Docs has started loading
     add_action('plugins_loaded', array($this, 'load_hook'), 20);
     // Load predefined constants first thing
     add_action('bp_docs_load', array($this, 'load_constants'), 2);
     // Includes necessary files
     add_action('bp_docs_load', array($this, 'includes'), 4);
     // Load the BP Component extension
     add_action('bp_docs_load', array($this, 'do_integration'), 6);
     // Load textdomain
     add_action('bp_docs_load', array($this, 'load_plugin_textdomain'));
     // Let other plugins know that BP Docs has finished initializing
     add_action('bp_init', array($this, 'init_hook'));
     // Hooks into the 'init' action to register our WP custom post type and tax
     add_action('bp_docs_init', array($this, 'register_post_type'), 2);
     add_action('bp_docs_init', array(&$this, 'add_rewrite_tags'), 4);
     // Set up doc taxonomy, etc
     add_action('bp_docs_init', array($this, 'load_doc_extras'), 8);
     // Add rewrite rules
     add_action('generate_rewrite_rules', array(&$this, 'generate_rewrite_rules'));
     // parse_query
     add_action('parse_query', array($this, 'parse_query'));
     // Protect doc access
     add_action('template_redirect', array($this, 'protect_doc_access'));
     add_action('admin_init', array($this, 'flush_rewrite_rules'));
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:38,代码来源:bp-docs.php


示例3: __construct

 function __construct()
 {
     // vars
     $this->cache = array();
     $this->reference = array();
     // prevent ACF from persistent cache
     wp_cache_add_non_persistent_groups('acf');
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:8,代码来源:cache.php


示例4: add_non_persistent_groups

 /**
  * Adds a non-persistent group to the list.
  *
  * @uses	wp_cache_add_non_persistent_groups
  *
  * @param 	array 			$args				Function arguments.
  * @param 	array 			$assoc_args			Function arguments with parameter key.
  * @return	void
  */
 public function add_non_persistent_groups($args, $assoc_args)
 {
     if (empty($args)) {
         WP_CLI::line('usage: wp cache add_non_persistent_groups <group>');
         exit;
     }
     $group = $args[0];
     wp_cache_add_non_persistent_groups($group);
 }
开发者ID:rpeterson,项目名称:wp-cli,代码行数:18,代码来源:cache.php


示例5: init

 function init()
 {
     //Add non-persistent cache group
     wp_cache_add_non_persistent_groups(self::SLUG);
     //Registers GET listener to toggle setting
     $this->register_endpoints();
     //Message if WPML installed
     if ($this->wpml_installed()) {
         add_action('admin_notices', array($this, 'admin_notices'));
     }
 }
开发者ID:rustemcaushi,项目名称:hesk11.com,代码行数:11,代码来源:english-wp-admin.php


示例6: __construct

 /**
  * Constructor.
  *
  * @since 1.9
  */
 public function __construct()
 {
     if (!bp_docs_enable_folders()) {
         return;
     }
     $this->register_post_type();
     $this->register_taxonomies();
     // It is my hope and dream that this will one day be persistent.
     wp_cache_add_non_persistent_groups(array('bp_docs_folders'));
     add_action('bp_docs_enqueue_scripts', array($this, 'enqueue_assets'));
     $this->setup_hooks();
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:17,代码来源:addon-folders.php


示例7: flush_cache

	function flush_cache() {
		global $wp_object_cache;
		$wp_object_cache->group_ops = array();
		$wp_object_cache->stats = array();
		$wp_object_cache->memcache_debug = array();
		$wp_object_cache->cache = array();
		if ( method_exists( $wp_object_cache, '__remoteset' ) ) {
			$wp_object_cache->__remoteset();
		}
		wp_cache_flush();
		wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
		wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:13,代码来源:testcase.php


示例8: init

 public function init()
 {
     wp_cache_add_non_persistent_groups('my-wp-backup');
     add_action('admin_post_MyWPBackup_settings', array($this, 'post_settings'));
     add_action('admin_post_MyWPBackup_import', array($this, 'post_import'));
     add_action(is_multisite() ? 'network_admin_notices' : 'admin_notices', array($this, 'admin_notice'));
     global $current_user;
     $user_id = $current_user->ID;
     if (is_multisite() && is_network_admin() || !is_multisite() && current_user_can('manage_options')) {
         if ('1' === filter_input(INPUT_GET, 'mwpb_notice_close', FILTER_SANITIZE_NUMBER_INT)) {
             add_user_meta($user_id, 'mwpb-notice-1', 'true', true);
         }
     }
     Job::get_instance();
     Backup::get_instance();
 }
开发者ID:akochnov,项目名称:fts,代码行数:16,代码来源:Admin.php


示例9: add_cache_groups

 public function add_cache_groups()
 {
     if (function_exists('wp_cache_add_non_persistent_groups')) {
         wp_cache_add_non_persistent_groups(array('bu-navigation'));
     }
 }
开发者ID:iamapioneer,项目名称:sdas,代码行数:6,代码来源:bu-navigation.php


示例10: cacsp_add_non_persistent_cache_group

/**
 * Add our non-persistent cache group.
 *
 * BuddyPress does not have decent (any) cache support for groups-of-member queries. Adding a
 * non-persistent group here so that we don't have to worry about invalidation. At least this
 * will help with single pages.
 */
function cacsp_add_non_persistent_cache_group()
{
    wp_cache_add_non_persistent_groups(array('cacsp_groups_of_user'));
}
开发者ID:sheesh,项目名称:social-paper,代码行数:11,代码来源:hooks-buddypress-group.php


示例11: wp_start_object_cache

/**
 * Starts the WordPress object cache.
 *
 * If an object-cache.php file exists in the wp-content directory,
 * it uses that drop-in as an external object cache.
 *
 * @access private
 * @since 3.0.0
 */
function wp_start_object_cache()
{
    $first_init = false;
    if (!function_exists('wp_cache_init')) {
        global $_wp_using_ext_object_cache;
        if (file_exists(WP_CONTENT_DIR . '/object-cache.php')) {
            require_once WP_CONTENT_DIR . '/object-cache.php';
            $_wp_using_ext_object_cache = true;
        } else {
            require_once ABSPATH . WPINC . '/cache.php';
            $_wp_using_ext_object_cache = false;
        }
        $first_init = true;
    }
    // If cache supports reset, reset instead of init if already initialized.
    // Reset signals to the cache that global IDs have changed and it may need to update keys
    // and cleanup caches.
    if (!$first_init && function_exists('wp_cache_reset')) {
        wp_cache_reset();
    } else {
        wp_cache_init();
    }
    if (function_exists('wp_cache_add_global_groups')) {
        wp_cache_add_global_groups(array('users', 'userlogins', 'usermeta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts'));
        wp_cache_add_non_persistent_groups(array('comment', 'counts', 'plugins'));
    }
}
开发者ID:beaucollins,项目名称:wp,代码行数:36,代码来源:load.php


示例12: wp_start_object_cache

/**
 * Start the WordPress object cache.
 *
 * If an object-cache.php file exists in the wp-content directory,
 * it uses that drop-in as an external object cache.
 *
 * @since 3.0.0
 * @access private
 *
 * @global int $blog_id Blog ID.
 */
function wp_start_object_cache()
{
    global $blog_id;
    $first_init = false;
    if (!function_exists('wp_cache_init')) {
        if (file_exists(WP_CONTENT_DIR . '/object-cache.php')) {
            require_once WP_CONTENT_DIR . '/object-cache.php';
            if (function_exists('wp_cache_init')) {
                wp_using_ext_object_cache(true);
            }
        }
        $first_init = true;
    } elseif (!wp_using_ext_object_cache() && file_exists(WP_CONTENT_DIR . '/object-cache.php')) {
        /*
         * Sometimes advanced-cache.php can load object-cache.php before
         * it is loaded here. This breaks the function_exists check above
         * and can result in `$_wp_using_ext_object_cache` being set
         * incorrectly. Double check if an external cache exists.
         */
        wp_using_ext_object_cache(true);
    }
    if (!wp_using_ext_object_cache()) {
        require_once ABSPATH . WPINC . '/cache.php';
    }
    /*
     * If cache supports reset, reset instead of init if already
     * initialized. Reset signals to the cache that global IDs
     * have changed and it may need to update keys and cleanup caches.
     */
    if (!$first_init && function_exists('wp_cache_switch_to_blog')) {
        wp_cache_switch_to_blog($blog_id);
    } elseif (function_exists('wp_cache_init')) {
        wp_cache_init();
    }
    if (function_exists('wp_cache_add_global_groups')) {
        wp_cache_add_global_groups(array('users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache'));
        wp_cache_add_non_persistent_groups(array('comment', 'counts', 'plugins'));
    }
}
开发者ID:hughnet,项目名称:WordPress,代码行数:50,代码来源:load.php


示例13: wp_start_object_cache

/**
 * Starts the WordPress object cache.
 *
 * If an object-cache.php file exists in the wp-content directory,
 * it uses that drop-in as an external object cache.
 *
 * @access private
 * @since 3.0.0
 */
function wp_start_object_cache()
{
    global $_wp_using_ext_object_cache;
    $first_init = false;
    if (!function_exists('wp_cache_init')) {
        if (file_exists(WP_CONTENT_DIR . '/object-cache.php')) {
            require_once WP_CONTENT_DIR . '/object-cache.php';
            $_wp_using_ext_object_cache = true;
        } else {
            require_once ABSPATH . WPINC . '/cache.php';
            $_wp_using_ext_object_cache = false;
        }
        $first_init = true;
    } else {
        if (!$_wp_using_ext_object_cache && file_exists(WP_CONTENT_DIR . '/object-cache.php')) {
            // Sometimes advanced-cache.php can load object-cache.php before it is loaded here.
            // This breaks the function_exists check above and can result in $_wp_using_ext_object_cache
            // being set incorrectly. Double check if an external cache exists.
            $_wp_using_ext_object_cache = true;
        }
    }
    // If cache supports reset, reset instead of init if already initialized.
    // Reset signals to the cache that global IDs have changed and it may need to update keys
    // and cleanup caches.
    if (!$first_init && function_exists('wp_cache_reset')) {
        wp_cache_reset();
    } else {
        wp_cache_init();
    }
    if (function_exists('wp_cache_add_global_groups')) {
        wp_cache_add_global_groups(array('users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts'));
        wp_cache_add_non_persistent_groups(array('comment', 'counts', 'plugins'));
    }
}
开发者ID:laiello,项目名称:qinhan,代码行数:43,代码来源:load.php


示例14: restore_current_blog

function restore_current_blog()
{
    global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache;
    if (!$switched) {
        return false;
    }
    if (!is_array($switched_stack)) {
        return false;
    }
    $blog = array_pop($switched_stack);
    if ($blog_id == $blog) {
        do_action('switch_blog', $blog, $blog);
        /* If we still have items in the switched stack, consider ourselves still 'switched' */
        $switched = is_array($switched_stack) && count($switched_stack) > 0;
        return true;
    }
    $wpdb->set_blog_id($blog);
    $prev_blog_id = $blog_id;
    $blog_id = $blog;
    $table_prefix = $wpdb->prefix;
    if (is_object($wp_roles)) {
        $wpdb->suppress_errors();
        if (method_exists($wp_roles, '_init')) {
            $wp_roles->_init();
        } elseif (method_exists($wp_roles, '__construct')) {
            $wp_roles->__construct();
        }
        $wpdb->suppress_errors(false);
    }
    if (did_action('init')) {
        $current_user = wp_get_current_user();
        if (is_object($current_user)) {
            $current_user->for_blog($blog_id);
        }
    }
    if (is_object($wp_object_cache) && isset($wp_object_cache->global_groups)) {
        $global_groups = $wp_object_cache->global_groups;
    } else {
        $global_groups = false;
    }
    wp_cache_init();
    if (function_exists('wp_cache_add_global_groups')) {
        if (is_array($global_groups)) {
            wp_cache_add_global_groups($global_groups);
        } else {
            wp_cache_add_global_groups(array('users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts'));
        }
        wp_cache_add_non_persistent_groups(array('comment', 'counts', 'plugins'));
    }
    do_action('switch_blog', $blog_id, $prev_blog_id);
    /* If we still have items in the switched stack, consider ourselves still 'switched' */
    $switched = is_array($switched_stack) && count($switched_stack) > 0;
    return true;
}
开发者ID:junxuan,项目名称:wordpress,代码行数:54,代码来源:ms-blogs.php


示例15: wp_cache_add_non_persistent_groups

<?php

/**
 * Turn off persistent caching for users.
 *
 * We use memcached for GlotPress because query calculations are very heavy and slow.
 *
 * However some issues were noticed with persistent user caching (very likely due to the WP.org setup)
 * so this turns it off. User queries in GlotPress are comparatively very light.
 *
 * We should test this and remove this plugin at a later date.
 *
 * @author Nacin
 */
wp_cache_add_non_persistent_groups(array('users', 'userlogins', 'usermeta', 'usermail', 'usernicename'));
开发者ID:serhi,项目名称:wordpress-sites,代码行数:15,代码来源:wporg-non-persistent-users.php


示例16: generate

 /**
  * generate()
  *
  * @return bool $success
  **/
 function generate()
 {
     if (function_exists('memory_get_usage') && (int) @ini_get('memory_limit') < 256) {
         @ini_set('memory_limit', '256M');
     }
     include_once dirname(__FILE__) . '/xml-sitemaps-utils.php';
     # disable persistent groups, so as to not pollute memcached
     wp_cache_add_non_persistent_groups(array('posts', 'post_meta'));
     # only keep fields involved in permalinks
     add_filter('posts_fields_request', array($this, 'kill_query_fields'));
     # sitemap.xml
     $sitemap = new sitemap_xml();
     $return = $sitemap->generate();
     # restore fields
     remove_filter('posts_fields_request', array($this, 'kill_query_fields'));
     return $return;
 }
开发者ID:hurtzi,项目名称:Marino-Pardo-WEB-,代码行数:22,代码来源:xml-sitemaps.php


示例17: get_content


//.........这里部分代码省略.........
                 if ($this->p->debug->enabled) {
                     $this->p->debug->log($cache_type . ': wp_cache salt ' . $cache_salt);
                 }
                 $content = wp_cache_get($cache_id, __METHOD__);
                 if ($content !== false) {
                     if ($this->p->debug->enabled) {
                         $this->p->debug->log($cache_type . ': ' . $filter_name . ' content retrieved from wp_cache ' . $cache_id);
                     }
                     return $content;
                 }
             } elseif ($this->p->debug->enabled) {
                 $this->p->debug->log('use_cache = false');
             }
         }
     }
     $content = apply_filters($this->p->cf['lca'] . '_content_seed', '', $post_id, $use_post, $md_idx, $src_id);
     if (!empty($content)) {
         if ($this->p->debug->enabled) {
             $this->p->debug->log('content seed = "' . $content . '"');
         }
     } elseif (!empty($obj->post_content)) {
         $content = $obj->post_content;
     } elseif ($this->p->debug->enabled) {
         $this->p->debug->log('exiting early: empty post content');
     }
     /*
      * modify the content
      */
     // save content length (for comparison) before making changes
     $content_strlen_before = strlen($content);
     // remove singlepics, which we detect and use before-hand
     $content = preg_replace('/\\[singlepic[^\\]]+\\]/', '', $content, -1, $count);
     if ($count > 0) {
         if ($this->p->debug->enabled) {
             $this->p->debug->log($count . ' [singlepic] shortcode(s) removed from content');
         }
     }
     if ($filter_content == true) {
         $filter_removed = apply_filters($this->p->cf['lca'] . '_pre_filter_remove', false, 'the_content');
         // remove all of our shortcodes
         if (isset($this->p->cf['*']['lib']['shortcode']) && is_array($this->p->cf['*']['lib']['shortcode'])) {
             foreach ($this->p->cf['*']['lib']['shortcode'] as $id => $name) {
                 if (array_key_exists($id, $this->shortcode) && is_object($this->shortcode[$id])) {
                     $this->shortcode[$id]->remove();
                 }
             }
         }
         global $post;
         $saved_post = $post;
         // woocommerce can change the $post, so save and restore
         if ($this->p->debug->enabled) {
             $this->p->debug->log('saving $post and applying the_content filters');
         }
         $content = apply_filters('the_content', $content);
         $post = $saved_post;
         // cleanup for NGG pre-v2 album shortcode
         unset($GLOBALS['subalbum']);
         unset($GLOBALS['nggShowGallery']);
         if ($filter_removed) {
             $filter_added = apply_filters($this->p->cf['lca'] . '_post_filter_add', false, 'the_content');
         }
         // add our shortcodes back
         if (isset($this->p->cf['*']['lib']['shortcode']) && is_array($this->p->cf['*']['lib']['shortcode'])) {
             foreach ($this->p->cf['*']['lib']['shortcode'] as $id => $name) {
                 if (array_key_exists($id, $this->shortcode) && is_object($this->shortcode[$id])) {
                     $this->shortcode[$id]->add();
                 }
             }
         }
     } elseif ($this->p->debug->enabled) {
         $this->p->debug->log('the_content filters skipped');
     }
     $content = preg_replace('/[\\s\\n\\r]+/s', ' ', $content);
     // put everything on one line
     $content = preg_replace('/^.*<!--' . $this->p->cf['lca'] . '-content-->(.*)<!--\\/' . $this->p->cf['lca'] . '-content-->.*$/', '$1', $content);
     if (strpos($content, '>Google+<') !== false) {
         $content = preg_replace('/<a +rel="author" +href="" +style="display:none;">Google\\+<\\/a>/', ' ', $content);
     }
     if (!empty($caption_prefix) && strpos($content, '<p class="wp-caption-text">') !== false) {
         $content = preg_replace('/<p class="wp-caption-text">/', '${0}' . $caption_prefix . ' ', $content);
     }
     if (strpos($content, ']]>') !== false) {
         $content = str_replace(']]>', ']]&gt;', $content);
     }
     $content_strlen_after = strlen($content);
     if ($this->p->debug->enabled) {
         $this->p->debug->log('content strlen before ' . $content_strlen_before . ' and after changes / filters ' . $content_strlen_after);
     }
     // apply filters before caching
     $content = apply_filters($this->p->cf['lca'] . '_content', $content, $post_id, $use_post, $md_idx, $src_id);
     if ($filter_content == true && !empty($cache_id)) {
         // only some caching plugins implement this function
         wp_cache_add_non_persistent_groups(array(__METHOD__));
         wp_cache_set($cache_id, $content, __METHOD__, $this->p->options['plugin_object_cache_exp']);
         if ($this->p->debug->enabled) {
             $this->p->debug->log($cache_type . ': ' . $filter_name . ' content saved to wp_cache ' . $cache_id . ' (' . $this->p->options['plugin_object_cache_exp'] . ' seconds)');
         }
     }
     return $content;
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:101,代码来源:webpage.php


示例18: get_content

 public function get_content($use_post = true, $use_cache = true)
 {
     $this->p->debug->args(array('use_post' => $use_post, 'use_cache' => $use_cache));
     $content = false;
     if (($obj = $this->p->util->get_post_object($use_post)) === false) {
         $this->p->debug->log('exiting early: invalid object type');
         return $content;
     }
     $post_id = empty($obj->ID) ? 0 : $obj->ID;
     $this->p->debug->log('using content from object id ' . $post_id);
     $filter_content = $this->p->options['plugin_filter_content'];
     $filter_name = $filter_content ? 'filtered' : 'unfiltered';
     /*
      * retrieve the content
      */
     if ($filter_content == true) {
         if ($this->p->is_avail['cache']['object']) {
             // if the post id is 0, then add the sharing url to ensure a unique salt string
             $cache_salt = __METHOD__ . '(lang:' . SucomUtil::get_locale() . '_post:' . $post_id . '_' . $filter_name . (empty($post_id) ? '_url:' . $this->p->util->get_sharing_url($use_post) : '') . ')';
             $cache_id = $this->p->cf['lca'] . '_' . md5($cache_salt);
             $cache_type = 'object cache';
             if ($use_cache === true) {
                 $this->p->debug->log($cache_type . ': wp_cache salt ' . $cache_salt);
                 $content = wp_cache_get($cache_id, __METHOD__);
                 if ($content !== false) {
                     $this->p->debug->log($cache_type . ': ' . $filter_name . ' content retrieved from wp_cache ' . $cache_id);
                     return $content;
                 }
             } else {
                 $this->p->debug->log('use cache = false');
             }
         }
     }
     $content = apply_filters($this->p->cf['lca'] . '_content_seed', '');
     if (!empty($content)) {
         $this->p->debug->log('content seed = "' . $content . '"');
     } elseif (!empty($obj->post_content)) {
         $content = $obj->post_content;
     } else {
         $this->p->debug->log('exiting early: empty post content');
     }
     /*
      * modify the content
      */
     // save content length (for comparison) before making changes
     $content_strlen_before = strlen($content);
     // remove singlepics, which we detect and use before-hand
     $content = preg_replace('/\\[singlepic[^\\]]+\\]/', '', $content, -1, $count);
     if ($count > 0) {
         $this->p->debug->log($count . ' [singlepic] shortcode(s) removed from content');
     }
     if ($filter_content == true) {
         // remove the sharing buttons filter to avoid recursive loops
         if (!empty($this->p->sharing) && is_object($this->p->sharing)) {
             $filter_removed = $this->p->sharing->remove_buttons_filter('the_content');
         } else {
             $filter_removed = false;
         }
         // remove all of our shortcodes
         if (!empty($this->p->cf['lib']['shortcode']) && is_array($this->p->cf['lib']['shortcode'])) {
             foreach ($this->p->cf['lib']['shortcode'] as $id => $name) {
                 if (array_key_exists($id, $this->shortcode) && is_object($this->shortcode[$id])) {
                     $this->shortcode[$id]->remove();
                 }
             }
         }
         $this->p->debug->log('saving $post and calling apply_filters()');
         global $post;
         $saved_post = $post;
         // woocommerce can change the $post, so save and restore
         $content = apply_filters('the_content', $content);
         $post = $saved_post;
         // cleanup for NGG pre-v2 album shortcode
         unset($GLOBALS['subalbum']);
         unset($GLOBALS['nggShowGallery']);
         // add the sharing buttons filter back, if it was removed
         if ($filter_removed) {
             $this->p->sharing->add_buttons_filter('the_content');
         }
         // add our shortcodes back
         if (!empty($this->p->cf['lib']['shortcode']) && is_array($this->p->cf['lib']['shortcode'])) {
             foreach ($this->p->cf['lib']['shortcode'] as $id => $name) {
                 if (array_key_exists($id, $this->shortcode) && is_object($this->shortcode[$id])) {
                     $this->shortcode[$id]->add();
                 }
             }
         }
     }
     $content = preg_replace('/[\\r\\n\\t ]+/s', ' ', $content);
     // put everything on one line
     $content = preg_replace('/^.*<!--' . $this->p->cf['lca'] . '-content-->(.*)<!--\\/' . $this->p->cf['lca'] . '-content-->.*$/', '$1', $content);
     $content = preg_replace('/<a +rel="author" +href="" +style="display:none;">Google\\+<\\/a>/', ' ', $content);
     $content = str_replace(']]>', ']]&gt;', $content);
     $content_strlen_after = strlen($content);
     $this->p->debug->log('content strlen() before = ' . $content_strlen_before . ', after = ' . $content_strlen_after);
     // apply filters before caching
     $content = apply_filters($this->p->cf['lca'] . '_content', $content);
     if ($filter_content == true && !empty($cache_id)) {
         // only some caching plugins implement this function
         wp_cache_add_non_persistent_groups(array(__METHOD__));
//.........这里部分代码省略.........
开发者ID:kivivuori,项目名称:jotain,代码行数:101,代码来源:webpage.php


示例19: __construct

 /**
  * Instantiation construction
  *
  * @uses add_action()
  * @uses SlideDeckLitePlugin::wp_register_scripts()
  * @uses SlideDeckLitePlugin::wp_register_styles()
  */
 function __construct()
 {
     define('SLIDEDECK2_URL', plugin_dir_url(__FILE__));
     define('SLIDEDECK2_PATH', plugin_dir_path(__FILE__));
     SlideDeckLitePlugin::load_constants();
     $this->friendly_name = SlideDeckLitePlugin::$st_friendly_name;
     $this->namespace = SlideDeckLitePlugin::$st_namespace;
     /**
      * Make this plugin available for translation.
      * Translations can be added to the /languages/ directory.
      */
     load_plugin_textdomain($this->namespace, false, dirname(plugin_basename(__FILE__)) . '/languages/');
     // Load all library files used by this plugin
     $lib_files = glob(SLIDEDECK2_DIRNAME . '/lib/*.php');
     foreach ($lib_files as $filename) {
         include_once $filename;
     }
     // Loop through $cache_groups to add to Non Persistent Cache
     if (function_exists('wp_cache_add_non_persistent_groups')) {
         foreach (SlideDeckLitePlugin::$cache_groups as $cache_group) {
             wp_cache_add_non_persistent_groups(slidedeck2_cache_group($cache_group));
         }
     }
     // WordPress Pointers helper
     $this->Pointers = new SlideDeckPointers();
     // The Lens primary class
     include_once SLIDEDECK2_DIRNAME . '/classes/slidedeck-lens.php';
     $this->Lens = new SlideDeckLens();
     // The Addons primary class
     include_once SLIDEDECK2_DIRNAME . '/classes/slidedeck-addons.php';
     $this->Addons = new SlideDeckAddons();
     // The Cover primary class
     if (file_exists(SLIDEDECK2_DIRNAME . '/classes/slidedeck-covers.php')) {
         include_once SLIDEDECK2_DIRNAME . '/classes/slidedeck-covers.php';
         $this->Cover = new SlideDeckCovers();
     }
     // The Lens scaffold
     include_once SLIDEDECK2_DIRNAME . '/classes/slidedeck-lens-scaffold.php';
     // The Deck primary class for Deck types to child from
     include_once SLIDEDECK2_DIRNAME . '/classes/slidedeck.php';
     // Stock Lenses that come with SlideDeck distribution
     $lens_files = glob(SLIDEDECK2_DIRNAME . '/lenses/*/lens.php');
     if (is_dir(SLIDEDECK2_CUSTOM_LENS_DIR)) {
         if (is_readable(SLIDEDECK2_CUSTOM_LENS_DIR)) {
             // Get additional uploaded custom Lenses
             $custom_lens_files = (array) glob(SLIDEDECK2_CUSTOM_LENS_DIR . '/*/lens.php');
             // Merge Lenses available and loop through to load
             $lens_files = array_merge($lens_files, $custom_lens_files);
         }
     }
     // Load all the custom Lens types
     foreach ((array) $lens_files as $filename) {
         if (is_readable($filename)) {
             $classname = slidedeck2_get_classname_from_filename(dirname($filename));
             $prefix_classname = "SlideDeckLens_{$classname}";
             $slug = basename(dirname($filename));
             if (!class_exists($prefix_classname)) {
                 include_once $filename;
                 $this->installed_lenses[] = $slug;
             }
             if (class_exists($prefix_classname)) {
                 $this->lenses[$classname] = new $prefix_classname();
             }
         }
     }
     $source_files = (array) glob(SLIDEDECK2_DIRNAME . '/sources/*/source.php');
     foreach ((array) $source_files as $filename) {
         if (is_readable($filename)) {
             include_once $filename;
             $slug = basename(dirname($filename));
             $classname = slidedeck2_get_classname_from_filename(dirname($filename));
             $prefix_classname = "SlideDeckSource_{$classname}";
             if (class_exists($prefix_classname)) {
                 $this->sources[$slug] = new $prefix_classname();
             }
         }
     }
     // check if scheduler folder exists
     if (is_dir(SLIDEDECK3_ADDONS_DIR)) {
         $addons_directory = $this->recursive_file_exists('slidedeck_scheduler.php', SLIDEDECK3_ADDONS_DIR);
         if ($addons_directory !== '' && file_exists($addons_directory) && get_option("slidedeck_addon_activate", false)) {
             // check if scheduler addon is installed and create an instance
             include_once $addons_directory;
             SlideDeckPluginScheduler::instance();
         }
         // Get all installed addon information.
         $addons = $this->Addons->get();
         if (isset($addons['slidedeck_scheduler'])) {
             unset($addons['slidedeck_scheduler']);
         }
         // Load all activated addon.
         foreach ($addons as $slug => $addon) {
             $addon_option = "slidedeck_" . str_replace("-", "_", $slug) . "_addon_activate";
//.........这里部分代码省略.........
开发者ID:elmehdiboutaleb,项目名称:mjwebsite,代码行数:101,代码来源:slidedeck2-lite.php


示例20: setup_cache_groups

 /**
  * Disable cache groups due to a caching discrepancy in BackPress.
  *
  * @since 2.7.0
  * @see   https://buddypress.trac.wordpress.org/ticket/4759
  */
 public function setup_cache_groups()
 {
     wp_cache_add_non_persistent_groups(array('bb_forums', 'bb_query', 'bb_cache_posts_post_ids', 'bb_post'));
 }
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:10,代码来源:bp-forums-loader.php



注:本文中的wp_cache_add_non_persistent_groups函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_cache_clean_cache函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_cache_add_global_groups函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap