- Timestamp:
- 10/08/2020 09:13:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
r47428 r49108 172 172 } 173 173 174 $this->post_id = intval( $matches['id'] );174 $this->post_id = (int) $matches['id']; 175 175 add_action( 'wp_update_nav_menu_item', array( $this, 'flush_cached_value' ), 10, 2 ); 176 176 … … 369 369 foreach ( array( 'object_id', 'menu_item_parent', 'nav_menu_term_id' ) as $key ) { 370 370 if ( ! is_int( $this->value[ $key ] ) ) { 371 $this->value[ $key ] = intval( $this->value[ $key ] );371 $this->value[ $key ] = (int) $this->value[ $key ]; 372 372 } 373 373 } … … 685 685 $menu_item_value = array_merge( $default, $menu_item_value ); 686 686 $menu_item_value = wp_array_slice_assoc( $menu_item_value, array_keys( $default ) ); 687 $menu_item_value['position'] = intval( $menu_item_value['position'] );687 $menu_item_value['position'] = (int) $menu_item_value['position']; 688 688 689 689 foreach ( array( 'object_id', 'menu_item_parent', 'nav_menu_term_id' ) as $key ) { 690 690 // Note we need to allow negative-integer IDs for previewed objects not inserted yet. 691 $menu_item_value[ $key ] = intval( $menu_item_value[ $key ] );691 $menu_item_value[ $key ] = (int) $menu_item_value[ $key ]; 692 692 } 693 693 … … 799 799 } 800 800 801 if ( intval( $value['nav_menu_term_id'] )!== $nav_menu_setting->previous_term_id ) {801 if ( (int) $value['nav_menu_term_id'] !== $nav_menu_setting->previous_term_id ) { 802 802 $this->update_status = 'error'; 803 803 $this->update_error = new WP_Error( 'unexpected_previous_term_id' ); … … 825 825 } 826 826 827 if ( intval( $value['menu_item_parent'] )!== $parent_nav_menu_item_setting->previous_post_id ) {827 if ( (int) $value['menu_item_parent'] !== $parent_nav_menu_item_setting->previous_post_id ) { 828 828 $this->update_status = 'error'; 829 829 $this->update_error = new WP_Error( 'unexpected_previous_post_id' );
Note: See TracChangeset
for help on using the changeset viewer.