=== 3task Post Order for Categories, Pages & Terms === Contributors: 3task Tags: post order, reorder, category order, term order, drag and drop Requires at least: 6.9 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 1.0.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Post order by category: drag and drop posts, pages and terms, undo the last move and import from Intuitive Custom Post Order. == Description == Arrange published posts, pages, custom post types and taxonomy terms. One post can have a different position in each category. * Start in admin-only mode. Connect an archive or a selected Query Loop when ready. * Drag with a mouse or touch, or use Arrow Up and Arrow Down on the move handle. * Find a target across pages and move an item before or after it. * Keep WordPress Quick Edit available in the native lists. * Save with a confirmed server response. Revision conflicts prevent overwriting another editor's newer order. * Undo the most recent move or reset. Reset affects only the selected context. * Import local Intuitive Custom Post Order data with a preview, resumable preparation and a return path. * No account, analytics, external service or bundled font required. = Three everyday steps = 1. Open Tools > Post Order and create an order for a content type, optional category, or a group of sibling terms. 2. Move items using the handle or Move to. Changes save automatically. You can also select the order in the native Posts or Pages list; taxonomy lists offer their available orders above the table. 3. Choose Admin only, Connected blocks, or Archive and connected blocks. Only Archive and connected blocks sorts the category or archive page itself; a line below the choice says whether that page uses the order and links to it. For a block, insert Ordered posts and select the connected order in its sidebar. The existing Query Loop provides the layout. The default post order is publication date descending, with descending ID as a tie-breaker. Terms start alphabetically. Newly published or newly assigned items join the end of an already arranged list. Pages and terms stay under the same parent. Only published posts are included in version 1.0. = Where an order applies = An archive connection affects the matching main post-type or taxonomy archive when it has no explicit sort field. It does not globally replace search results, date sorting, random widgets or arbitrary theme queries. Each connected block uses its selected context. If an order is switched back to Admin only, its connected blocks keep showing the same items, sorted by date. If an order is deleted, its blocks show the newest posts of their content type. A connection never leaves a block empty. Term order affects the selected native term list and explicitly connected get_terms() calls; it does not globally reorder navigation menus or every category widget. Developer examples: `new WP_Query( array( 'post_type' => 'post', 'threepo_context' => 12 ) );` `get_terms( array( 'taxonomy' => 'category', 'threepo_context' => 15 ) );` The context must allow public connections. Normal WordPress visibility rules still apply. The action `threepo_order_changed( $context_id, $revision, $object_id )` runs after a confirmed commit. Page-cache integrations should purge the relevant public pages there; this plugin does not flush the entire site cache on every move. = Importing from ICPO = Keep the old plugin installed. Preview the configured local post types and taxonomies, prepare the import in batches, and compare the proposed order. Equal legacy ranks are resolved by ascending object ID. Only published content is imported. All sibling groups are kept separate. Switching rechecks the source, deactivates Intuitive Custom Post Order and enables the prepared contexts. Database and plugin-activation steps are separate, with durable states so an interrupted operation can resume. If the source changed, return to the legacy order, discard unused preparation and preview again. Imported orders with newer manual changes are kept; returning to the legacy order requires a separate confirmation. Returning disables the imported public connections and reactivates the old plugin if it was active at the switch. Source menu_order and term_order values are never overwritten. Do not uninstall ICPO as the first migration step: its uninstaller can remove shared database columns. = Requirements and limits = WordPress 6.9 or newer. PHP 7.4 syntax compatibility; use a currently patched PHP version for production. InnoDB tables and window functions are required: MySQL 8.0+ or MariaDB 10.6+. SQLite is not supported for ordering writes. Unsupported storage or an existing outer transaction causes writes to stop with an error. Activate separately on each multisite site. Network-wide activation and network site ordering are not supported. Deinstallation honors the current site's explicit data-deletion setting; data on other sites remains. WPML, Polylang, commerce-specific ordering and individual page builders are not supported integrations in this version. Detected multilingual plugins block ordering writes. At most 100 items per API response, normally 50 in the interface; search text up to 200 characters; mutation bodies up to 64 KiB. Import previews support up to 500 sibling groups. Undo is available only while its revision is current. Repeating an operation with its original UUID and payload does not apply it twice while its history record is retained. == Installation == 1. Upload and activate the plugin ZIP. 2. Open Tools > Post Order. Activation creates only this plugin's tables and a cleanup event. 3. Create a context. Existing public queries keep their order until you connect a context. == Frequently Asked Questions == = My category page still shows the old order. Why? = The order is probably set to Admin only or Connected blocks. Both leave the category page in its usual date order. Choose Archive and connected blocks under Tools > Post Order. The line below the choice confirms when the category page uses the order. = Does sorting change my content or page hierarchy? = No. Sort operations write this plugin's own tables. They do not update post content, publication status, parent IDs or modification dates. = Why does my existing block not follow the order? = Enable Connected blocks for that order, insert the Ordered posts variation and select the context. Existing blocks are not silently changed. A theme with its own explicit sort needs an intentional integration. = Who can sort? = Context setup requires manage_options. Post ordering requires the content type's edit_others_posts capability and edit_post for the moved item and target. Terms use their taxonomy's manage_terms plus object permission checks. The management page requires edit_posts. Import operations also require activate_plugins. Standard WordPress REST authentication is used, including cookie nonces and application passwords. = What if two people sort at once? = The first confirmed change wins. A request using an older revision gets a conflict and must reload. A failed or unconfirmed request does not show a false success. = What data is stored? = Local context settings, object IDs, ranks, import snapshots and a bounded change history. History includes the acting WordPress user ID and UTC time. About twenty recent operations per context are retained; daily WordPress cron removes history older than thirty days. Import preparation remains until discarded, so it can be resumed. WordPress personal-data export and erasure include history; erasure anonymizes the actor without changing content order. = What happens when I deactivate or delete the plugin? = Deactivation stops cleanup and keeps all ordering data. Uninstall keeps data by default. Enable the deletion setting before uninstall to remove this plugin's tables on the current site. Content, legacy ranks and other plugins' data remain untouched. == Screenshots == 1. Tools > Post Order: the order for one category with numbered positions, move buttons and Move to. 2. Choose where the order applies. The line below confirms when the category page uses it. 3. Move to: find a target across pages and place the item before or after it. 4. The native Posts list in order mode. Quick Edit stays available. 5. Sibling categories in their own order in the category list. 6. The Ordered posts block variation with the connected order in the block sidebar. 7. Import from Intuitive Custom Post Order: a preview of every group before anything changes. 8. The workspace on a phone, with large buttons for touch. == Security == Please report security issues privately to kontakt@3task.de with the subject "Security". Include the plugin and WordPress versions and reproducible steps. Do not post credentials or exploit details in the public support forum. Supported: the latest 1.x version. We confirm reports within two working days. Tests and automated scans cannot guarantee that software has no undiscovered vulnerabilities. == Credits == Icons: Tabler Icons (https://tabler.io/icons), MIT license, embedded as inline SVG. == Changelog == = 1.0.2 = * New admin design with tabs for orders, import and settings, a clear choice of where an order applies, numbered positions and icon buttons. * Delete an order (administrators). Content and legacy ranks stay unchanged. * Connected blocks no longer turn empty: an order set to Admin only keeps its items sorted by date, a deleted order falls back to the newest posts. * Moving in the native lists now also works on sites without HTTPS. * Order controls in the native lists only appear where an order exists and for users who may sort. * ICPO import: clear message when an order for the same content already exists; preparation no longer stalls when content is published between two steps. * Fewer database reads per page view. * Plugin homepage: https://www.3task.de/3task-post-order/ * Plugin name, short description and tags now describe ordering by category. * The workspace says below the choice whether the matching category or archive page uses the order, with a link to that page. * Scripts and styles carry their file time in the version, so browsers load an updated workspace right away. = 1.0.1 = * Recheck context and item permissions before activating a prepared import. * Handle REST commands consistently regardless of route capitalization. * Keep stale ordering controls disabled after a failed read or unconfirmed save. * Distinguish a confirmed save from a failed list refresh. = 1.0.0 = * Initial release: independent category contexts, posts, pages and terms. * Native list controls, target search, keyboard and touch support. * Revision checks, idempotent writes, undo and reset snapshots. * Explicit archive, Query Loop and developer query connections. * Resumable ICPO import with source checks and a return path. == Upgrade Notice == = 1.0.2 = New admin design, order deletion and more robust import preparation. = 1.0.1 = Improved import permission checks, REST command handling and recovery after connection failures. = 1.0.0 = Initial release. Create a context and explicitly choose where it applies.