Code Modernisation: Simplify some logic in `apply_filters()`.

Props jrf.
See #47678.
Built from https://develop.svn.wordpress.org/trunk@46146


git-svn-id: http://core.svn.wordpress.org/trunk@45958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-15 12:04:55 +00:00
parent 3b43f6dfbf
commit f3f1d530f4
2 changed files with 3 additions and 8 deletions

View File

@ -181,12 +181,11 @@ function has_filter( $tag, $function_to_check = false ) {
function apply_filters( $tag, $value ) {
global $wp_filter, $wp_current_filter;
$args = array();
$args = func_get_args();
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $tag;
$args = func_get_args();
_wp_call_all_hook( $args );
}
@ -201,11 +200,7 @@ function apply_filters( $tag, $value ) {
$wp_current_filter[] = $tag;
}
if ( empty( $args ) ) {
$args = func_get_args();
}
// don't pass the tag name to WP_Hook
// Don't pass the tag name to WP_Hook.
array_shift( $args );
$filtered = $wp_filter[ $tag ]->apply_filters( $value, $args );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46145';
$wp_version = '5.3-alpha-46146';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.