wp_suspend_cache_invalidation

The timeline below displays how wordpress function wp_suspend_cache_invalidation has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Suspends cache invalidation.
 *
 * Turns cache invalidation on and off. Useful during imports where you don't want to do
 * invalidations every time a post is inserted. Callers must be sure that what they are
 * doing won't lead to an inconsistent cache when invalidation is suspended.
 *
 * @since 2.7.0
 *
 * @global bool $_wp_suspend_cache_invalidation
 *
 * @param bool $suspend Optional. Whether to suspend or enable cache invalidation. Default true.
 * @return bool The current suspend setting.
 */
function wp_suspend_cache_invalidation($suspend = true)
{
    global $_wp_suspend_cache_invalidation;
    $current_suspend = $_wp_suspend_cache_invalidation;
    $_wp_suspend_cache_invalidation = $suspend;
    return $current_suspend;
}

WordPress Version: 4.9

/**
 * Suspend cache invalidation.
 *
 * Turns cache invalidation on and off. Useful during imports where you don't want to do
 * invalidations every time a post is inserted. Callers must be sure that what they are
 * doing won't lead to an inconsistent cache when invalidation is suspended.
 *
 * @since 2.7.0
 *
 * @global bool $_wp_suspend_cache_invalidation
 *
 * @param bool $suspend Optional. Whether to suspend or enable cache invalidation. Default true.
 * @return bool The current suspend setting.
 */
function wp_suspend_cache_invalidation($suspend = true)
{
    global $_wp_suspend_cache_invalidation;
    $current_suspend = $_wp_suspend_cache_invalidation;
    $_wp_suspend_cache_invalidation = $suspend;
    return $current_suspend;
}

WordPress Version: 4.3

/**
 * Suspend cache invalidation.
 *
 * Turns cache invalidation on and off. Useful during imports where you don't wont to do
 * invalidations every time a post is inserted. Callers must be sure that what they are
 * doing won't lead to an inconsistent cache when invalidation is suspended.
 *
 * @since 2.7.0
 *
 * @global bool $_wp_suspend_cache_invalidation
 *
 * @param bool $suspend Optional. Whether to suspend or enable cache invalidation. Default true.
 * @return bool The current suspend setting.
 */
function wp_suspend_cache_invalidation($suspend = true)
{
    global $_wp_suspend_cache_invalidation;
    $current_suspend = $_wp_suspend_cache_invalidation;
    $_wp_suspend_cache_invalidation = $suspend;
    return $current_suspend;
}

WordPress Version: 4.0

/**
 * Suspend cache invalidation.
 *
 * Turns cache invalidation on and off. Useful during imports where you don't wont to do
 * invalidations every time a post is inserted. Callers must be sure that what they are
 * doing won't lead to an inconsistent cache when invalidation is suspended.
 *
 * @since 2.7.0
 *
 * @param bool $suspend Optional. Whether to suspend or enable cache invalidation. Default true.
 * @return bool The current suspend setting.
 */
function wp_suspend_cache_invalidation($suspend = true)
{
    global $_wp_suspend_cache_invalidation;
    $current_suspend = $_wp_suspend_cache_invalidation;
    $_wp_suspend_cache_invalidation = $suspend;
    return $current_suspend;
}

WordPress Version: 3.7

/**
 * Suspend cache invalidation.
 *
 * Turns cache invalidation on and off. Useful during imports where you don't wont to do invalidations
 * every time a post is inserted. Callers must be sure that what they are doing won't lead to an inconsistent
 * cache when invalidation is suspended.
 *
 * @since 2.7.0
 *
 * @param bool $suspend Whether to suspend or enable cache invalidation
 * @return bool The current suspend setting
 */
function wp_suspend_cache_invalidation($suspend = true)
{
    global $_wp_suspend_cache_invalidation;
    $current_suspend = $_wp_suspend_cache_invalidation;
    $_wp_suspend_cache_invalidation = $suspend;
    return $current_suspend;
}