How to Control Which Post Types Appear in the Post Types Order Interface
Content
Many WordPress administrators use the Post Types Order plugin to easily manage the sequence of their content through a drag-and-drop interface. A common point of confusion, however, is that the plugin's "Re-Order" submenu appears for all registered post types by default. This can be problematic if you have post types, like sensitive pages or forms, that you don't want users to be able to rearrange.
Why This Happens
The Post Types Order plugin is designed to be broadly compatible out of the box. To achieve this, it automatically adds its ordering functionality to every public post type it detects. This includes standard posts, pages, and any custom post types created by your theme or other plugins. While this is convenient for setup, it doesn't provide granular control over where the interface appears.
Available Solutions
Based on community discussions and official responses, here are the primary ways to manage this behavior.
1. Using the Advanced Post Types Order Plugin
The most straightforward solution is to use the Advanced Post Types Order plugin, which is the premium version of the free tool. The 'Post Types Order' team has confirmed that the ability to enable or disable the re-order submenu on a per-post-type basis is a feature included in this advanced version. This provides a user-friendly settings interface to control visibility without writing any code.
2. Custom Code Snippet (For Developers)
For those comfortable with code, a community member proposed a custom function to achieve this control. This involves adding a filter to the plugin's options. Important: Always test code snippets on a staging site before using them on a live website, and ensure you have full backups.
The following example demonstrates the concept of creating a settings field to choose post types. Implementation will vary based on your specific setup and requirements.
function reorder_certain_post_types($checked, $echo=true) {
$post_types = get_post_types();
$out = '';
foreach ($post_types as $key => $type) {
$out .= "<label for='certain_post_types[$type]'>";
$out .= "<input type='checkbox' id='certain_post_types[$type]' name='certain_post_types[$type]' ".checked($checked[$type], 'on', false).">";
$out .= "$type</label><br>";
}
if ($echo) {
echo $out;
} else {
return $out;
}
}
Another approach, as forked by a user on GitHub, is to modify the capability required to access the ordering screen. This method uses a filter to change the default capability from manage_options to a custom one, which can then be assigned to specific user roles using a membership plugin.
Conclusion
Whether you choose the advanced plugin for its convenience or a custom-coded solution for maximum control, you are not limited by the default behavior of the Post Types Order plugin. The functionality to restrict the reordering interface to specific post types is well-documented and achievable.
Related Support Threads Support
-
[Plugin: Post Types Order] My two centshttps://wordpress.org/support/topic/plugin-post-types-order-my-two-cents/
-
Better conditionalshttps://wordpress.org/support/topic/better-conditionals/
-
Re-order pages?https://wordpress.org/support/topic/re-order-pages/
-
Propose Choosing Certain Post Type's to Reorderhttps://wordpress.org/support/topic/propose-choosing-certain-post-types-to-reorder/
-
[Plugin: Post Types Order] Requests: Reset and show publication datehttps://wordpress.org/support/topic/plugin-post-types-order-requests-reset-and-show-publication-date/
-
page orderhttps://wordpress.org/support/topic/page-order-29/
-
Add a custom fieldhttps://wordpress.org/support/topic/add-a-custom-field-6/
-
Options filter (for limit by custom capability, for example)https://wordpress.org/support/topic/options-filter-for-limit-by-custom-capability-for-example/
-
Post type order Hookshttps://wordpress.org/support/topic/post-type-order-hooks/
-
[Feature Request] Add post status info to re-order pagehttps://wordpress.org/support/topic/feature-request-add-post-status-info-to-re-order-page/
-
[Plugin: Post Types Order] Add Category Filterhttps://wordpress.org/support/topic/plugin-post-types-order-add-category-filter/
-
[Plugin: Post Types Order] Suggestion: Flip orderhttps://wordpress.org/support/topic/plugin-post-types-order-suggestion-flip-order/
-
Alphabetic order with simple clickhttps://wordpress.org/support/topic/alphabetic-order-with-simple-click/
-
re-order media attachmentshttps://wordpress.org/support/topic/re-order-media-attachments/
-
Can I use this drag and drop on the customizer?https://wordpress.org/support/topic/can-i-use-this-drag-and-drop-on-the-customizer/
-
Lock orderhttps://wordpress.org/support/topic/lock-order/
-
Can you make minimised text search-able?https://wordpress.org/support/topic/can-you-make-minimised-text-search-able/
-
Functionality suggestionhttps://wordpress.org/support/topic/functionality-suggestion/
-
Can this work with WP Forms?https://wordpress.org/support/topic/can-this-work-with-wp-forms/
-
[Plugin: Post Types Order] Custom User Role not workinghttps://wordpress.org/support/topic/plugin-post-types-order-custom-user-role-not-working/
-
[Plugin: Post Types Order] Feature Request – Enable/Disable by Post Typehttps://wordpress.org/support/topic/plugin-post-types-order-feature-request-enabledisable-by-post-type/