Ticket #38765: 38765.5.diff
File 38765.5.diff, 2.4 KB (added by , 9 years ago) |
---|
-
src/wp-includes/class-wp-taxonomy.php
12 12 * 13 13 * @since 4.7.0 14 14 */ 15 final class WP_Taxonomy {15 final class WP_Taxonomy implements ArrayAccess { 16 16 /** 17 17 * Taxonomy key. 18 18 * … … 413 413 public function remove_hooks() { 414 414 remove_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' ); 415 415 } 416 417 /** 418 * Method to implement ArrayAccess 419 * 420 * @since 4.7.0 421 * @access public 422 * 423 * @param string $offset 424 * @param mixed $value 425 */ 426 public function offsetSet( $offset, $value ) { 427 if ( ! empty( $offset ) ) { 428 $this->$offset = $value; 429 } 430 } 431 432 /** 433 * Method to implement ArrayAccess 434 * 435 * @since 4.7.0 436 * @access public 437 * 438 * @param string $offset 439 * @return bool 440 */ 441 public function offsetExists( $offset ) { 442 return isset( $this->$offset ); 443 } 444 445 /** 446 * Method to implement ArrayAccess 447 * 448 * @since 4.7.0 449 * @access public 450 * 451 * @param mixed $offset 452 */ 453 public function offsetUnset( $offset ) { 454 unset( $this->$offset ); 455 } 456 457 /** 458 * Method to implement ArrayAccess 459 * 460 * @since 4.7.0 461 * @access public 462 * 463 * @param mixed $offset 464 * @return mixed|null 465 */ 466 public function offsetGet( $offset ) { 467 return isset( $this->$offset ) ? $this->$offset : null; 468 } 416 469 } -
src/wp-includes/taxonomy.php
388 388 * Fires after a taxonomy is registered. 389 389 * 390 390 * @since 3.3.0 391 * @since 4.7.0 Converted the `$taxonomy_object` parameter to accept a WP_Taxonomy object. 391 392 * 392 * @param string $taxonomy Taxonomy slug.393 * @param array|string $object_type Object type or array of object types.394 * @param array $args Array of taxonomy registration arguments.393 * @param string $taxonomy Taxonomy slug. 394 * @param array|string $object_type Object type or array of object types. 395 * @param WP_Taxonomy $taxonomy_object Taxonomy Object. 395 396 */ 396 do_action( 'registered_taxonomy', $taxonomy, $object_type, $ args);397 do_action( 'registered_taxonomy', $taxonomy, $object_type, $taxonomy_object ); 397 398 } 398 399 399 400 /**