Make WordPress Core


Ignore:
Timestamp:
10/09/2008 12:50:52 AM (17 years ago)
Author:
ryan
Message:

Suspend cache invalidation while importing posts with WP importer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r9051 r9106  
    28482848}
    28492849
     2850/**
     2851 * Suspend cache invalidation.
     2852 *
     2853 * Turns cache invalidation on and off.  Useful during imports where you don't wont to do invalidations
     2854 * every time a post is inserted.  Callers must be sure that what they are doing won't lead to an inconsistent
     2855 * cache when invalidation is suspended.
     2856 *
     2857 * @since 2.7.0
     2858 *
     2859 * @param bool $suspend Whether to suspend or enable cache invalidation
     2860 * @return bool The current suspend setting
     2861 */
     2862function wp_suspend_cache_invalidation($suspend = true) {
     2863    global $_wp_suspend_cache_invalidation;
     2864
     2865    $current_suspend = $_wp_suspend_cache_invalidation;
     2866    $_wp_suspend_cache_invalidation = $suspend;
     2867    return $current_suspend;
     2868}
     2869
    28502870?>
Note: See TracChangeset for help on using the changeset viewer.