Menus: Add a Cancel link to the screen for creating a new menu.
The use case this helps the most is when there's only one menu and you click "create a new menu". In this case the Cancel link allows you to go back to the single existing menu. Props garrett-eclipse, audrasjb. Fixes #46367. Built from https://develop.svn.wordpress.org/trunk@47770 git-svn-id: http://core.svn.wordpress.org/trunk@47546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bf3296a9a0
commit
a0224a579d
|
@ -925,6 +925,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||
<div id="post-body">
|
||||
<div id="post-body-content" class="wp-clearfix">
|
||||
<?php if ( ! $add_new_screen ) : ?>
|
||||
|
||||
<?php
|
||||
$hide_style = '';
|
||||
if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
|
||||
|
@ -940,6 +941,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||
<div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>>
|
||||
<p><?php echo $starter_copy; ?></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {
|
||||
echo $edit_markup;
|
||||
|
@ -947,12 +949,15 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||
?>
|
||||
<ul class="menu" id="menu-to-edit"></ul>
|
||||
<?php } ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $add_new_screen ) : ?>
|
||||
<p class="post-body-plain" id="menu-name-desc"><?php _e( 'Give your menu a name, then click Create Menu.' ); ?></p>
|
||||
<?php if ( isset( $_GET['use-location'] ) ) : ?>
|
||||
<input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
|
@ -1014,7 +1019,13 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||
</div><!-- /#post-body -->
|
||||
<div id="nav-menu-footer">
|
||||
<div class="major-publishing-actions wp-clearfix">
|
||||
<?php if ( 0 != $menu_count && ! $add_new_screen ) : ?>
|
||||
<?php if ( $menu_count > 0 ) : ?>
|
||||
|
||||
<?php if ( $add_new_screen ) : ?>
|
||||
<span class="cancel-action">
|
||||
<a class="submitcancel cancellation menu-cancel" href="<?php echo esc_url( admin_url( 'nav-menus.php' ) ); ?>"><?php _e( 'Cancel' ); ?></a>
|
||||
</span><!-- END .cancel-action -->
|
||||
<?php else : ?>
|
||||
<span class="delete-action">
|
||||
<a class="submitdelete deletion menu-delete" href="
|
||||
<?php
|
||||
|
@ -1034,6 +1045,8 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||
"><?php _e( 'Delete Menu' ); ?></a>
|
||||
</span><!-- END .delete-action -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<div class="publishing-action">
|
||||
<?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'primary large menu-save', 'save_menu', false, array( 'id' => 'save_menu_footer' ) ); ?>
|
||||
</div><!-- END .publishing-action -->
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.5-alpha-47769';
|
||||
$wp_version = '5.5-alpha-47770';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue