Skip to content

Commit 0c97fcf

Browse files
committed
Menus: Remove floats from custom links section in the Nav Menus screen.
With the new admin design, there were some issues with floating elements in the custom links section of the classic Menu screen. This changeset simplifies the CSS implementation by removing floats and `wp-clearfix` classes from some elements in favor of a more robust implementation based on flex positionning. Props audrasjb, huzaifaalmesbah, shailu25, nikunj8866, joedolson, khushi1501, ozgursar. Fixes #64692. See #64308. Built from https://develop.svn.wordpress.org/trunk@62097 git-svn-id: http://core.svn.wordpress.org/trunk@61379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 94ac2d4 commit 0c97fcf

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

wp-admin/css/nav-menus-rtl.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,17 +376,11 @@ input.bulk-select-switcher:focus + .bulk-select-button-label {
376376
}
377377

378378
/* Add Menu Item Boxes */
379-
.postbox .howto input,
380-
.customlinkdiv .menu-item-textbox,
381-
.customlinkdiv .error-message {
379+
.postbox .howto input {
382380
width: 180px;
383381
float: left;
384382
}
385383

386-
.customlinkdiv .error-message {
387-
clear: left;
388-
}
389-
390384
.accordion-container .outer-border {
391385
margin: 0;
392386
}
@@ -478,7 +472,10 @@ input.bulk-select-switcher:focus + .bulk-select-button-label {
478472
width: 180px;
479473
}
480474

481-
.customlinkdiv label,
475+
.customlinkdiv .menu-item-textbox {
476+
width: 100%;
477+
}
478+
482479
.nav-menus-php .howto span {
483480
float: right;
484481
margin-top: 6px;
@@ -877,6 +874,10 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
877874
justify-content: space-between;
878875
}
879876

877+
.button-controls-customlinkdiv {
878+
justify-content: flex-end;
879+
}
880+
880881
/* =Media Queries
881882
-------------------------------------------------------------- */
882883

wp-admin/css/nav-menus-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/nav-menus.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,11 @@ input.bulk-select-switcher:focus + .bulk-select-button-label {
375375
}
376376

377377
/* Add Menu Item Boxes */
378-
.postbox .howto input,
379-
.customlinkdiv .menu-item-textbox,
380-
.customlinkdiv .error-message {
378+
.postbox .howto input {
381379
width: 180px;
382380
float: right;
383381
}
384382

385-
.customlinkdiv .error-message {
386-
clear: right;
387-
}
388-
389383
.accordion-container .outer-border {
390384
margin: 0;
391385
}
@@ -477,7 +471,10 @@ input.bulk-select-switcher:focus + .bulk-select-button-label {
477471
width: 180px;
478472
}
479473

480-
.customlinkdiv label,
474+
.customlinkdiv .menu-item-textbox {
475+
width: 100%;
476+
}
477+
481478
.nav-menus-php .howto span {
482479
float: left;
483480
margin-top: 6px;
@@ -876,6 +873,10 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
876873
justify-content: space-between;
877874
}
878875

876+
.button-controls-customlinkdiv {
877+
justify-content: flex-end;
878+
}
879+
879880
/* =Media Queries
880881
-------------------------------------------------------------- */
881882

wp-admin/css/nav-menus.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/includes/nav-menu.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ function wp_nav_menu_item_link_meta_box() {
363363
<div class="customlinkdiv" id="customlinkdiv">
364364
<input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
365365
<p id="menu-item-url-wrap" class="wp-clearfix">
366-
<label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
366+
<label for="custom-menu-item-url"><?php _e( 'URL' ); ?></label>
367367
<input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]"
368368
type="text"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
369369
class="code menu-item-textbox form-required" placeholder="https://"
@@ -372,14 +372,14 @@ class="code menu-item-textbox form-required" placeholder="https://"
372372
</p>
373373

374374
<p id="menu-item-name-wrap" class="wp-clearfix">
375-
<label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
375+
<label for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label>
376376
<input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]"
377377
type="text"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
378378
class="regular-text menu-item-textbox"
379379
/>
380380
</p>
381381

382-
<p class="button-controls wp-clearfix">
382+
<p class="button-controls button-controls-customlinkdiv">
383383
<span class="add-to-menu">
384384
<input id="submit-customlinkdiv" name="add-custom-menu-item"
385385
type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
@@ -820,7 +820,7 @@ class="categorychecklist form-no-clear"
820820
<?php endif; ?>
821821
</div><!-- /.tabs-panel -->
822822

823-
<p class="button-controls wp-clearfix" data-items-type="<?php echo esc_attr( "posttype-{$post_type_name}" ); ?>">
823+
<p class="button-controls" data-items-type="<?php echo esc_attr( "posttype-{$post_type_name}" ); ?>">
824824
<span class="list-controls hide-if-no-js">
825825
<input type="checkbox"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
826826
id="<?php echo esc_attr( $tab_name ); ?>" class="select-all"
@@ -1115,7 +1115,7 @@ class="categorychecklist form-no-clear"
11151115
</ul>
11161116
</div><!-- /.tabs-panel -->
11171117

1118-
<p class="button-controls wp-clearfix" data-items-type="<?php echo esc_attr( "taxonomy-{$taxonomy_name}" ); ?>">
1118+
<p class="button-controls" data-items-type="<?php echo esc_attr( "taxonomy-{$taxonomy_name}" ); ?>">
11191119
<span class="list-controls hide-if-no-js">
11201120
<input type="checkbox"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?>
11211121
id="<?php echo esc_attr( $tab_name ); ?>" class="select-all"

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-beta6-62096';
19+
$wp_version = '7.0-beta6-62097';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)