Allow the "Add New" URL on post edit screens to be filtered via `admin_url()`. props SergeyBiryukov, jeremyfelt, c3mdigital. fixes #18504.
git-svn-id: https://develop.svn.wordpress.org/trunk@25527 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
76cb40634b
commit
afe1b7a6c9
|
@ -315,7 +315,7 @@ require_once('./admin-header.php');
|
||||||
<h2><?php
|
<h2><?php
|
||||||
echo esc_html( $title );
|
echo esc_html( $title );
|
||||||
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
|
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
|
||||||
echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
||||||
?></h2>
|
?></h2>
|
||||||
<?php if ( $notice ) : ?>
|
<?php if ( $notice ) : ?>
|
||||||
<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
|
<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
|
||||||
|
|
|
@ -231,7 +231,7 @@ require_once('./admin-header.php');
|
||||||
<h2><?php
|
<h2><?php
|
||||||
echo esc_html( $post_type_object->labels->name );
|
echo esc_html( $post_type_object->labels->name );
|
||||||
if ( current_user_can( $post_type_object->cap->create_posts ) )
|
if ( current_user_can( $post_type_object->cap->create_posts ) )
|
||||||
echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
||||||
if ( ! empty( $_REQUEST['s'] ) )
|
if ( ! empty( $_REQUEST['s'] ) )
|
||||||
printf( ' <span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() );
|
printf( ' <span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() );
|
||||||
?></h2>
|
?></h2>
|
||||||
|
|
Loading…
Reference in New Issue