Skip to content

Instantly share code, notes, and snippets.

@BrookeDot
Last active September 27, 2016 20:29
Show Gist options
  • Save BrookeDot/66075fcc3471ce104b77fc5fbb13feaf to your computer and use it in GitHub Desktop.
Save BrookeDot/66075fcc3471ce104b77fc5fbb13feaf to your computer and use it in GitHub Desktop.
Index: empty-blog.php
===================================================================
--- empty-blog.php (revision 1504006)
+++ empty-blog.php (working copy)
@@ -92,7 +92,11 @@
// Delete categories
if ( isset( $_POST['delete_categories'] ) && 1 == $_POST['delete_categories'] ) {
print "<h3>" . __( "Deleting categories." ) . "</h3>\n";
- $cats = get_all_category_ids();
+ $cats = get_terms( array(
+ 'taxonomy' => 'category',
+ 'hide_empty' => 0,
+ 'fields' => 'ids',
+ ) );
foreach( $cats as $cat ) {
$cat_name = get_cat_name( $cat );
wp_delete_category( $cat );
Index: readme.txt
===================================================================
--- readme.txt (revision 1504006)
+++ readme.txt (working copy)
@@ -1,9 +1,9 @@
=== Plugin Name ===
Contributors: dllh
Tags: admin, posts, pages, dev
-Requires at least: 3.0
-Tested up to: 4.1
-Stable tag: 0.7
+Requires at least: 4.5
+Tested up to: 4.6.1
+Stable tag: 0.8
License: GPLv2 or later
License URI: http://www.gnu.org/licensesgpl-2.0.html
@@ -30,6 +30,11 @@
Users must have the "Manage Options" capability.
== Changelog ==
+= 0.8 =
+* uses get_terms() instead of deprecated get_all_category_ids()
+* WordPress core verison bump 4.5
+* Tested with WordPress 4.6
+
= 0.7 =
* Minor style tweaks.
* Adds link deletion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment