General: Provide context parameters to `doing_it_wrong_trigger_error` filter.

`$function`, `$message`, and `$version` have historically been passed to the `doing_it_wrong_run` action. It makes sense to pass those to the filter as well, so that one can conditionally determine the filter value to return.

Fixes #34183.

Built from https://develop.svn.wordpress.org/trunk@43587


git-svn-id: http://core.svn.wordpress.org/trunk@43416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2018-08-28 13:38:24 +00:00
parent 27e48708f8
commit 17f435b5aa
2 changed files with 7 additions and 3 deletions

View File

@ -4358,10 +4358,14 @@ function _doing_it_wrong( $function, $message, $version ) {
* Filters whether to trigger an error for _doing_it_wrong() calls. * Filters whether to trigger an error for _doing_it_wrong() calls.
* *
* @since 3.1.0 * @since 3.1.0
* @since 5.0.0 Added the $function, $message and $version parameters.
* *
* @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true. * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.
* @param string $function The function that was called.
* @param string $message A message explaining what has been done incorrectly.
* @param string $version The version of WordPress where the message was added.
*/ */
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) { if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function, $message, $version ) ) {
if ( function_exists( '__' ) ) { if ( function_exists( '__' ) ) {
if ( is_null( $version ) ) { if ( is_null( $version ) ) {
$version = ''; $version = '';

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-43586'; $wp_version = '5.0-alpha-43587';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.