diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 5fe9ef6ff4..b6c6c1ff25 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -11,7 +11,25 @@ require_once('admin.php'); $title = __('Categories'); -wp_reset_vars( array('action') ); +wp_reset_vars( array('action', 'taxonomy', 'post_type') ); + +if ( empty($taxonomy) ) + $taxonomy = 'category'; + +if ( !is_taxonomy($taxonomy) ) + wp_die(__('Invalid taxonomy')); + +if ( empty($post_type) || !in_array( $post_type, get_post_types( array('_show' => true) ) ) ) + $post_type = 'post'; + +if ( 'post' != $post_type ) { + $parent_file = "edit.php?post_type=$post_type"; + $submenu_file = "categories.php?taxonomy=$taxonomy&post_type=$post_type"; +} else { + $parent_file = 'edit.php'; + $submenu_file = "categories.php?taxonomy=$taxonomy"; +} + if ( isset( $_GET['action'] ) && isset($_GET['delete']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) ) $action = 'bulk-delete'; @@ -135,7 +153,7 @@ $messages[5] = __('Category not updated.');