wp_defer_term_counting

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

WordPress Version: 6.1

/**
 * Enables or disables term counting.
 *
 * @since 2.5.0
 *
 * @param bool $defer Optional. Enable if true, disable if false.
 * @return bool Whether term counting is enabled or disabled.
 */
function wp_defer_term_counting($defer = null)
{
    static $_defer = false;
    if (is_bool($defer)) {
        $_defer = $defer;
        // Flush any deferred counts.
        if (!$defer) {
            wp_update_term_count(null, null, true);
        }
    }
    return $_defer;
}

WordPress Version: 5.5

/**
 * Enable or disable term counting.
 *
 * @since 2.5.0
 *
 * @param bool $defer Optional. Enable if true, disable if false.
 * @return bool Whether term counting is enabled or disabled.
 */
function wp_defer_term_counting($defer = null)
{
    static $_defer = false;
    if (is_bool($defer)) {
        $_defer = $defer;
        // Flush any deferred counts.
        if (!$defer) {
            wp_update_term_count(null, null, true);
        }
    }
    return $_defer;
}

WordPress Version: 5.4

/**
 * Enable or disable term counting.
 *
 * @since 2.5.0
 *
 * @staticvar bool $_defer
 *
 * @param bool $defer Optional. Enable if true, disable if false.
 * @return bool Whether term counting is enabled or disabled.
 */
function wp_defer_term_counting($defer = null)
{
    static $_defer = false;
    if (is_bool($defer)) {
        $_defer = $defer;
        // Flush any deferred counts.
        if (!$defer) {
            wp_update_term_count(null, null, true);
        }
    }
    return $_defer;
}

WordPress Version: 4.3

/**
 * Enable or disable term counting.
 *
 * @since 2.5.0
 *
 * @staticvar bool $_defer
 *
 * @param bool $defer Optional. Enable if true, disable if false.
 * @return bool Whether term counting is enabled or disabled.
 */
function wp_defer_term_counting($defer = null)
{
    static $_defer = false;
    if (is_bool($defer)) {
        $_defer = $defer;
        // flush any deferred counts
        if (!$defer) {
            wp_update_term_count(null, null, true);
        }
    }
    return $_defer;
}

WordPress Version: 3.7

/**
 * Enable or disable term counting.
 *
 * @since 2.5.0
 *
 * @param bool $defer Optional. Enable if true, disable if false.
 * @return bool Whether term counting is enabled or disabled.
 */
function wp_defer_term_counting($defer = null)
{
    static $_defer = false;
    if (is_bool($defer)) {
        $_defer = $defer;
        // flush any deferred counts
        if (!$defer) {
            wp_update_term_count(null, null, true);
        }
    }
    return $_defer;
}