WordPress.org

Make WordPress Core

Ticket #41121: 0002-calls-missing-replacement-functions.patch

File 0002-calls-missing-replacement-functions.patch, 5.8 KB (added by jrf, 3 years ago)

Patch 2

  • src/wp-includes/cache.php

    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 ) { 
    264264 * @global WP_Object_Cache $wp_object_cache Object cache global instance.
    265265 */
    266266function wp_cache_reset() {
    267         _deprecated_function( __FUNCTION__, '3.5.0' );
     267        _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::reset()' );
    268268
    269269        global $wp_object_cache;
    270270
  • src/wp-includes/class-wp-customize-widgets.php

    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 { 
    20552055         * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.
    20562056         */
    20572057        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' );
    20592059        }
    20602060
    20612061        /**
    final class WP_Customize_Widgets { 
    20672067         * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.
    20682068         */
    20692069        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' );
    20712071        }
    20722072
    20732073        /**
    final class WP_Customize_Widgets { 
    20792079         * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.
    20802080         */
    20812081        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' );
    20832083        }
    20842084
    20852085        /**
    final class WP_Customize_Widgets { 
    20912091         * @deprecated 4.2.0 Deprecated in favor of the {@see 'customize_dynamic_setting_args'} filter.
    20922092         */
    20932093        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' );
    20952095        }
    20962096}
  • src/wp-includes/deprecated.php

    diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
    index 027194a..e6eddb1 100644
    a b function the_author_ID() { 
    16501650 * @param int $encode_html Optional. How to encode the content.
    16511651 */
    16521652function 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()' );
    16541654        $content = get_the_content($more_link_text, $stripteaser);
    16551655        $content = apply_filters('the_content_rss', $content);
    16561656        if ( $cut && !$encode_html )
    function wp_kses_js_entities( $string ) { 
    38143814 * @return int
    38153815 */
    38163816function _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()' );
    38183818
    38193819        if ( $a->term_id > $b->term_id )
    38203820                return 1;
    function _usort_terms_by_ID( $a, $b ) { 
    38393839 * @return int
    38403840 */
    38413841function _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()' );
    38433843
    38443844        return strcmp( $a->name, $b->name );
    38453845}
    function _usort_terms_by_name( $a, $b ) { 
    38603860function _sort_nav_menu_items( $a, $b ) {
    38613861        global $_menu_item_sort_prop;
    38623862
    3863         _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' );
     3863        _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' );
    38643864
    38653865        if ( empty( $_menu_item_sort_prop ) )
    38663866                return 0;
  • src/wp-includes/ms-deprecated.php

    diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php
    index 3d06dab..7333b9d 100644
    a b  
    2424 * @return WP_Site Current site object.
    2525 */
    2626function get_dashboard_blog() {
    27     _deprecated_function( __FUNCTION__, '3.1.0' );
     27    _deprecated_function( __FUNCTION__, '3.1.0', 'get_site()' );
    2828    if ( $blog = get_site_option( 'dashboard_blog' ) ) {
    2929            return get_site( $blog );
    3030    }
    function get_most_active_blogs( $num = 10, $display = true ) { 
    268268 * @param string $url Optional. Redirect URL. Default empty.
    269269 */
    270270function wpmu_admin_do_redirect( $url = '' ) {
    271         _deprecated_function( __FUNCTION__, '3.3.0' );
     271        _deprecated_function( __FUNCTION__, '3.3.0', 'wp_redirect()' );
    272272
    273273        $ref = '';
    274274        if ( isset( $_GET['ref'] ) )
    function wpmu_admin_do_redirect( $url = '' ) { 
    308308 * @return string
    309309 */
    310310function wpmu_admin_redirect_add_updated_param( $url = '' ) {
    311         _deprecated_function( __FUNCTION__, '3.3.0' );
     311        _deprecated_function( __FUNCTION__, '3.3.0', 'add_query_arg()' );
    312312
    313313        if ( strpos( $url, 'updated=true' ) === false ) {
    314314                if ( strpos( $url, '?' ) === false )