Make WordPress Core

Changeset 56511


Ignore:
Timestamp:
09/04/2023 11:38:37 AM (17 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/class-wp-hook.php.

Follow-up to [4955], [38571].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

File:
1 edited

Legend:

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

    r55748 r56511  
    7979        $this->callbacks[ $priority ][ $idx ] = array(
    8080            'function'      => $callback,
    81             'accepted_args' => $accepted_args,
     81            'accepted_args' => (int) $accepted_args,
    8282        );
    8383
     
    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            }
Note: See TracChangeset for help on using the changeset viewer.