Add post_type inputs. Fix submenu highlighting. Props dd32. see #9674

git-svn-id: http://svn.automattic.com/wordpress/trunk@12683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-01-10 01:24:56 +00:00
parent 25e152a58b
commit 2ff7f83b99
1 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ require_once('admin.php');
$title = __('Tags'); $title = __('Tags');
wp_reset_vars( array('action', 'tag', 'taxonomy') ); wp_reset_vars( array('action', 'tag', 'taxonomy', 'post_type') );
if ( empty($taxonomy) ) if ( empty($taxonomy) )
$taxonomy = 'post_tag'; $taxonomy = 'post_tag';
@ -19,14 +19,12 @@ if ( empty($taxonomy) )
if ( !is_taxonomy($taxonomy) ) if ( !is_taxonomy($taxonomy) )
wp_die(__('Invalid taxonomy')); wp_die(__('Invalid taxonomy'));
if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('_show' => true) ) ) ) if ( empty($post_type) || !in_array( $post_type, get_post_types( array('_show' => true) ) ) )
$post_type = $_GET['post_type'];
else
$post_type = 'post'; $post_type = 'post';
if ( 'post' != $post_type ) { if ( 'post' != $post_type ) {
$parent_file = "edit.php?post_type=$post_type"; $parent_file = "edit.php?post_type=$post_type";
$submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type"; $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type";
} else { } else {
$parent_file = 'edit.php'; $parent_file = 'edit.php';
$submenu_file = "edit-tags.php?taxonomy=$taxonomy"; $submenu_file = "edit-tags.php?taxonomy=$taxonomy";
@ -162,7 +160,7 @@ $messages[6] = __('Tags deleted.'); ?>
<div class="wrap nosubsub"> <div class="wrap nosubsub">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); <h2><?php echo esc_html( $title );
if ( isset($_GET['s']) && $_GET['s'] ) if ( !empty($_GET['s']) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
</h2> </h2>
@ -174,6 +172,7 @@ endif; ?>
<form class="search-form" action="" method="get"> <form class="search-form" action="" method="get">
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
<p class="search-box"> <p class="search-box">
<label class="screen-reader-text" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label> <label class="screen-reader-text" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label>
<input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />
@ -188,6 +187,7 @@ endif; ?>
<div class="col-wrap"> <div class="col-wrap">
<form id="posts-filter" action="" method="get"> <form id="posts-filter" action="" method="get">
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
<div class="tablenav"> <div class="tablenav">
<?php <?php
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0; $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;