Make WordPress Core

Changeset 52705


Ignore:
Timestamp:
02/11/2022 06:31:48 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct the suggested alternative for the deprecated wp_cache_reset() function.

While this was previously added and reverted more than once as part of various documentation cleanup efforts, wp_cache_switch_to_blog() appears to be the correct alternative for wp_cache_reset(), per the latter's DocBlock.

This commit also corrects the @deprecated tag for WP_Object_Cache::reset() to link to the ::switch_to_blog() method of the class, instead of the function of the same name.

Follow-up to [13066], [21403], [22111], [33678], [34225], [34226], [40929].

See #54729.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/cache.php

    r52704 r52705  
    340340 *
    341341 * @since 3.0.0
    342  * @deprecated 3.5.0 WP_Object_Cache::reset()
     342 * @deprecated 3.5.0 Use wp_cache_switch_to_blog()
    343343 * @see WP_Object_Cache::reset()
    344344 *
     
    346346 */
    347347function wp_cache_reset() {
    348     _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::reset()' );
     348    _deprecated_function( __FUNCTION__, '3.5.0', 'wp_cache_switch_to_blog()' );
    349349
    350350    global $wp_object_cache;
  • trunk/src/wp-includes/class-wp-object-cache.php

    r52703 r52705  
    462462     * @since 3.0.0
    463463     *
    464      * @deprecated 3.5.0 Use switch_to_blog()
     464     * @deprecated 3.5.0 Use WP_Object_Cache::switch_to_blog()
    465465     * @see switch_to_blog()
    466466     */
    467467    public function reset() {
    468         _deprecated_function( __FUNCTION__, '3.5.0', 'switch_to_blog()' );
     468        _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::switch_to_blog()' );
    469469
    470470        // Clear out non-global caches since the blog ID has changed.
Note: See TracChangeset for help on using the changeset viewer.