Skip to content

Commit afe1b7a

Browse files
committed
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
1 parent 76cb406 commit afe1b7a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-admin/edit-form-advanced.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
<h2><?php
316316
echo esc_html( $title );
317317
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
318-
echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
318+
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
319319
?></h2>
320320
<?php if ( $notice ) : ?>
321321
<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>

src/wp-admin/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
<h2><?php
232232
echo esc_html( $post_type_object->labels->name );
233233
if ( current_user_can( $post_type_object->cap->create_posts ) )
234-
echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
234+
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
235235
if ( ! empty( $_REQUEST['s'] ) )
236236
printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
237237
?></h2>

0 commit comments

Comments
 (0)