Update this soon 2 year limit waring with this hook suggestion!
-
Hi,
Everything works fine in very complex invoriments we tested far. I It doesn’t seems to be needed for any update.
Howvever, there is a wishlist, and one of them is to allow to hook into the list before the plugin get the values.
When using WordPress as a project tool, or editorial purposes, there are MANY POST STATUS involved. A Hook could allow to combine “publish” “analysing” “pending” instead of just current options as ‘publish’ or ‘any’.
Also, if any plugin uses public custom post statuses, settings are forced to be “Published only” if the menu not gonna pickup a h*ll lot of items…
To keep the SIMPLENESS of this plugin, just add a FILTER, no fancy new options! Below is how we HACKED the plugin to make it more useful for our needs.
2 Suggested filters:
plugins/admin-menu-post-list/admin-menu-post-list.php:
INSERTED AT LINE: 274$args = apply_filters('AdminMenuPostList_get_posts', $args, $post_type, $max_numberposts, $post_orderby, $post_order, $post_exclude);
plugins/admin-menu-post-list/admin-menu-post-list.php:
INSERTED AT LINE: 283$child_query = apply_filters('AdminMenuPostList_child_query', $child_query, $post_type, $max_numberposts, $post_orderby, $post_order, $post_exclude);
This is how we using it to allow BOTH publish and draft yo be visible, but no other plugin statuses:
add_filter('AdminMenuPostList_get_posts', 'my_AdminMenuPostList_get_posts', 10, 6); function my_AdminMenuPostList_get_posts($args, $post_type, $max_numberposts, $post_orderby, $post_order, $post_exclude){ $post_exclude = array('publish', 'draft'); $args = array( "post_type" => $post_type, "parent" => "0", "post_parent" => "0", "numberposts" => $max_numberposts, "orderby" => $post_orderby, "order" => $post_order, "post_status" => $post_exclude, "suppress_filters" => 0 ); return $args; }
Thank you!
- The topic ‘Update this soon 2 year limit waring with this hook suggestion!’ is closed to new replies.