Reorder only the custom post types you want
-
First of all, thanks a LOT for this plugin, it always worked for me and it’s great: easy to install (developers) and easy to use (users).
The only downside I have seen so far is that you can’t pick which post types you want to reorder, by default all of them are “reordable”.
The solution for this problem, as provided in your FAQ is to extract the Reorder class from the plugin, therefore stopping using the plugin. Since I’m not fond of discrediting people for their hard word to make our lives easier (lol), I managed to add a single code line to the plugin so now I can chose which post types I want to apply reorder, still using the plugin.
In the plugin’s index.php file, at line 65 (under “mn_reorder_posts_init” function), I’ve added the following filter:
$post_types = apply_filters( 'metronet_reorder_post_types', $post_types );
So now whenever I want to specify which custom post types to reorder, I add this to my functions.php:
add_filter('metronet_reorder_post_types', 'set_reorder'); function set_reorder($post_types){ $post_types = array('my_custom_post_type', 'my_other_post_type'); return $post_types; }
This was a fast implementation, not fail-proof and I’m sure there’s a way to make it work a lot better, but that’s working fine for me so far.
Anyway, this is my suggestion to make the plugin better, hope you guys implement it some time! ??
Best regards!
https://www.ads-software.com/extend/plugins/metronet-reorder-posts/
- The topic ‘Reorder only the custom post types you want’ is closed to new replies.