My Page Order WordPress Plugin Modifcation

My Page Order WordPress Plugin Modifcation

I have been working with a client recently that was using the My Page Order plugin for the WordPress CMS I set up. They had several “draft” pages they used for templates and did not want them to show up in the My Page Order Admin interface. After looking at the SQL code, I added in a piece that would only show published (live) pages.
To make the same change in your code, open up the plugin file (mypageorder.php), go to line 47 and change the following line:

$results=$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' ORDER BY menu_order ASC");

to:

$results=$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' and post_status='publish' ORDER BY menu_order ASC");

Now, only the pages you really want to order will appear in the menu.

4 thoughts on “My Page Order WordPress Plugin Modifcation”
  1. look |

    the plugin I like in this case (to do a little more…) is the “Navigation tool for WordPress” where you can not only manage pages but also categories and more.
    http://wordpress.org/extend/plugins/wordpress-navigation-list-plugin-navt/

  2. jzelazny |

    The plugin looks very interesting – I will definitely give it a shot. Thanks!

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.