Plugin Directory

Changeset 3692265


Ignore:
Timestamp:
09/12/2026 02:05:39 AM (2 months ago)
Author:
hellosabrinamok
Message:

Release version 1.0.1 with WordPress 7.1 compatibility, listing improvements, and menu reorder fixes

Location:
bulk-menu-reorder
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • bulk-menu-reorder/tags/1.0.1/assets/css/bulk-menu-reorder.css

    r3499574 r3692265  
    77.menu-item.selected {
    88    background-color: #f0f6fc;
     9}
     10
     11.bmrr-select-item {
     12    display: inline-flex;
     13    align-items: center;
     14    gap: 4px;
     15    margin-right: 10px;
     16    color: #50575e;
     17    font-size: 12px;
     18    font-weight: 400;
     19}
     20
     21.bmrr-select-item input {
     22    margin: 0;
    923}
    1024
  • bulk-menu-reorder/tags/1.0.1/assets/js/bulk-menu-reorder.js

    r3499574 r3692265  
    55        init: function() {
    66            this.menuList = $('#menu-to-edit');
     7            if (!this.menuList.length) {
     8                return;
     9            }
     10            this.addSelectionControls();
    711            this.bindEvents();
    812            this.initSortable();
    913        },
    1014
     15        addSelectionControls: function() {
     16            this.menuList.find('> .menu-item').each(function() {
     17                const item = $(this);
     18                const itemId = item.find('.menu-item-data-db-id').val();
     19
     20                if (!item.find('.bmrr-menu-item-checkbox').length) {
     21                    item.find('.item-controls').prepend(
     22                        '<label class="bmrr-select-item" title="Select this item for bulk reordering">' +
     23                        '<input type="checkbox" class="bmrr-menu-item-checkbox" aria-label="Select menu item ' + itemId + '">' +
     24                        '<span>Select</span></label>'
     25                    );
     26                }
     27            });
     28        },
     29
    1130        bindEvents: function() {
    1231            // Extend existing WordPress menu item selection
    13             $(document).on('click', '.menu-item-checkbox', function() {
     32            $(document).on('click', '.bmrr-menu-item-checkbox', function(e) {
     33                e.stopPropagation();
    1434                const menuItem = $(this).closest('.menu-item');
    15                 menuItem.toggleClass('selected');
     35                menuItem.toggleClass('selected', this.checked);
    1636            });
    1737        },
    … …  
    152172
    153173            $.ajax({
    154                 url: bulkMenuReorder.ajaxUrl,
     174                url: bmrrBulkMenuReorder.ajaxUrl,
    155175                method: 'POST',
    156176                data: {
    157                     action: 'bulk_reorder_menu_items',
    158                     nonce: bulkMenuReorder.nonce,
     177                    action: 'bmrr_bulk_reorder_menu_items',
     178                    nonce: bmrrBulkMenuReorder.nonce,
    159179                    menu_id: menuId,
    160                     menu_data: menuData
     180                    menu_data: JSON.stringify(menuData)
    161181                },
    162182                success: function(response) {
  • bulk-menu-reorder/tags/1.0.1/bulk-menu-reorder.php

    r3499574 r3692265  
    11<?php
    22/**
    3  * Plugin Name: Bulk Menu Reorder
    4  * Description: Enables bulk reordering of menu items in WordPress navigation menus
    5  * Version: 1.0.0
     3 * Plugin Name: Bulk Navigation Menu Reorder
     4 * Description: Reorder multiple WordPress navigation menu items using a simple drag-and-drop interface.
     5 * Version: 1.0.1
     6 * Requires at least: 6.0
     7 * Requires PHP: 7.4
    68 * Author: ATTN Studio
    79 * License: GPL v2 or later
    … …  
    1315
    1416// Define plugin constants
    15 define('BMRR_PLUGIN_VERSION', '1.0.0');
     17define('BMRR_PLUGIN_VERSION', '1.0.1');
    1618define('BMRR_PLUGIN_DIR', plugin_dir_path(__FILE__));
    1719define('BMRR_PLUGIN_URL', plugin_dir_url(__FILE__));
  • bulk-menu-reorder/tags/1.0.1/includes/class-bulk-menu-reorder.php

    r3499574 r3692265  
    3939   
    4040        // Sanitize and unslash the input
    41         $menu_data_raw = isset($_POST['menu_data']) ? sanitize_text_field(wp_unslash($_POST['menu_data'])) : '';
     41        $menu_data_raw = isset($_POST['menu_data']) ? wp_unslash($_POST['menu_data']) : '';
    4242   
    4343        // Decode the JSON data
    … …  
    4848            wp_send_json_error('Invalid data format');
    4949        }
     50
     51        $menu_id = isset($_POST['menu_id']) ? absint($_POST['menu_id']) : 0;
     52        $menu = wp_get_nav_menu_object($menu_id);
     53
     54        if (!$menu) {
     55            wp_send_json_error('Invalid menu');
     56        }
     57
     58        $allowed_item_ids = wp_list_pluck(wp_get_nav_menu_items($menu_id), 'ID');
    5059   
    5160        foreach ($menu_data as $position => $item) {
    … …  
    5463   
    5564            // Basic sanitization for item_id and parent_id
    56             if ($item_id <= 0 || $parent_id < 0) {
     65            if ($item_id <= 0 || $parent_id < 0 || !in_array($item_id, $allowed_item_ids, true)) {
    5766                wp_send_json_error('Invalid menu item data');
     67            }
     68
     69            if ($parent_id > 0 && !in_array($parent_id, $allowed_item_ids, true)) {
     70                wp_send_json_error('Invalid parent menu item');
    5871            }
    5972   
    6073            // Update menu item position and parent
    61             update_post_meta($item_id, '_menu_item_menu_order', absint($position));
     74            wp_update_post(array(
     75                'ID'         => $item_id,
     76                'menu_order' => absint($position) + 1,
     77            ));
    6278            update_post_meta($item_id, '_menu_item_menu_item_parent', $parent_id);
    6379        }
  • bulk-menu-reorder/tags/1.0.1/readme.txt

    r3499578 r3692265  
    1 === Bulk Menu Reorder ===
     1=== Bulk Navigation Menu Reorder ===
    22Contributors: hellosabrinamok
     3Tags: navigation menu, menu, menu order, reorder, bulk edit
    34Requires at least: 6.0
    4 Tested up to: 6.8
     5Tested up to: 7.1
    56Requires PHP: 7.4
    6 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    78License: GPLv2 or later
    89License URI: https://www.gnu.org/licenses/gpl-2.0.html
    910
    10 Bulk Menu Reorder enables bulk reordering of menu items in WordPress navigation menus, saving time and effort in menu management.
     11Reorder multiple WordPress navigation menu items at once using a simple drag-and-drop interface built for large and nested menus.
    1112
    1213== Description ==
    1314
    14 **Bulk Menu Reorder** simplifies the process of managing navigation menus in WordPress by allowing users to reorder multiple menu items at once. Designed for websites with complex menus, this plugin saves time and improves efficiency.
     15Reordering a large WordPress navigation menu one item at a time can be slow and frustrating.
    1516
    16 **Features:**
    17 - Bulk reordering of menu items.
    18 - Easy-to-use interface in the WordPress Admin Dashboard.
    19 - Compatibility with most WordPress themes.
     17**Bulk Navigation Menu Reorder** adds a focused bulk-reordering interface to the standard WordPress menu editor. It helps administrators organize large navigation menus and nested menu structures more efficiently without changing the website's frontend design.
    2018
    21 Whether you have a large e-commerce site or a blog with multiple menus, Bulk Menu Reorder helps you keep your navigation organized with ease.
     19**Key features:**
     20
     21* Reorder multiple navigation menu items efficiently.
     22* Organize parent and child menu items with drag and drop.
     23* Work directly from Appearance > Menus.
     24* Load plugin assets only on the navigation menu screen.
     25* Make no changes to the website's frontend styling.
     26
     27The plugin is especially useful for large websites, stores, directories, and content-heavy sites with complex navigation.
    2228
    2329== Installation ==
    … …  
    25311. Upload the plugin files to the `/wp-content/plugins/bulk-menu-reorder` directory, or install the plugin through the WordPress Plugins screen directly.
    26322. Activate the plugin through the 'Plugins' screen in WordPress.
    27 3. Navigate to **Appearance > Menus** to start reordering menu items.
     333. Navigate to **Appearance > Menus** and select the menu you want to organize.
     344. Use the bulk-reordering interface to arrange the items and save the new order.
    2835
    2936== Frequently Asked Questions ==
    3037
    31 = Does this plugin work with all themes? =
    32 Yes, the plugin works with any theme that supports WordPress navigation menus.
     38= Does this plugin change the appearance of my menu? =
    3339
    34 = Can I undo changes made to my menu? =
    35 Yes, changes to menu order can be undone by manually reordering items or restoring a previous backup.
     40No. It changes the order and hierarchy of navigation menu items but does not add frontend styles or alter your theme's menu design.
     41
     42= Can I organize nested menu items? =
     43
     44Yes. Menu items can be organized into parent and child relationships using the drag-and-drop interface.
     45
     46= Who can reorder menus? =
     47
     48Only users with permission to manage theme options and navigation menus can save changes.
    3649
    3750= Does this plugin support multisite? =
    … …  
    4053== Screenshots ==
    4154
    42 1. **Bulk Reordering**: A preview of the bulk reorder functionality in the menu editor.
     551. Bulk-reordering interface in the WordPress navigation menu editor.
    4356
    4457== Changelog ==
     58
     59= 1.0.1 =
     60* Fixed bulk reorder requests so menu changes save correctly.
     61* Added visible selection controls for choosing multiple menu items.
     62* Improved validation of menu items and parent relationships.
     63* Improved the plugin name, directory description, tags, and documentation.
    4564
    4665= 1.0.0 =
    … …  
    4968== Upgrade Notice ==
    5069
    51 = 1.0.0 =
    52 Initial release of Bulk Menu Reorder. Enjoy bulk reordering of your WordPress menu items.
     70= 1.0.1 =
     71Improved directory information and documentation.
    5372
    5473== License ==
  • bulk-menu-reorder/trunk/assets/css/bulk-menu-reorder.css

    r3499574 r3692265  
    77.menu-item.selected {
    88    background-color: #f0f6fc;
     9}
     10
     11.bmrr-select-item {
     12    display: inline-flex;
     13    align-items: center;
     14    gap: 4px;
     15    margin-right: 10px;
     16    color: #50575e;
     17    font-size: 12px;
     18    font-weight: 400;
     19}
     20
     21.bmrr-select-item input {
     22    margin: 0;
    923}
    1024
  • bulk-menu-reorder/trunk/assets/js/bulk-menu-reorder.js

    r3499574 r3692265  
    55        init: function() {
    66            this.menuList = $('#menu-to-edit');
     7            if (!this.menuList.length) {
     8                return;
     9            }
     10            this.addSelectionControls();
    711            this.bindEvents();
    812            this.initSortable();
    913        },
    1014
     15        addSelectionControls: function() {
     16            this.menuList.find('> .menu-item').each(function() {
     17                const item = $(this);
     18                const itemId = item.find('.menu-item-data-db-id').val();
     19
     20                if (!item.find('.bmrr-menu-item-checkbox').length) {
     21                    item.find('.item-controls').prepend(
     22                        '<label class="bmrr-select-item" title="Select this item for bulk reordering">' +
     23                        '<input type="checkbox" class="bmrr-menu-item-checkbox" aria-label="Select menu item ' + itemId + '">' +
     24                        '<span>Select</span></label>'
     25                    );
     26                }
     27            });
     28        },
     29
    1130        bindEvents: function() {
    1231            // Extend existing WordPress menu item selection
    13             $(document).on('click', '.menu-item-checkbox', function() {
     32            $(document).on('click', '.bmrr-menu-item-checkbox', function(e) {
     33                e.stopPropagation();
    1434                const menuItem = $(this).closest('.menu-item');
    15                 menuItem.toggleClass('selected');
     35                menuItem.toggleClass('selected', this.checked);
    1636            });
    1737        },
    … …  
    152172
    153173            $.ajax({
    154                 url: bulkMenuReorder.ajaxUrl,
     174                url: bmrrBulkMenuReorder.ajaxUrl,
    155175                method: 'POST',
    156176                data: {
    157                     action: 'bulk_reorder_menu_items',
    158                     nonce: bulkMenuReorder.nonce,
     177                    action: 'bmrr_bulk_reorder_menu_items',
     178                    nonce: bmrrBulkMenuReorder.nonce,
    159179                    menu_id: menuId,
    160                     menu_data: menuData
     180                    menu_data: JSON.stringify(menuData)
    161181                },
    162182                success: function(response) {
  • bulk-menu-reorder/trunk/bulk-menu-reorder.php

    r3499574 r3692265  
    11<?php
    22/**
    3  * Plugin Name: Bulk Menu Reorder
    4  * Description: Enables bulk reordering of menu items in WordPress navigation menus
    5  * Version: 1.0.0
     3 * Plugin Name: Bulk Navigation Menu Reorder
     4 * Description: Reorder multiple WordPress navigation menu items using a simple drag-and-drop interface.
     5 * Version: 1.0.1
     6 * Requires at least: 6.0
     7 * Requires PHP: 7.4
    68 * Author: ATTN Studio
    79 * License: GPL v2 or later
    … …  
    1315
    1416// Define plugin constants
    15 define('BMRR_PLUGIN_VERSION', '1.0.0');
     17define('BMRR_PLUGIN_VERSION', '1.0.1');
    1618define('BMRR_PLUGIN_DIR', plugin_dir_path(__FILE__));
    1719define('BMRR_PLUGIN_URL', plugin_dir_url(__FILE__));
  • bulk-menu-reorder/trunk/includes/class-bulk-menu-reorder.php

    r3499574 r3692265  
    3939   
    4040        // Sanitize and unslash the input
    41         $menu_data_raw = isset($_POST['menu_data']) ? sanitize_text_field(wp_unslash($_POST['menu_data'])) : '';
     41        $menu_data_raw = isset($_POST['menu_data']) ? wp_unslash($_POST['menu_data']) : '';
    4242   
    4343        // Decode the JSON data
    … …  
    4848            wp_send_json_error('Invalid data format');
    4949        }
     50
     51        $menu_id = isset($_POST['menu_id']) ? absint($_POST['menu_id']) : 0;
     52        $menu = wp_get_nav_menu_object($menu_id);
     53
     54        if (!$menu) {
     55            wp_send_json_error('Invalid menu');
     56        }
     57
     58        $allowed_item_ids = wp_list_pluck(wp_get_nav_menu_items($menu_id), 'ID');
    5059   
    5160        foreach ($menu_data as $position => $item) {
    … …  
    5463   
    5564            // Basic sanitization for item_id and parent_id
    56             if ($item_id <= 0 || $parent_id < 0) {
     65            if ($item_id <= 0 || $parent_id < 0 || !in_array($item_id, $allowed_item_ids, true)) {
    5766                wp_send_json_error('Invalid menu item data');
     67            }
     68
     69            if ($parent_id > 0 && !in_array($parent_id, $allowed_item_ids, true)) {
     70                wp_send_json_error('Invalid parent menu item');
    5871            }
    5972   
    6073            // Update menu item position and parent
    61             update_post_meta($item_id, '_menu_item_menu_order', absint($position));
     74            wp_update_post(array(
     75                'ID'         => $item_id,
     76                'menu_order' => absint($position) + 1,
     77            ));
    6278            update_post_meta($item_id, '_menu_item_menu_item_parent', $parent_id);
    6379        }
  • bulk-menu-reorder/trunk/readme.txt

    r3499578 r3692265  
    1 === Bulk Menu Reorder ===
     1=== Bulk Navigation Menu Reorder ===
    22Contributors: hellosabrinamok
     3Tags: navigation menu, menu, menu order, reorder, bulk edit
    34Requires at least: 6.0
    4 Tested up to: 6.8
     5Tested up to: 7.1
    56Requires PHP: 7.4
    6 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    78License: GPLv2 or later
    89License URI: https://www.gnu.org/licenses/gpl-2.0.html
    910
    10 Bulk Menu Reorder enables bulk reordering of menu items in WordPress navigation menus, saving time and effort in menu management.
     11Reorder multiple WordPress navigation menu items at once using a simple drag-and-drop interface built for large and nested menus.
    1112
    1213== Description ==
    1314
    14 **Bulk Menu Reorder** simplifies the process of managing navigation menus in WordPress by allowing users to reorder multiple menu items at once. Designed for websites with complex menus, this plugin saves time and improves efficiency.
     15Reordering a large WordPress navigation menu one item at a time can be slow and frustrating.
    1516
    16 **Features:**
    17 - Bulk reordering of menu items.
    18 - Easy-to-use interface in the WordPress Admin Dashboard.
    19 - Compatibility with most WordPress themes.
     17**Bulk Navigation Menu Reorder** adds a focused bulk-reordering interface to the standard WordPress menu editor. It helps administrators organize large navigation menus and nested menu structures more efficiently without changing the website's frontend design.
    2018
    21 Whether you have a large e-commerce site or a blog with multiple menus, Bulk Menu Reorder helps you keep your navigation organized with ease.
     19**Key features:**
     20
     21* Reorder multiple navigation menu items efficiently.
     22* Organize parent and child menu items with drag and drop.
     23* Work directly from Appearance > Menus.
     24* Load plugin assets only on the navigation menu screen.
     25* Make no changes to the website's frontend styling.
     26
     27The plugin is especially useful for large websites, stores, directories, and content-heavy sites with complex navigation.
    2228
    2329== Installation ==
    … …  
    25311. Upload the plugin files to the `/wp-content/plugins/bulk-menu-reorder` directory, or install the plugin through the WordPress Plugins screen directly.
    26322. Activate the plugin through the 'Plugins' screen in WordPress.
    27 3. Navigate to **Appearance > Menus** to start reordering menu items.
     333. Navigate to **Appearance > Menus** and select the menu you want to organize.
     344. Use the bulk-reordering interface to arrange the items and save the new order.
    2835
    2936== Frequently Asked Questions ==
    3037
    31 = Does this plugin work with all themes? =
    32 Yes, the plugin works with any theme that supports WordPress navigation menus.
     38= Does this plugin change the appearance of my menu? =
    3339
    34 = Can I undo changes made to my menu? =
    35 Yes, changes to menu order can be undone by manually reordering items or restoring a previous backup.
     40No. It changes the order and hierarchy of navigation menu items but does not add frontend styles or alter your theme's menu design.
     41
     42= Can I organize nested menu items? =
     43
     44Yes. Menu items can be organized into parent and child relationships using the drag-and-drop interface.
     45
     46= Who can reorder menus? =
     47
     48Only users with permission to manage theme options and navigation menus can save changes.
    3649
    3750= Does this plugin support multisite? =
    … …  
    4053== Screenshots ==
    4154
    42 1. **Bulk Reordering**: A preview of the bulk reorder functionality in the menu editor.
     551. Bulk-reordering interface in the WordPress navigation menu editor.
    4356
    4457== Changelog ==
     58
     59= 1.0.1 =
     60* Fixed bulk reorder requests so menu changes save correctly.
     61* Added visible selection controls for choosing multiple menu items.
     62* Improved validation of menu items and parent relationships.
     63* Improved the plugin name, directory description, tags, and documentation.
    4564
    4665= 1.0.0 =
    … …  
    4968== Upgrade Notice ==
    5069
    51 = 1.0.0 =
    52 Initial release of Bulk Menu Reorder. Enjoy bulk reordering of your WordPress menu items.
     70= 1.0.1 =
     71Improved directory information and documentation.
    5372
    5473== License ==
Note: See TracChangeset for help on using the changeset viewer.