WordPress.org

Make WordPress Core

Changeset 43587


Ignore:
Timestamp:
08/28/2018 01:37:26 PM (3 years ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

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

    r43571 r43587  
    43594359     *
    43604360     * @since 3.1.0
    4361      *
    4362      * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.
     4361     * @since 5.0.0 Added the $function, $message and $version parameters.
     4362     *
     4363     * @param bool   $trigger  Whether to trigger the error for _doing_it_wrong() calls. Default true.
     4364     * @param string $function The function that was called.
     4365     * @param string $message  A message explaining what has been done incorrectly.
     4366     * @param string $version  The version of WordPress where the message was added.
    43634367     */
    4364     if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
     4368    if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function, $message, $version ) ) {
    43654369        if ( function_exists( '__' ) ) {
    43664370            if ( is_null( $version ) ) {
Note: See TracChangeset for help on using the changeset viewer.