Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package argument to _deprecated_function() #8179

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5525,10 +5525,11 @@ function dead_db() {
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
*
* @param string $function_name The function that was called.
* @param string $version The version of WordPress that deprecated the function.
* @param string $version The version of $package that deprecated the function.
* @param string $replacement Optional. The function that should have been called. Default empty string.
* @param string $package Optional. The package to which the function belongs. Default 'core'.
*/
function _deprecated_function( $function_name, $version, $replacement = '' ) {
function _deprecated_function( $function_name, $version, $replacement = '', $package = 'core' ) {

/**
* Fires when a deprecated function is called.
Expand All @@ -5537,9 +5538,10 @@ function _deprecated_function( $function_name, $version, $replacement = '' ) {
*
* @param string $function_name The function that was called.
* @param string $replacement The function that should have been called.
* @param string $version The version of WordPress that deprecated the function.
* @param string $version The version of $package that deprecated the function.
* @param string $package The package to which the function belongs.
*/
do_action( 'deprecated_function_run', $function_name, $replacement, $version );
do_action( 'deprecated_function_run', $function_name, $replacement, $version, $package );

/**
* Filters whether to trigger an error for deprecated functions.
Expand Down Expand Up @@ -5765,12 +5767,13 @@ function _deprecated_class( $class_name, $version, $replacement = '' ) {
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
*
* @param string $file The file that was included.
* @param string $version The version of WordPress that deprecated the file.
* @param string $version The version of $package that deprecated the file.
* @param string $replacement Optional. The file that should have been included based on ABSPATH.
* Default empty string.
* @param string $message Optional. A message regarding the change. Default empty string.
* @param string $package Optional. The package to which the file belongs. Default 'core'.
*/
function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
function _deprecated_file( $file, $version, $replacement = '', $message = '', $package = 'core' ) {

/**
* Fires when a deprecated file is called.
Expand All @@ -5779,10 +5782,11 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
*
* @param string $file The file that was called.
* @param string $replacement The file that should have been included based on ABSPATH.
* @param string $version The version of WordPress that deprecated the file.
* @param string $version The version of $package that deprecated the file.
* @param string $message A message regarding the change.
* @param string $package The package to which the file belongs.
*/
do_action( 'deprecated_file_included', $file, $replacement, $version, $message );
do_action( 'deprecated_file_included', $file, $replacement, $version, $message, $package );

/**
* Filters whether to trigger an error for deprecated files.
Expand Down Expand Up @@ -5841,7 +5845,7 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
* For example:
*
* if ( ! empty( $deprecated ) ) {
* _deprecated_argument( __FUNCTION__, '3.0.0' );
* _deprecated_argument( __FUNCTION__, '3.0.0', 'core' );
* }
*
* There is a {@see 'deprecated_argument_run'} hook that will be called that can be used
Expand All @@ -5854,10 +5858,11 @@ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
*
* @param string $function_name The function that was called.
* @param string $version The version of WordPress that deprecated the argument used.
* @param string $version The version of $package that deprecated the argument used.
* @param string $message Optional. A message regarding the change. Default empty string.
* @param string $package Optional. The package to which the function belongs. Default 'core'.
*/
function _deprecated_argument( $function_name, $version, $message = '' ) {
function _deprecated_argument( $function_name, $version, $message = '', $package = 'core' ) {

/**
* Fires when a deprecated argument is called.
Expand All @@ -5866,9 +5871,10 @@ function _deprecated_argument( $function_name, $version, $message = '' ) {
*
* @param string $function_name The function that was called.
* @param string $message A message regarding the change.
* @param string $version The version of WordPress that deprecated the argument used.
* @param string $version The version of $package that deprecated the argument used.
* @param string $package The package to which the function belongs.
*/
do_action( 'deprecated_argument_run', $function_name, $message, $version );
do_action( 'deprecated_argument_run', $function_name, $message, $version, $package );

/**
* Filters whether to trigger an error for deprecated arguments.
Expand Down
Loading