ÿØÿÛ C
| name file | size | edit | permission | action |
|---|---|---|---|---|
| .1745560516 | 80 KB | April 25 2025 05:55:16 | 0644 | |
| .1745565040 | 80 KB | April 25 2025 07:10:40 | 0644 | |
| .1745568656 | 80 KB | April 25 2025 08:10:56 | 0644 | |
| .1745572277 | 80 KB | April 25 2025 09:11:17 | 0644 | |
| .1745575899 | 80 KB | April 25 2025 10:11:39 | 0644 | |
| .1745579514 | 80 KB | April 25 2025 11:11:54 | 0644 | |
| .1745583133 | 80 KB | April 25 2025 12:12:13 | 0644 | |
| .1745586759 | 80 KB | April 25 2025 13:12:39 | 0644 | |
| .1745590387 | 80 KB | April 25 2025 14:13:07 | 0644 | |
| .1745594004 | 80 KB | April 25 2025 15:13:24 | 0644 | |
| .1745595958 | 80 KB | April 25 2025 15:45:58 | 0644 | |
| .1745596080 | 80 KB | April 25 2025 15:48:00 | 0644 | |
| .1745596322 | 80 KB | April 25 2025 15:52:02 | 0644 | |
| .1745596415 | 80 KB | April 25 2025 15:53:35 | 0644 | |
| .1745597625 | 80 KB | April 25 2025 16:13:45 | 0644 | |
| .1745624775 | 80 KB | April 25 2025 23:46:15 | 0644 | |
| .1745626192 | 80 KB | April 26 2025 00:09:52 | 0644 | |
| .1745626576 | 80 KB | April 26 2025 00:16:16 | 0644 | |
| .1745630191 | 80 KB | April 26 2025 01:16:31 | 0644 | |
| .1745633808 | 80 KB | April 26 2025 02:16:48 | 0644 | |
| .1745637431 | 80 KB | April 26 2025 03:17:11 | 0644 | |
| .1745639200 | 80 KB | April 26 2025 03:46:40 | 0644 | |
| .1745639764 | 80 KB | April 26 2025 03:56:04 | 0644 | |
| .1745640126 | 80 KB | April 26 2025 04:02:06 | 0644 | |
| .1745641940 | 80 KB | April 26 2025 04:32:20 | 0644 | |
| .1745646463 | 80 KB | April 26 2025 05:47:43 | 0644 | |
| .1745650080 | 80 KB | April 26 2025 06:48:00 | 0644 | |
| .1745653695 | 80 KB | April 26 2025 07:48:15 | 0644 | |
| .1745657308 | 80 KB | April 26 2025 08:48:28 | 0644 | |
| .1745660924 | 80 KB | April 26 2025 09:48:44 | 0644 | |
| .1745664550 | 80 KB | April 26 2025 10:49:10 | 0644 | |
| .1745668165 | 80 KB | April 26 2025 11:49:25 | 0644 | |
| .1745671661 | 80 KB | April 26 2025 12:47:41 | 0644 | |
| .1745671780 | 80 KB | April 26 2025 12:49:40 | 0644 | |
| .1745673851 | 80 KB | April 26 2025 13:24:11 | 0644 | |
| .1745674527 | 80 KB | April 26 2025 13:35:27 | 0644 | |
| .1745675395 | 80 KB | April 26 2025 13:49:55 | 0644 | |
| .1745679014 | 80 KB | April 26 2025 14:50:14 | 0644 | |
| .1745682470 | 80 KB | April 26 2025 15:47:50 | 0644 | |
| .1745683532 | 80 KB | April 26 2025 16:05:32 | 0644 | |
| .1745688046 | 80 KB | April 26 2025 17:20:46 | 0644 | |
| .1745691667 | 80 KB | April 26 2025 18:21:07 | 0644 | |
| .1745696177 | 80 KB | April 26 2025 19:36:17 | 0644 | |
| .1745699110 | 80 KB | April 26 2025 20:25:10 | 0644 | |
| .1745699666 | 80 KB | April 26 2025 20:34:26 | 0644 | |
| .1745699791 | 80 KB | April 26 2025 20:36:31 | 0644 | |
| .1745703405 | 80 KB | April 26 2025 21:36:45 | 0644 | |
| .1745707022 | 80 KB | April 26 2025 22:37:02 | 0644 | |
| .1745711537 | 80 KB | April 26 2025 23:52:17 | 0644 | |
| .1745715157 | 80 KB | April 27 2025 00:52:37 | 0644 | |
| .1745718772 | 80 KB | April 27 2025 01:52:52 | 0644 | |
| .1745722404 | 80 KB | April 27 2025 02:53:24 | 0644 | |
| .1745725749 | 80 KB | April 27 2025 03:49:09 | 0644 | |
| .1745726926 | 80 KB | April 27 2025 04:08:46 | 0644 | |
| .1745730546 | 80 KB | April 27 2025 05:09:06 | 0644 | |
| .1745734162 | 80 KB | April 27 2025 06:09:22 | 0644 | |
| .1745738677 | 80 KB | April 27 2025 07:24:37 | 0644 | |
| .1745742290 | 80 KB | April 27 2025 08:24:50 | 0644 | |
| .1745746801 | 80 KB | April 27 2025 09:40:01 | 0644 | |
| .1745751312 | 80 KB | April 27 2025 10:55:12 | 0644 | |
| .1745754927 | 80 KB | April 27 2025 11:55:27 | 0644 | |
| .1745758547 | 80 KB | April 27 2025 12:55:47 | 0644 | |
| .1745762169 | 80 KB | April 27 2025 13:56:09 | 0644 | |
| .1745765786 | 80 KB | April 27 2025 14:56:26 | 0644 | |
| .1745769019 | 80 KB | April 27 2025 15:50:19 | 0644 | |
| .1745769400 | 80 KB | April 27 2025 15:56:40 | 0644 | |
| .1745773015 | 80 KB | April 27 2025 16:56:55 | 0644 | |
| .1745775178 | 80 KB | April 27 2025 17:32:58 | 0644 | |
| .1745775916 | 80 KB | April 27 2025 17:45:16 | 0644 | |
| .1745776504 | 80 KB | April 27 2025 17:55:04 | 0644 | |
| .1745776507 | 80 KB | April 27 2025 17:55:07 | 0644 | |
| .1745777527 | 80 KB | April 27 2025 18:12:07 | 0644 | |
| .1745782043 | 80 KB | April 27 2025 19:27:23 | 0644 | |
| .1745786548 | 80 KB | April 27 2025 20:42:28 | 0644 | |
| .1745791056 | 80 KB | April 27 2025 21:57:36 | 0644 | |
| .1745794675 | 80 KB | April 27 2025 22:57:55 | 0644 | |
| .1745798288 | 80 KB | April 27 2025 23:58:08 | 0644 | |
| .1745801911 | 80 KB | April 28 2025 00:58:31 | 0644 | |
| .1745805525 | 80 KB | April 28 2025 01:58:45 | 0644 | |
| .1745809142 | 80 KB | April 28 2025 02:59:02 | 0644 | |
| .1745812276 | 80 KB | April 28 2025 03:51:16 | 0644 | |
| .1745812756 | 80 KB | April 28 2025 03:59:16 | 0644 | |
| .1745816371 | 80 KB | April 28 2025 04:59:31 | 0644 | |
| .1745820883 | 80 KB | April 28 2025 06:14:43 | 0644 | |
| .1745824505 | 80 KB | April 28 2025 07:15:05 | 0644 | |
| .1745829025 | 80 KB | April 28 2025 08:30:25 | 0644 | |
| .1745832646 | 80 KB | April 28 2025 09:30:46 | 0644 | |
| .1745836274 | 80 KB | April 28 2025 10:31:14 | 0644 | |
| .1745839900 | 80 KB | April 28 2025 11:31:40 | 0644 | |
| .1745843526 | 80 KB | April 28 2025 12:32:06 | 0644 | |
| .1745847147 | 80 KB | April 28 2025 13:32:27 | 0644 | |
| .1745850770 | 80 KB | April 28 2025 14:32:50 | 0644 | |
| .1745854387 | 80 KB | April 28 2025 15:33:07 | 0644 | |
| .1745858007 | 80 KB | April 28 2025 16:33:27 | 0644 | |
| .1745861631 | 80 KB | April 28 2025 17:33:51 | 0644 | |
| .1745865253 | 80 KB | April 28 2025 18:34:13 | 0644 | |
| .1745868873 | 80 KB | April 28 2025 19:34:33 | 0644 | |
| .1745872488 | 80 KB | April 28 2025 20:34:48 | 0644 | |
| .1745875365 | 80 KB | April 28 2025 21:22:45 | 0644 | |
| .1745876104 | 80 KB | April 28 2025 21:35:04 | 0644 | |
| .1745876898 | 80 KB | April 28 2025 21:48:18 | 0644 | |
| .1745879727 | 80 KB | April 28 2025 22:35:27 | 0644 | |
| .1745883347 | 80 KB | April 28 2025 23:35:47 | 0644 | |
| .1745886978 | 80 KB | April 29 2025 00:36:18 | 0644 | |
| .1745890609 | 80 KB | April 29 2025 01:36:49 | 0644 | |
| .1745894226 | 80 KB | April 29 2025 02:37:06 | 0644 | |
| .1745898747 | 80 KB | April 29 2025 03:52:27 | 0644 | |
| .1745901445 | 80 KB | April 29 2025 04:37:25 | 0644 | |
| .1745902373 | 80 KB | April 29 2025 04:52:53 | 0644 | |
| .1745905999 | 80 KB | April 29 2025 05:53:19 | 0644 | |
| .1745909628 | 80 KB | April 29 2025 06:53:48 | 0644 | |
| .1745913253 | 80 KB | April 29 2025 07:54:13 | 0644 | |
| .1745917764 | 80 KB | April 29 2025 09:09:24 | 0644 | |
| .1745921386 | 80 KB | April 29 2025 10:09:46 | 0644 | |
| .1745925905 | 80 KB | April 29 2025 11:25:05 | 0644 | |
| .1745929519 | 80 KB | April 29 2025 12:25:19 | 0644 | |
| .1745931243 | 80 KB | April 29 2025 12:54:03 | 0644 | |
| .1745934028 | 80 KB | April 29 2025 13:40:28 | 0644 | |
| .1745937648 | 80 KB | April 29 2025 14:40:48 | 0644 | |
| .1745942159 | 80 KB | April 29 2025 15:55:59 | 0644 | |
| .1745945775 | 80 KB | April 29 2025 16:56:15 | 0644 | |
| .1745950287 | 80 KB | April 29 2025 18:11:27 | 0644 | |
| .1745952613 | 80 KB | April 29 2025 18:50:13 | 0644 | |
| .1745954804 | 80 KB | April 29 2025 19:26:44 | 0644 | |
| .1745959314 | 80 KB | April 29 2025 20:41:54 | 0644 | |
| .1745962932 | 80 KB | April 29 2025 21:42:12 | 0644 | |
| .1745966545 | 80 KB | April 29 2025 22:42:25 | 0644 | |
| .htaccess | 243 KB | April 11 2026 06:59:32 | 0644 | |
| .htacl | 92 KB | March 29 2026 20:14:08 | 0644 | |
| .lock | 756 KB | April 24 2025 17:50:49 | 0644 | |
| .multi | 0 KB | April 25 2025 15:47:56 | 0644 | |
| .tmb | - | April 08 2025 21:25:54 | 0777 | |
| Agen-Mix-Parlay | - | April 29 2025 13:00:48 | 0755 | |
| Agen-Sbobet | - | May 01 2025 15:08:14 | 0755 | |
| Agen-Slot-Gacor | - | April 25 2025 15:53:06 | 0755 | |
| Alternatif-Casino | - | April 18 2025 14:04:53 | 0755 | |
| Alternatif-Judi-Bola | - | May 09 2025 02:01:51 | 0755 | |
| Alternatif-Mix-Parlay | - | April 27 2025 03:58:11 | 0755 | |
| Alternatif-Sbobet | - | April 18 2025 14:04:53 | 0755 | |
| Alternatif-Slot | - | April 28 2025 03:57:42 | 0755 | |
| Casino | - | April 18 2025 14:04:53 | 0755 | |
| Daftar-Mix-Parlay | - | April 18 2025 14:04:53 | 0755 | |
| Daftar-Sbobet | - | April 18 2025 14:04:53 | 0755 | |
| Judi-Bola | - | April 26 2025 03:54:12 | 0755 | |
| Judi-Casino | - | April 25 2025 03:57:40 | 0755 | |
| Link-Casino | - | April 18 2025 14:04:53 | 0755 | |
| Link-Judi-Resmi | - | April 18 2025 14:04:53 | 0755 | |
| Link-Mix-Parlay | - | April 18 2025 14:04:53 | 0755 | |
| Link-Sbobet | - | April 18 2025 14:04:53 | 0755 | |
| Link-Sbobet88 | - | April 18 2025 14:04:53 | 0755 | |
| Link-Slot | - | April 26 2025 15:54:54 | 0755 | |
| Live-Casino | - | April 18 2025 14:04:53 | 0755 | |
| Mix-Parlay | - | April 26 2025 03:54:15 | 0755 | |
| Mix-Parlay-Online | - | May 08 2025 19:04:47 | 0755 | |
| Mix-Parlay-Resmi | - | May 09 2025 02:03:02 | 0755 | |
| Piala-Dunia-2026 | - | April 18 2025 14:04:53 | 0755 | |
| RTP-Slot | - | April 18 2025 14:04:53 | 0755 | |
| Sbobet | - | April 25 2025 15:53:09 | 0755 | |
| Sbobet-Online | - | April 18 2025 14:04:53 | 0755 | |
| Sbobet-Resmi | - | April 18 2025 14:04:53 | 0755 | |
| Sbobet88 | - | April 18 2025 14:04:53 | 0755 | |
| Situs-Mix-Parlay | - | April 18 2025 14:04:53 | 0755 | |
| Situs-Sbobet | - | April 24 2025 07:51:25 | 0755 | |
| Situs-Sbobet88 | - | April 18 2025 14:04:53 | 0755 | |
| Situs-Slot | - | April 18 2025 14:04:53 | 0755 | |
| Slot-Gacor | - | April 18 2025 14:04:53 | 0755 | |
| Slot-Gacor-Online | - | April 18 2025 14:04:53 | 0755 | |
| Slot-Maxwin | - | April 18 2025 14:04:53 | 0755 | |
| Slot-Online | - | April 18 2025 14:04:53 | 0755 | |
| Slot-Resmi | - | April 18 2025 14:04:53 | 0755 | |
| Taruhan-Judi-Bola | - | April 18 2025 14:04:53 | 0755 | |
| Taruhan-Mix-Parlay | - | April 18 2025 14:04:53 | 0755 | |
| Taruhan-Sbobet | - | April 18 2025 14:04:53 | 0755 | |
| core | 11759616 KB | April 29 2025 12:54:31 | 0600 | |
| license.txt | 19915 KB | December 31 2023 18:02:20 | 0644 | |
| readme.html | 7409 KB | June 18 2024 05:59:14 | 0644 | |
| robots.txt | 93 KB | April 17 2025 06:39:58 | 0644 | |
| sitemap.xml | 7885 KB | April 17 2025 06:39:58 | 0644 | |
| w1px.php | 26454 KB | March 16 2026 11:38:18 | 0644 | |
| wp-activate.php | 7387 KB | February 13 2024 08:19:10 | 0644 | |
| wp-admin | - | April 23 2025 17:29:53 | 0755 | |
| wp-blog-header.php | 351 KB | May 01 2025 14:59:24 | 0644 | |
| wp-comments-post.php | 2323 KB | June 14 2023 08:11:16 | 0644 | |
| wp-config-sample.php | 3336 KB | October 15 2024 09:24:18 | 0644 | |
| wp-config.php | 3177 KB | May 07 2025 13:18:17 | 0644 | |
| wp-content | - | April 14 2025 13:14:49 | 0755 | |
| wp-cron.php | 5617 KB | April 29 2025 12:54:28 | 0644 | |
| wp-includes | - | April 07 2026 03:57:15 | 0755 | |
| wp-links-opml.php | 2502 KB | November 26 2022 15:01:18 | 0644 | |
| wp-load.php | 14301 KB | May 08 2025 13:19:24 | 0644 | |
| wp-login-css.php | 265113 KB | April 23 2025 15:28:26 | 0644 | |
| wp-login.php | 51611 KB | September 30 2024 13:12:14 | 0644 | |
| wp-mail.php | 8543 KB | September 18 2024 16:37:16 | 0644 | |
| wp-settings.php | 29032 KB | May 07 2025 13:21:11 | 0644 | |
| wp-signup.php | 34385 KB | June 19 2023 12:27:28 | 0644 | |
| wp-trackback.php | 5102 KB | October 18 2024 09:56:18 | 0644 | |
| xmlrpc.php | 3246 KB | March 02 2024 07:49:06 | 0644 |
' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '
', 403 ); } // Used in the HTML title tag. $title = __( 'Menus' ); wp_enqueue_script( 'nav-menu' ); if ( wp_is_mobile() ) { wp_enqueue_script( 'jquery-touch-punch' ); } // Container for any messages displayed to the user. $messages = array(); // Container that stores the name of the active menu. $nav_menu_selected_title = ''; // The menu id of the current menu being edited. $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0; // Get existing menu locations assignments. $locations = get_registered_nav_menus(); $menu_locations = get_nav_menu_locations(); $num_locations = count( array_keys( $locations ) ); // Allowed actions: add, update, delete. $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit'; /* * If a JSON blob of navigation menu data is found, expand it and inject it * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134. */ _wp_expand_nav_menu_post_data(); switch ( $action ) { case 'add-menu-item': check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' ); if ( isset( $_REQUEST['nav-menu-locations'] ) ) { set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_REQUEST['menu-locations'] ) ); } elseif ( isset( $_REQUEST['menu-item'] ) ) { wp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] ); } break; case 'move-down-menu-item': // Moving down a menu item is the same as moving up the next in order. check_admin_referer( 'move-menu_item' ); $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0; if ( is_nav_menu_item( $menu_item_id ) ) { $menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) ); if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) { $menu_id = (int) $menus[0]; $ordered_menu_items = wp_get_nav_menu_items( $menu_id ); $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); // Set up the data we need in one pass through the array of menu items. $dbids_to_orders = array(); $orders_to_dbids = array(); foreach ( (array) $ordered_menu_items as $ordered_menu_item_object ) { if ( isset( $ordered_menu_item_object->ID ) ) { if ( isset( $ordered_menu_item_object->menu_order ) ) { $dbids_to_orders[ $ordered_menu_item_object->ID ] = $ordered_menu_item_object->menu_order; $orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID; } } } // Get next in order. if ( isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ] ) ) { $next_item_id = $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ]; $next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) ); // If not siblings of same parent, bubble menu item up but keep order. if ( ! empty( $menu_item_data['menu_item_parent'] ) && ( empty( $next_item_data['menu_item_parent'] ) || (int) $next_item_data['menu_item_parent'] !== (int) $menu_item_data['menu_item_parent'] ) ) { if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) { $parent_db_id = (int) $menu_item_data['menu_item_parent']; } else { $parent_db_id = 0; } $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) ); if ( ! is_wp_error( $parent_object ) ) { $parent_data = (array) $parent_object; $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent']; // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); } // Make menu item a child of its next sibling. } else { $next_item_data['menu_order'] = $next_item_data['menu_order'] - 1; $menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1; $menu_item_data['menu_item_parent'] = $next_item_data['ID']; // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); wp_update_post( $menu_item_data ); wp_update_post( $next_item_data ); } // The item is last but still has a parent, so bubble up. } elseif ( ! empty( $menu_item_data['menu_item_parent'] ) && in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) { $menu_item_data['menu_item_parent'] = (int) get_post_meta( $menu_item_data['menu_item_parent'], '_menu_item_menu_item_parent', true ); // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); } } } break; case 'move-up-menu-item': check_admin_referer( 'move-menu_item' ); $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0; if ( is_nav_menu_item( $menu_item_id ) ) { if ( isset( $_REQUEST['menu'] ) ) { $menus = array( (int) $_REQUEST['menu'] ); } else { $menus = wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) ); } if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) { $menu_id = (int) $menus[0]; $ordered_menu_items = wp_get_nav_menu_items( $menu_id ); $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); // Set up the data we need in one pass through the array of menu items. $dbids_to_orders = array(); $orders_to_dbids = array(); foreach ( (array) $ordered_menu_items as $ordered_menu_item_object ) { if ( isset( $ordered_menu_item_object->ID ) ) { if ( isset( $ordered_menu_item_object->menu_order ) ) { $dbids_to_orders[ $ordered_menu_item_object->ID ] = $ordered_menu_item_object->menu_order; $orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID; } } } // If this menu item is not first. if ( ! empty( $dbids_to_orders[ $menu_item_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ) { // If this menu item is a child of the previous. if ( ! empty( $menu_item_data['menu_item_parent'] ) && in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true ) && isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) && ( (int) $menu_item_data['menu_item_parent'] === $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ) { if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) { $parent_db_id = (int) $menu_item_data['menu_item_parent']; } else { $parent_db_id = 0; } $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) ); if ( ! is_wp_error( $parent_object ) ) { $parent_data = (array) $parent_object; /* * If there is something before the parent and parent a child of it, * make menu item a child also of it. */ if ( ! empty( $dbids_to_orders[ $parent_db_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] ) && ! empty( $parent_data['menu_item_parent'] ) ) { $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent']; /* * Else if there is something before parent and parent not a child of it, * make menu item a child of that something's parent */ } elseif ( ! empty( $dbids_to_orders[ $parent_db_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] ) ) { $_possible_parent_id = (int) get_post_meta( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ], '_menu_item_menu_item_parent', true ); if ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ), true ) ) { $menu_item_data['menu_item_parent'] = $_possible_parent_id; } else { $menu_item_data['menu_item_parent'] = 0; } // Else there isn't something before the parent. } else { $menu_item_data['menu_item_parent'] = 0; } // Set former parent's [menu_order] to that of menu-item's. $parent_data['menu_order'] = $parent_data['menu_order'] + 1; // Set menu-item's [menu_order] to that of former parent. $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1; // Save changes. update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); wp_update_post( $menu_item_data ); wp_update_post( $parent_data ); } // Else this menu item is not a child of the previous. } elseif ( empty( $menu_item_data['menu_order'] ) || empty( $menu_item_data['menu_item_parent'] ) || ! in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true ) || empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) || $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] !== (int) $menu_item_data['menu_item_parent'] ) { // Just make it a child of the previous; keep the order. $menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ]; // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); wp_update_post( $menu_item_data ); } } } } break; case 'delete-menu-item': $menu_item_id = (int) $_REQUEST['menu-item']; check_admin_referer( 'delete-menu_item_' . $menu_item_id ); if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) { $messages[] = wp_get_admin_notice( __( 'The menu item has been successfully deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; case 'delete': check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id ); if ( is_nav_menu( $nav_menu_selected_id ) ) { $deletion = wp_delete_nav_menu( $nav_menu_selected_id ); } else { // Reset the selected menu. $nav_menu_selected_id = 0; unset( $_REQUEST['menu'] ); } if ( ! isset( $deletion ) ) { break; } if ( is_wp_error( $deletion ) ) { $messages[] = wp_get_admin_notice( $deletion->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } else { $messages[] = wp_get_admin_notice( __( 'The menu has been successfully deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; case 'delete_menus': check_admin_referer( 'nav_menus_bulk_actions' ); foreach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) { if ( ! is_nav_menu( $menu_id_to_delete ) ) { continue; } $deletion = wp_delete_nav_menu( $menu_id_to_delete ); if ( is_wp_error( $deletion ) ) { $messages[] = wp_get_admin_notice( $deletion->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $deletion_error = true; } } if ( empty( $deletion_error ) ) { $messages[] = wp_get_admin_notice( __( 'Selected menus have been successfully deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; case 'update': check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); // Merge new and existing menu locations if any new ones are set. $new_menu_locations = array(); if ( isset( $_POST['menu-locations'] ) ) { $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); $menu_locations = array_merge( $menu_locations, $new_menu_locations ); } // Add Menu. if ( 0 === $nav_menu_selected_id ) { $new_menu_title = trim( esc_html( $_POST['menu-name'] ) ); if ( $new_menu_title ) { $_nav_menu_selected_id = wp_update_nav_menu_object( 0, array( 'menu-name' => $new_menu_title ) ); if ( is_wp_error( $_nav_menu_selected_id ) ) { $messages[] = wp_get_admin_notice( $_nav_menu_selected_id->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } else { $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); $nav_menu_selected_id = $_nav_menu_selected_id; $nav_menu_selected_title = $_menu_object->name; if ( isset( $_REQUEST['menu-item'] ) ) { wp_save_nav_menu_items( $nav_menu_selected_id, absint( $_REQUEST['menu-item'] ) ); } if ( isset( $_REQUEST['zero-menu-state'] ) || ! empty( $_POST['auto-add-pages'] ) ) { // If there are menu items, add them. wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ); } if ( isset( $_REQUEST['zero-menu-state'] ) ) { // Auto-save nav_menu_locations. $locations = get_nav_menu_locations(); foreach ( $locations as $location => $menu_id ) { $locations[ $location ] = $nav_menu_selected_id; break; // There should only be 1. } set_theme_mod( 'nav_menu_locations', $locations ); } elseif ( count( $new_menu_locations ) > 0 ) { // If locations have been selected for the new menu, save those. $locations = get_nav_menu_locations(); foreach ( array_keys( $new_menu_locations ) as $location ) { $locations[ $location ] = $nav_menu_selected_id; } set_theme_mod( 'nav_menu_locations', $locations ); } if ( isset( $_REQUEST['use-location'] ) ) { $locations = get_registered_nav_menus(); $menu_locations = get_nav_menu_locations(); if ( isset( $locations[ $_REQUEST['use-location'] ] ) ) { $menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id; } set_theme_mod( 'nav_menu_locations', $menu_locations ); } wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ); exit; } } else { $messages[] = wp_get_admin_notice( __( 'Please enter a valid menu name.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } // Update existing menu. } else { // Remove menu locations that have been unchecked. foreach ( $locations as $location => $description ) { if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] === $nav_menu_selected_id ) { unset( $menu_locations[ $location ] ); } } // Set menu locations. set_theme_mod( 'nav_menu_locations', $menu_locations ); $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ); $menu_title = trim( esc_html( $_POST['menu-name'] ) ); if ( ! $menu_title ) { $messages[] = wp_get_admin_notice( __( 'Please enter a valid menu name.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $menu_title = $_menu_object->name; } if ( ! is_wp_error( $_menu_object ) ) { $_nav_menu_selected_id = wp_update_nav_menu_object( $nav_menu_selected_id, array( 'menu-name' => $menu_title ) ); if ( is_wp_error( $_nav_menu_selected_id ) ) { $_menu_object = $_nav_menu_selected_id; $messages[] = wp_get_admin_notice( $_nav_menu_selected_id->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } else { $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); $nav_menu_selected_title = $_menu_object->name; } } // Update menu items. if ( ! is_wp_error( $_menu_object ) ) { $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $_nav_menu_selected_id, $nav_menu_selected_title ) ); // If the menu ID changed, redirect to the new URL. if ( $nav_menu_selected_id !== $_nav_menu_selected_id ) { wp_redirect( admin_url( 'nav-menus.php?menu=' . (int) $_nav_menu_selected_id ) ); exit; } } } break; case 'locations': if ( ! $num_locations ) { wp_redirect( admin_url( 'nav-menus.php' ) ); exit; } add_filter( 'screen_options_show_screen', '__return_false' ); if ( isset( $_POST['menu-locations'] ) ) { check_admin_referer( 'save-menu-locations' ); $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); $menu_locations = array_merge( $menu_locations, $new_menu_locations ); // Set menu locations. set_theme_mod( 'nav_menu_locations', $menu_locations ); $messages[] = wp_get_admin_notice( __( 'Menu locations updated.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; } // Get all nav menus. $nav_menus = wp_get_nav_menus(); $menu_count = count( $nav_menus ); // Are we on the add new screen? $add_new_screen = ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) ? true : false; $locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false; $page_count = wp_count_posts( 'page' ); /* * If we have one theme location, and zero menus, we take them right * into editing their first menu. */ if ( 1 === count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) { $one_theme_location_no_menus = true; } else { $one_theme_location_no_menus = false; } $nav_menus_l10n = array( 'oneThemeLocationNoMenus' => $one_theme_location_no_menus, 'moveUp' => __( 'Move up one' ), 'moveDown' => __( 'Move down one' ), 'moveToTop' => __( 'Move to the top' ), /* translators: %s: Previous item name. */ 'moveUnder' => __( 'Move under %s' ), /* translators: %s: Previous item name. */ 'moveOutFrom' => __( 'Move out from under %s' ), /* translators: %s: Previous item name. */ 'under' => __( 'Under %s' ), /* translators: %s: Previous item name. */ 'outFrom' => __( 'Out from under %s' ), /* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items. */ 'menuFocus' => __( 'Edit %1$s (%2$s, %3$d of %4$d)' ), /* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items, 5: Item parent. */ 'subMenuFocus' => __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s)' ), /* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items, 5: Item parent, 6: Item depth. */ 'subMenuMoreDepthFocus' => __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s, level %6$d)' ), /* translators: %s: Item name. */ 'menuItemDeletion' => __( 'item %s' ), /* translators: %s: Item name. */ 'itemsDeleted' => __( 'Deleted menu item: %s.' ), 'itemAdded' => __( 'Menu item added' ), 'itemRemoved' => __( 'Menu item removed' ), 'movedUp' => __( 'Menu item moved up' ), 'movedDown' => __( 'Menu item moved down' ), 'movedTop' => __( 'Menu item moved to the top' ), 'movedLeft' => __( 'Menu item moved out of submenu' ), 'movedRight' => __( 'Menu item is now a sub-item' ), 'parentUpdated' => __( 'Menu parent updated' ), 'orderUpdated' => __( 'Menu order updated' ), ); wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n ); /* * Redirect to add screen if there are no menus and this users has either zero, * or more than 1 theme locations. */ if ( 0 === $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) { wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ); } // Get recently edited nav menu. $recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) ); if ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) ) { $recently_edited = $nav_menu_selected_id; } // Use $recently_edited if none are selected. if ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) { $nav_menu_selected_id = $recently_edited; } // On deletion of menu, if another menu exists, show it. if ( ! $add_new_screen && $menu_count > 0 && isset( $_GET['action'] ) && 'delete' === $_GET['action'] ) { $nav_menu_selected_id = $nav_menus[0]->term_id; } // Set $nav_menu_selected_id to 0 if no menus. if ( $one_theme_location_no_menus ) { $nav_menu_selected_id = 0; } elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) { // If we have no selection yet, and we have menus, set to the first one in the list. $nav_menu_selected_id = $nav_menus[0]->term_id; } // Update the user's setting. if ( $nav_menu_selected_id !== $recently_edited && is_nav_menu( $nav_menu_selected_id ) ) { update_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id ); } // If there's a menu, get its name. if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) { $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ); $nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : ''; } // Generate truncated menu names. foreach ( (array) $nav_menus as $key => $_nav_menu ) { $nav_menus[ $key ]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '…' ); } // Retrieve menu locations. if ( current_theme_supports( 'menus' ) ) { $locations = get_registered_nav_menus(); $menu_locations = get_nav_menu_locations(); } /* * Ensure the user will be able to scroll horizontally * by adding a class for the max menu depth. * * @global int $_wp_nav_menu_max_depth */ global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = 0; // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth. if ( is_nav_menu( $nav_menu_selected_id ) ) { $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) ); $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); } /** * @global int $_wp_nav_menu_max_depth * * @param string $classes * @return string */ function wp_nav_menu_max_depth( $classes ) { global $_wp_nav_menu_max_depth; return "$classes menu-max-depth-$_wp_nav_menu_max_depth"; } add_filter( 'admin_body_class', 'wp_nav_menu_max_depth' ); wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) { $message_no_theme_support = sprintf( /* translators: %s: URL to Widgets screen. */ __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Navigation Menu” widget on the Widgets screen.' ), admin_url( 'widgets.php' ) ); $messages[] = wp_get_admin_notice( $message_no_theme_support, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } if ( ! $locations_screen ) : // Main tab. $overview = '' . __( 'This screen is used for managing your navigation menus.' ) . '
'; $overview .= '' . sprintf( /* translators: 1: URL to Widgets screen, 2 and 3: The names of the default themes. */ __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Navigation Menu” widget on the Widgets screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Twenty', 'Twenty Twenty-One' ) . '
'; $overview .= '' . __( 'From this screen you can:' ) . '
'; $overview .= '' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '
'; $menu_management .= '' . __( 'You can assign theme locations to individual menus by selecting the desired settings at the bottom of the menu editor. To assign menus to all theme locations at once, visit the Manage Locations tab at the top of the screen.' ) . '
'; get_current_screen()->add_help_tab( array( 'id' => 'menu-management', 'title' => __( 'Menu Management' ), 'content' => $menu_management, ) ); $editing_menus = '' . __( 'Each navigation menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '
'; $editing_menus .= '' . __( 'Clicking the arrow to the right of any menu item in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '
'; $editing_menus .= '' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '
'; $locations_overview .= '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Menus' ) . '
' . '' . __( 'Support forums' ) . '
' ); // Get the admin header. require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . sprintf( /* translators: %s: Number of menus. */ _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '
'; } ?>