-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use wp_trigger_error() in _doing_it_wrong()
and _deprecated_*()
functions
#5161
Use wp_trigger_error() in _doing_it_wrong()
and _deprecated_*()
functions
#5161
Conversation
_deprecated_*()
functions_doing_it_wrong()
and _deprecated_*()
functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @hellofromtonya! I agree that the single call to wp_trigger_error()
is best here, and the changes look clean and good to go.
src/wp-includes/functions.php
Outdated
); | ||
} | ||
|
||
wp_trigger_error( $function_name, $message ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoopsie, should not be passing the function name. _doing_it_wrong()
already added it to the message.
Fixed in 0293e8f ✅
Committed via https://core.trac.wordpress.org/changeset/56705. |
Uses
wp_trigger_error()
in_doing_it_wrong()
and each_deprecated_*()
function, i.e. instead oftrigger_error()
.To avoid redundancy, used
wp_trigger_error()
once. How? Saved each message to$message
variable and then passed it towp_trigger_error()
at the end of the function.Trac ticket: https://core.trac.wordpress.org/ticket/57686
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.