Make WordPress Core

Changeset 41308


Ignore:
Timestamp:
08/23/2017 03:51:21 PM (6 years ago)
Author:
DrewAPicture
Message:

Docs: Clarify the expected usage of the $args parameter as an array in the DocBlock for apply_filters_deprecated(), including an example.

See #41017.

File:
1 edited

Legend:

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

    r41289 r41308  
    575575 * apply_filters_deprecated(), which triggers a deprecation notice and then fires
    576576 * the original filter hook.
     577 *
     578 * Note: the value and extra arguments passed to the original apply_filters() call
     579 * must be passed here to `$args` as an array. For example:
     580 *
     581 *     // Old filter.
     582 *     return apply_filters( 'wpdocs_filter', $value, $extra_arg );
     583 *
     584 *     // Deprecated.
     585 *     return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9', 'wpdocs_new_filter' );
    577586 *
    578587 * @since 4.6.0
Note: See TracChangeset for help on using the changeset viewer.