Consistently set taxnow/typenow and the current screen's post_type/taxnomy, whenever it can be detected. Allow WP_Screen::get() to accept a post type as a hook_name. Fixes issues with the meta box $page/$screen argument. fixes #19080. see #18785.

git-svn-id: https://develop.svn.wordpress.org/trunk@19097 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2011-10-31 21:28:17 +00:00
parent 5d0176b03e
commit d91bf70dd7
2 changed files with 22 additions and 22 deletions

View File

@@ -88,13 +88,13 @@ if ( isset($_GET['page']) ) {
$plugin_page = plugin_basename($plugin_page);
}
if ( isset($_GET['post_type']) )
$typenow = sanitize_key($_GET['post_type']);
if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) )
$typenow = $_REQUEST['post_type'];
else
$typenow = '';
if ( isset($_GET['taxonomy']) )
$taxnow = sanitize_key($_GET['taxonomy']);
if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) )
$taxnow = $_REQUEST['taxonomy'];
else
$taxnow = '';