Make WordPress Core

Changeset 56469


Ignore:
Timestamp:
08/25/2023 03:35:59 AM (3 years ago)
Author:
DrewAPicture
Message:

Properly deprecate both constructors in WP_User_Search.

  • __construct() gets the new _deprecated_class() function
  • WP_User_Search PHP4 style constructor is changed from _deprecated_function() to _deprecated_constructor()

Adds a test to confirm WP_User_Search class is testable as deprecated.

Props jrf, DrewAPicture.
Fixes #41125.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r55990 r56469  
    494494         */
    495495        function __construct( $search_term = '', $page = '', $role = '' ) {
    496                 _deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );
     496                _deprecated_class( 'WP_User_Search', '3.1.0', 'WP_User_Query' );
    497497
    498498                $this->search_term = wp_unslash( $search_term );
    … …  
    517517         */
    518518        public function WP_User_Search( $search_term = '', $page = '', $role = '' ) {
     519                _deprecated_constructor( 'WP_User_Search', '3.1.0', get_class( $this ) );
    519520                self::__construct( $search_term, $page, $role );
    520521        }
Note: See TracChangeset for help on using the changeset viewer.