Skip to content

Commit fa9f839

Browse files
Coding Standards: Use strict comparison in wp-includes/class-wp-hook.php.
Follow-up to [4955], [38571]. Props aristath, poena, afercia, SergeyBiryukov. See #58831. git-svn-id: https://develop.svn.wordpress.org/trunk@56511 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d0deb5b commit fa9f839

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/class-wp-hook.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function add_filter( $hook_name, $callback, $priority, $accepted_args ) {
7878

7979
$this->callbacks[ $priority ][ $idx ] = array(
8080
'function' => $callback,
81-
'accepted_args' => $accepted_args,
81+
'accepted_args' => (int) $accepted_args,
8282
);
8383

8484
// If we're adding a new priority to the list, put them back in sorted order.
@@ -304,12 +304,12 @@ public function apply_filters( $value, $args ) {
304304
}
305305

306306
// Avoid the array_slice() if possible.
307-
if ( 0 == $the_['accepted_args'] ) {
307+
if ( 0 === $the_['accepted_args'] ) {
308308
$value = call_user_func( $the_['function'] );
309309
} elseif ( $the_['accepted_args'] >= $num_args ) {
310310
$value = call_user_func_array( $the_['function'], $args );
311311
} else {
312-
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
312+
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
313313
}
314314
}
315315
} while ( false !== next( $this->iterations[ $nesting_level ] ) );

0 commit comments

Comments
 (0)