From c99326d6e01669a18d3d4dd79c04b76c80717bcc Mon Sep 17 00:00:00 2001
Date: Thu, 22 Jun 2017 00:40:52 +0200
Subject: [PATCH] Add missing replacement functions to various
`_deprecated_function()` calls
* Add missing parentheses to deprecated function replacement function to be consistent with other deprecated function alternatives.
* Add missing alternative for the WP_Customize Widget deprecated methods.
* Add missing alternative for three deprecated ms functions
* Add missing alternative for deprecated `wp_cache_reset()` function
---
src/wp-includes/cache.php | 2 +-
src/wp-includes/class-wp-customize-widgets.php | 8 ++++----
src/wp-includes/deprecated.php | 8 ++++----
src/wp-includes/ms-deprecated.php | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/wp-includes/cache.php b/src/wp-includes/cache.php
index b974756..eb97cc7 100644
|
a
|
b
|
function wp_cache_add_non_persistent_groups( $groups ) { |
| 264 | 264 | * @global WP_Object_Cache $wp_object_cache Object cache global instance. |
| 265 | 265 | */ |
| 266 | 266 | function wp_cache_reset() { |
| 267 | | _deprecated_function( __FUNCTION__, '3.5.0' ); |
| | 267 | _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::reset()' ); |
| 268 | 268 | |
| 269 | 269 | global $wp_object_cache; |
| 270 | 270 | |
diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php
index 40590f0..4f14a83 100644
|
a
|
b
|
final class WP_Customize_Widgets { |
| 2055 | 2055 | * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. |
| 2056 | 2056 | */ |
| 2057 | 2057 | public function setup_widget_addition_previews() { |
| 2058 | | _deprecated_function( __METHOD__, '4.2.0' ); |
| | 2058 | _deprecated_function( __METHOD__, '4.2.0', 'the \'customize_dynamic_setting_args\' filter' ); |
| 2059 | 2059 | } |
| 2060 | 2060 | |
| 2061 | 2061 | /** |
| … |
… |
final class WP_Customize_Widgets { |
| 2067 | 2067 | * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. |
| 2068 | 2068 | */ |
| 2069 | 2069 | public function prepreview_added_sidebars_widgets() { |
| 2070 | | _deprecated_function( __METHOD__, '4.2.0' ); |
| | 2070 | _deprecated_function( __METHOD__, '4.2.0', 'the \'customize_dynamic_setting_args\' filter' ); |
| 2071 | 2071 | } |
| 2072 | 2072 | |
| 2073 | 2073 | /** |
| … |
… |
final class WP_Customize_Widgets { |
| 2079 | 2079 | * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. |
| 2080 | 2080 | */ |
| 2081 | 2081 | public function prepreview_added_widget_instance() { |
| 2082 | | _deprecated_function( __METHOD__, '4.2.0' ); |
| | 2082 | _deprecated_function( __METHOD__, '4.2.0', 'the \'customize_dynamic_setting_args\' filter' ); |
| 2083 | 2083 | } |
| 2084 | 2084 | |
| 2085 | 2085 | /** |
| … |
… |
final class WP_Customize_Widgets { |
| 2091 | 2091 | * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter. |
| 2092 | 2092 | */ |
| 2093 | 2093 | public function remove_prepreview_filters() { |
| 2094 | | _deprecated_function( __METHOD__, '4.2.0' ); |
| | 2094 | _deprecated_function( __METHOD__, '4.2.0', 'the \'customize_dynamic_setting_args\' filter' ); |
| 2095 | 2095 | } |
| 2096 | 2096 | } |
diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
index 027194a..e6eddb1 100644
|
a
|
b
|
function the_author_ID() { |
| 1650 | 1650 | * @param int $encode_html Optional. How to encode the content. |
| 1651 | 1651 | */ |
| 1652 | 1652 | function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { |
| 1653 | | _deprecated_function( __FUNCTION__, '2.9.0', 'the_content_feed' ); |
| | 1653 | _deprecated_function( __FUNCTION__, '2.9.0', 'the_content_feed()' ); |
| 1654 | 1654 | $content = get_the_content($more_link_text, $stripteaser); |
| 1655 | 1655 | $content = apply_filters('the_content_rss', $content); |
| 1656 | 1656 | if ( $cut && !$encode_html ) |
| … |
… |
function wp_kses_js_entities( $string ) { |
| 3814 | 3814 | * @return int |
| 3815 | 3815 | */ |
| 3816 | 3816 | function _usort_terms_by_ID( $a, $b ) { |
| 3817 | | _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' ); |
| | 3817 | _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' ); |
| 3818 | 3818 | |
| 3819 | 3819 | if ( $a->term_id > $b->term_id ) |
| 3820 | 3820 | return 1; |
| … |
… |
function _usort_terms_by_ID( $a, $b ) { |
| 3839 | 3839 | * @return int |
| 3840 | 3840 | */ |
| 3841 | 3841 | function _usort_terms_by_name( $a, $b ) { |
| 3842 | | _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' ); |
| | 3842 | _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' ); |
| 3843 | 3843 | |
| 3844 | 3844 | return strcmp( $a->name, $b->name ); |
| 3845 | 3845 | } |
| … |
… |
function _usort_terms_by_name( $a, $b ) { |
| 3860 | 3860 | function _sort_nav_menu_items( $a, $b ) { |
| 3861 | 3861 | global $_menu_item_sort_prop; |
| 3862 | 3862 | |
| 3863 | | _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' ); |
| | 3863 | _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' ); |
| 3864 | 3864 | |
| 3865 | 3865 | if ( empty( $_menu_item_sort_prop ) ) |
| 3866 | 3866 | return 0; |
diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php
index 3d06dab..7333b9d 100644
|
a
|
b
|
|
| 24 | 24 | * @return WP_Site Current site object. |
| 25 | 25 | */ |
| 26 | 26 | function get_dashboard_blog() { |
| 27 | | _deprecated_function( __FUNCTION__, '3.1.0' ); |
| | 27 | _deprecated_function( __FUNCTION__, '3.1.0', 'get_site()' ); |
| 28 | 28 | if ( $blog = get_site_option( 'dashboard_blog' ) ) { |
| 29 | 29 | return get_site( $blog ); |
| 30 | 30 | } |
| … |
… |
function get_most_active_blogs( $num = 10, $display = true ) { |
| 268 | 268 | * @param string $url Optional. Redirect URL. Default empty. |
| 269 | 269 | */ |
| 270 | 270 | function wpmu_admin_do_redirect( $url = '' ) { |
| 271 | | _deprecated_function( __FUNCTION__, '3.3.0' ); |
| | 271 | _deprecated_function( __FUNCTION__, '3.3.0', 'wp_redirect()' ); |
| 272 | 272 | |
| 273 | 273 | $ref = ''; |
| 274 | 274 | if ( isset( $_GET['ref'] ) ) |
| … |
… |
function wpmu_admin_do_redirect( $url = '' ) { |
| 308 | 308 | * @return string |
| 309 | 309 | */ |
| 310 | 310 | function wpmu_admin_redirect_add_updated_param( $url = '' ) { |
| 311 | | _deprecated_function( __FUNCTION__, '3.3.0' ); |
| | 311 | _deprecated_function( __FUNCTION__, '3.3.0', 'add_query_arg()' ); |
| 312 | 312 | |
| 313 | 313 | if ( strpos( $url, 'updated=true' ) === false ) { |
| 314 | 314 | if ( strpos( $url, '?' ) === false ) |