From 9c45a186552b651291cb38fdd187591e837bf43c Mon Sep 17 00:00:00 2001 From: jmash Date: Tue, 19 Feb 2008 16:48:23 +0000 Subject: [PATCH] cnahged exclude_pages DB update format git-svn-id: https://plugins.svn.wordpress.org/pagemash/trunk@32266 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pagemash.php | 17 ++++------------- reorder.php | 4 +--- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/pagemash.php b/pagemash.php index 86b32d7..5675891 100644 --- a/pagemash.php +++ b/pagemash.php @@ -4,7 +4,7 @@ Plugin Name: pageMash Plugin URI: http://joelstarnes.co.uk/pagemash/ Description: pageMash > pageManagement [WP_Admin > Manage > pageMash] Author: Joel Starnes -Version: 0.1.3 +Version: 0.1.2 Author URI: http://joelstarnes.co.uk/ CHANGELOG: @@ -64,18 +64,9 @@ function pageMash_main(){ } //get pages set to exclude - $excludePagesList = get_option('exclude_pages'); - switch($excludePagesList) { - case null: - //adds exclude_pages row to options DB. @FIXME runs when the value exists but equals '' - add_option("exclude_pages", '', 'Pages to not show in menu.', 'yes'); - break; - default: - //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 - $excludePagesList = '>,'.$excludePagesList; - break; - } + $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 ?>
diff --git a/reorder.php b/reorder.php index 2e37755..ea40d7b 100644 --- a/reorder.php +++ b/reorder.php @@ -9,9 +9,7 @@ foreach ($order as $pageid): $position += 1; //increment position var endforeach; -$exclude = $_GET['exclude']; -$postquery = "UPDATE $wpdb->options SET option_value='$exclude' WHERE option_name='exclude_pages'"; //setup db query -$wpdb->query($postquery); //update pages in db +update_option("exclude_pages", $value = $_GET['exclude'];, $description = 'PageMash: Pages to not show in menu.', $autoload = 'yes'); echo "pagemashed"; ?>