Changeset 49451 for trunk/src/wp-includes/class-wp-taxonomy.php
- Timestamp:
- 10/30/2020 04:57:16 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-taxonomy.php
r49171 r49451 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.0187 * @var callable188 */189 public $update_count_by_callback;190 182 191 183 /** … … 286 278 287 279 $defaults = array( 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, 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, 311 302 ); 312 303 … … 421 412 } 422 413 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 ) use ( $args ) {430 return call_user_func( $args['update_count_callback'], $tt_ids, $taxonomy );431 };432 }433 434 414 foreach ( $args as $property_name => $property_value ) { 435 415 $this->$property_name = $property_value;
Note: See TracChangeset
for help on using the changeset viewer.