pageManagement [WP_Admin > Manage > pageMash] Author: Joel Starnes Version: 0.1.2 Author URI: http://joelstarnes.co.uk/ CHANGELOG: Release: Date: Description: 0.1.0 10 Feb 2008 Initial release 0.1.1 12 Feb 2008 Fixed Removed external include 0.1.2 15 Feb 2008 Fixed CSS&JS headers to only display on pagemash 0.1.3 19 Feb 2008 Fixed exclude pages feature */ #########CONFIG OPTIONS############################################ $minlevel = 7; /*[deafult=7]*/ /* Minimum user level to access page order */ $instantUpdateFeature = false; /*[deafult=false]*/ /* Updates the database instantly after a move using ajax otherwise it will wait for update button press. nb. enabling this feature will put strain on the mysql server */ $excludePagesFeature = true; /*[deafult=true]*/ /* Allows you to set pages not to be listed Will only work if you have modified the template. */ ################################################################### /* CREDITS: Valerio Proietti - Mootools JS Framework [http://mootools.net/] Stefan Lange-Hegermann - Mootools AJAX timeout class extension [http://www.blackmac.de/archives/44-Mootools-AJAX-timeout.html] vladimir - Mootools Sortables class extension [http://vladimir.akilles.cl/scripts/sortables/] ShiftThis - WP Page Order Plugin [http://www.shiftthis.net/wordpress-order-pages-plugin/] */ /* Copyright 2008 Joel Starnes (email : joel@joelstarnes.co.uk) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function pageMash_main(){ global $wpdb, $wp_version, $instantUpdateFeature, $excludePagesFeature; //get pages from database if($wp_version >= 2.1){ $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = '0' ORDER BY menu_order"); }else{ $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_parent = '0' ORDER BY menu_order"); } //get pages set to exclude $excludePagesList = '>,'.get_option('exclude_pages'); //precede with '>,' otherwise the first pageid will return 0 when strpos() is called to find it. //the initial coma allows us to search for ',$pageid,' so as to avoid partial matches ?>
version [0.1.3]

pageMash - pageManagement

You can use this to organise and manage your pages.


Show|Hide Further Info

How to

Just drag the pages into the order you like, hit 'update' and enjoy the scrummy ajaxified goodness.

Click the little red icon to left of each page to hide that page or press the 'edit' button to edit that page. Sorted.
Note: This plugin only orders top level pages

To use this plugin you need to use the wp_list_pages() function with the parameters as shown below:

<?php if(function_exists('pageMash_exclude_pages')){$exclude_pages=pageMash_exclude_pages();} else{$exclude_pages='';}?>
<?php wp_list_pages('title_li=<h2>Pages</h2>&exclude='.$exclude_pages);?>

For more information on the wp_list_pages() function checkout the Wordpress Codex and if you have any further questions, just drop me an email.

'.$_GET["page"], 'pagemash')){ // only include header stuff on pagemash admin page //stylesheet & javascript to go in page header global $instantUpdateFeature, $excludePagesFeature; ?> get_results("SELECT option_value FROM $wpdb->options WHERE option_name = 'exclude_pages'"); return $excludePagesObj[0]->option_value; } add_action('admin_menu', 'pageMash_add_pages'); //add admin menu under management tab add_action('admin_head', 'pageMash_head'); //add css styles and JS code to head ?>