Changeset 49141 for trunk/src/wp-includes/class-wp-taxonomy.php
- Timestamp:
- 10/14/2020 12:49:52 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-taxonomy.php
r48356 r49141 180 180 */ 181 181 public $update_count_callback; 182 183 /** 184 * Function that will be called when the count is modified by an amount. 185 * 186 * @since 5.6.0 187 * @var callable 188 */ 189 public $update_count_by_callback; 182 190 183 191 /** … … 278 286 279 287 $defaults = array( 280 'labels' => array(), 281 'description' => '', 282 'public' => true, 283 'publicly_queryable' => null, 284 'hierarchical' => false, 285 'show_ui' => null, 286 'show_in_menu' => null, 287 'show_in_nav_menus' => null, 288 'show_tagcloud' => null, 289 'show_in_quick_edit' => null, 290 'show_admin_column' => false, 291 'meta_box_cb' => null, 292 'meta_box_sanitize_cb' => null, 293 'capabilities' => array(), 294 'rewrite' => true, 295 'query_var' => $this->name, 296 'update_count_callback' => '', 297 'show_in_rest' => false, 298 'rest_base' => false, 299 'rest_controller_class' => false, 300 'default_term' => null, 301 '_builtin' => false, 288 'labels' => array(), 289 'description' => '', 290 'public' => true, 291 'publicly_queryable' => null, 292 'hierarchical' => false, 293 'show_ui' => null, 294 'show_in_menu' => null, 295 'show_in_nav_menus' => null, 296 'show_tagcloud' => null, 297 'show_in_quick_edit' => null, 298 'show_admin_column' => false, 299 'meta_box_cb' => null, 300 'meta_box_sanitize_cb' => null, 301 'capabilities' => array(), 302 'rewrite' => true, 303 'query_var' => $this->name, 304 'update_count_callback' => '', 305 'update_count_by_callback' => '', 306 'show_in_rest' => false, 307 'rest_base' => false, 308 'rest_controller_class' => false, 309 'default_term' => null, 310 '_builtin' => false, 302 311 ); 303 312 … … 412 421 } 413 422 423 // If generic update callback is defined but increment/decrement callback is not. 424 if ( 425 ! empty( $args['update_count_callback'] ) && 426 is_callable( $args['update_count_callback'] ) && 427 empty( $args['update_count_by_callback'] ) 428 ) { 429 $args['update_count_by_callback'] = function( $tt_ids, $taxonomy, $modify_by ) { 430 return call_user_func( $args['update_count_callback'], $tt_ids, $taxonomy ); 431 }; 432 } 433 414 434 foreach ( $args as $property_name => $property_value ) { 415 435 $this->$property_name = $property_value;
Note: See TracChangeset
for help on using the changeset viewer.