Add New links when editing content. fixes #17499

git-svn-id: http://svn.automattic.com/wordpress/trunk@17962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2011-05-19 01:34:34 +00:00
parent 87d32ef07a
commit 188f57edfa
2 changed files with 3 additions and 1 deletions

View File

@ -195,7 +195,7 @@ require_once('./admin-header.php');
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<h2><?php echo esc_html( $title ); ?><?php if ( isset( $post_new_file ) ) : ?> <a href="<?php echo esc_url( $post_new_file ) ?>" class="add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a><?php endif; ?></h2>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>

View File

@ -161,12 +161,14 @@ case 'edit':
if ( 'post' == $post_type ) {
$parent_file = "edit.php";
$submenu_file = "edit.php";
$post_new_file = "post-new.php";
} else {
if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
$parent_file = $post_type_object->show_in_menu;
else
$parent_file = "edit.php?post_type=$post_type";
$submenu_file = "edit.php?post_type=$post_type";
$post_new_file = "post-new.php?post_type=$post_type";
}
if ( $last = wp_check_post_lock( $post->ID ) ) {