diff --git a/App/Controllers/Admin/Plugin/Uninstall.php b/App/Controllers/Admin/Plugin/Uninstall.php index 7dd4517..010213e 100644 --- a/App/Controllers/Admin/Plugin/Uninstall.php +++ b/App/Controllers/Admin/Plugin/Uninstall.php @@ -37,7 +37,7 @@ private function doUninstallAction() // reset order number in `posts` table. $PostOrder = new \RdPostOrder\App\Models\PostOrder(); - $PostOrder->resetPosts(); + $PostOrder->setMenuOrderToZero(); unset($PostOrder); // remove option related to this plugin. diff --git a/App/Controllers/Admin/Settings/MultisiteSettings.php b/App/Controllers/Admin/Settings/MultisiteSettings.php index 22bae80..0414da6 100644 --- a/App/Controllers/Admin/Settings/MultisiteSettings.php +++ b/App/Controllers/Admin/Settings/MultisiteSettings.php @@ -51,6 +51,8 @@ public function networkSettingsPageAction() $resetPostOrders = filter_input(INPUT_POST, 'rd-postorder-remove-order-numbers', FILTER_SANITIZE_NUMBER_INT); if ($resetPostOrders == '1') { + // if setting to remove order numbers (reset post orders). + // reset post orders on all site. global $wpdb; $blog_ids = $wpdb->get_col('SELECT blog_id FROM '.$wpdb->blogs); @@ -62,7 +64,7 @@ public function networkSettingsPageAction() foreach ($blog_ids as $blog_id) { switch_to_blog($blog_id); // reset post order. - $PostOrder->resetPosts(); + $PostOrder->setMenuOrderToZero(); }// endforeach; unset($PostOrder); } diff --git a/App/Models/PostOrder.php b/App/Models/PostOrder.php index fcf8d81..ac250c4 100644 --- a/App/Models/PostOrder.php +++ b/App/Models/PostOrder.php @@ -42,13 +42,13 @@ public function getLatestMenuOrder() /** - * Reset `menu_order` column on `posts` table to zero (its default value). + * Set `menu_order` column on `posts` table to zero (its default value). * * This will be use on uninstall or reset all posts order on multi-site admin settings. * * @global \wpdb $wpdb WordPress DB class. */ - public function resetPosts() + public function setMenuOrderToZero() { global $wpdb; @@ -79,7 +79,7 @@ public function resetPosts() unset($row); } unset($results); - }// resetPosts + }// setMenuOrderToZero /**