Skip to content

Commit 5c4a0a2

Browse files
committed
Lint fixes
1 parent 3245ddc commit 5c4a0a2

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

src/Menu_Item_Command.php

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,12 @@ private function add_or_update_item( $method, $type, $args, $assoc_args ) {
645645
// normalises menu_order to 1,2,3… which may differ from the raw DB values.
646646
$sorted_items = get_posts(
647647
[
648-
'post_type' => 'nav_menu_item',
649-
'numberposts' => -1,
650-
'orderby' => 'menu_order',
651-
'order' => 'ASC',
652-
'post_status' => 'any',
653-
'tax_query' => [
648+
'post_type' => 'nav_menu_item',
649+
'numberposts' => -1,
650+
'orderby' => 'menu_order',
651+
'order' => 'ASC',
652+
'post_status' => 'any',
653+
'tax_query' => [
654654
[
655655
'taxonomy' => 'nav_menu',
656656
'field' => 'term_taxonomy_id',
@@ -749,21 +749,6 @@ private function reorder_menu_items( $menu_id, $min_position, $increment, $ignor
749749
return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET `menu_order`=`menu_order`+(%d) WHERE `menu_order`>=%d AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id=%d) AND ID<>%d", (int) $increment, (int) $min_position, (int) $menu_id, (int) $ignore_item_id ) );
750750
}
751751

752-
/**
753-
* Move a range of items in one nav_menu up or down by incrementing/decrementing their menu_order field.
754-
* Only affects items with menu_order between min_position and max_position (inclusive).
755-
*
756-
* @param int $menu_id ID of the nav_menu
757-
* @param int $min_position minimal menu_order to touch (inclusive)
758-
* @param int $max_position maximal menu_order to touch (inclusive)
759-
* @param int $increment how much to change menu_order: +1 to move down, -1 to move up
760-
* @return int|false number of rows affected, or false on failure
761-
*/
762-
private function reorder_menu_items_in_range( $menu_id, $min_position, $max_position, $increment ) {
763-
global $wpdb;
764-
return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET `menu_order`=`menu_order`+(%d) WHERE `menu_order` BETWEEN %d AND %d AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id=%d)", (int) $increment, (int) $min_position, (int) $max_position, (int) $menu_id ) );
765-
}
766-
767752
protected function get_formatter( &$assoc_args ) {
768753
return new Formatter( $assoc_args, $this->obj_fields );
769754
}

0 commit comments

Comments
 (0)