| @@ 711-730 (lines=20) @@ | ||
| 708 | $reorder = true; |
|
| 709 | break; |
|
| 710 | } |
|
| 711 | } else { |
|
| 712 | check_admin_referer( 'nova_move_item_down_' . $post_id ); |
|
| 713 | ||
| 714 | $last_post_id = end( $order ); |
|
| 715 | if ( $post_id == $last_post_id ) { |
|
| 716 | break; |
|
| 717 | } |
|
| 718 | ||
| 719 | foreach ( $order as $menu_order => $order_post_id ) { |
|
| 720 | if ( $post_id != $order_post_id ) { |
|
| 721 | continue; |
|
| 722 | } |
|
| 723 | ||
| 724 | $swap_post_id = $order[$menu_order + 1]; |
|
| 725 | $order[$menu_order + 1] = $post_id; |
|
| 726 | $order[$menu_order] = $swap_post_id; |
|
| 727 | ||
| 728 | $reorder = true; |
|
| 729 | } |
|
| 730 | } |
|
| 731 | ||
| 732 | if ( $reorder ) { |
|
| 733 | foreach ( $order as $menu_order => $ID ) { |
|
| @@ 772-791 (lines=20) @@ | ||
| 769 | $reorder = true; |
|
| 770 | break; |
|
| 771 | } |
|
| 772 | } else { |
|
| 773 | check_admin_referer( 'nova_move_menu_down_' . $term_id ); |
|
| 774 | ||
| 775 | $last_term_id = end( $order ); |
|
| 776 | if ( $term_id == $last_term_id ) { |
|
| 777 | break; |
|
| 778 | } |
|
| 779 | ||
| 780 | foreach ( $order as $menu_order => $order_term_id ) { |
|
| 781 | if ( $term_id != $order_term_id ) { |
|
| 782 | continue; |
|
| 783 | } |
|
| 784 | ||
| 785 | $swap_term_id = $order[$menu_order + 1]; |
|
| 786 | $order[$menu_order + 1] = $term_id; |
|
| 787 | $order[$menu_order] = $swap_term_id; |
|
| 788 | ||
| 789 | $reorder = true; |
|
| 790 | } |
|
| 791 | } |
|
| 792 | ||
| 793 | if ( $reorder ) { |
|
| 794 | update_option( 'nova_menu_order', $order ); |
|