Changeset 42343 for trunk/src/wp-includes/class-wp-hook.php
- Timestamp:
- 11/30/2017 11:09:33 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-hook.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-hook.php
r42200 r42343 72 72 */ 73 73 public function add_filter( $tag, $function_to_add, $priority, $accepted_args ) { 74 $idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority );74 $idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority ); 75 75 $priority_existed = isset( $this->callbacks[ $priority ] ); 76 76 77 77 $this->callbacks[ $priority ][ $idx ] = array( 78 'function' => $function_to_add,79 'accepted_args' => $accepted_args 78 'function' => $function_to_add, 79 'accepted_args' => $accepted_args, 80 80 ); 81 81 … … 244 244 if ( false === $priority ) { 245 245 $this->callbacks = array(); 246 } else if ( isset( $this->callbacks[ $priority ] ) ) {246 } elseif ( isset( $this->callbacks[ $priority ] ) ) { 247 247 unset( $this->callbacks[ $priority ] ); 248 248 } … … 270 270 271 271 $this->iterations[ $nesting_level ] = array_keys( $this->callbacks ); 272 $num_args = count( $args );272 $num_args = count( $args ); 273 273 274 274 do { … … 276 276 277 277 foreach ( $this->callbacks[ $priority ] as $the_ ) { 278 if ( ! $this->doing_action ) {279 $args[ 0] = $value;278 if ( ! $this->doing_action ) { 279 $args[0] = $value; 280 280 } 281 281 … … 286 286 $value = call_user_func_array( $the_['function'], $args ); 287 287 } else { 288 $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );288 $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) ); 289 289 } 290 290 } … … 324 324 */ 325 325 public function do_all_hook( &$args ) { 326 $nesting_level = $this->nesting_level++;326 $nesting_level = $this->nesting_level++; 327 327 $this->iterations[ $nesting_level ] = array_keys( $this->callbacks ); 328 328
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)