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.
Built from https://develop.svn.wordpress.org/trunk@52705


git-svn-id: http://core.svn.wordpress.org/trunk@52294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-02-11 18:33:00 +00:00
parent 42e1bea8f1
commit d3f69d117c
3 changed files with 5 additions and 5 deletions

View File

@ -339,13 +339,13 @@ function wp_cache_add_non_persistent_groups( $groups ) {
* recommended outside of unit tests as the performance penalty for using it is high. * recommended outside of unit tests as the performance penalty for using it is high.
* *
* @since 3.0.0 * @since 3.0.0
* @deprecated 3.5.0 WP_Object_Cache::reset() * @deprecated 3.5.0 Use wp_cache_switch_to_blog()
* @see WP_Object_Cache::reset() * @see WP_Object_Cache::reset()
* *
* @global WP_Object_Cache $wp_object_cache Object cache global instance. * @global WP_Object_Cache $wp_object_cache Object cache global instance.
*/ */
function wp_cache_reset() { function wp_cache_reset() {
_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::reset()' ); _deprecated_function( __FUNCTION__, '3.5.0', 'wp_cache_switch_to_blog()' );
global $wp_object_cache; global $wp_object_cache;

View File

@ -461,11 +461,11 @@ class WP_Object_Cache {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @deprecated 3.5.0 Use switch_to_blog() * @deprecated 3.5.0 Use WP_Object_Cache::switch_to_blog()
* @see switch_to_blog() * @see switch_to_blog()
*/ */
public function reset() { public function reset() {
_deprecated_function( __FUNCTION__, '3.5.0', 'switch_to_blog()' ); _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::switch_to_blog()' );
// Clear out non-global caches since the blog ID has changed. // Clear out non-global caches since the blog ID has changed.
foreach ( array_keys( $this->cache ) as $group ) { foreach ( array_keys( $this->cache ) as $group ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.0-alpha-52704'; $wp_version = '6.0-alpha-52705';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.