Opened 7 years ago
Closed 7 years ago
#47536 closed defect (bug) (fixed)
More actions not aligned correctly
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.3 | Priority: | normal |
| Severity: | minor | Version: | 5.3 |
| Component: | Administration | Keywords: | needs-patch has-screenshots dev-feedback |
| Focuses: | Cc: |
Description
"Manage ..." has a leading space, see screenshot
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
This is a product of the unique HTML structure of that specific line. In the first list element, a
<div class="welcome-icon welcome-widgets-menus">wraps text containing multiple<a>tags. Therefore, the icon pseudo-element::beforefor that row is applied to the div.Conversely, the other lines on the
Next StepsandMore Actionssections contain only onea, and in those cases, the::beforeis applied to that element.Here's the relevant section from wp-admin/includes/dashboard.php, starting on line 1716:
<ul> <?php if ( current_theme_supports( 'widgets' ) || current_theme_supports( 'menus' ) ) : ?> <li><div class="welcome-icon welcome-widgets-menus"> <?php if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) { printf( __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ), admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' ) ); } elseif ( current_theme_supports( 'widgets' ) ) { echo '<a href="' . admin_url( 'widgets.php' ) . '">' . __( 'Manage widgets' ) . '</a>'; } else { echo '<a href="' . admin_url( 'nav-menus.php' ) . '">' . __( 'Manage menus' ) . '</a>'; } ?> </div></li> <?php endif; ?> <?php if ( current_user_can( 'manage_options' ) ) : ?> <li><?php printf( '<a href="%s" class="welcome-icon welcome-comments">' . __( 'Turn comments on or off' ) . '</a>', admin_url( 'options-discussion.php' ) ); ?></li> <?php endif; ?> <li><?php printf( '<a href="%s" class="welcome-icon welcome-learn-more">' . __( 'Learn more about getting started' ) . '</a>', __( 'https://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?></li> </ul>Coding Standards dictate that opening/closing PHP tags shall appear on their own lines. With CSS adding the
::beforepseudo-element for the icon to<div class="welcome-icon welcome-widgets-menus">, the whitespace created between lines 1717 and 1718 is rendered.Line 1726 and 1728 have PHP rendering singular
<a>tags and there's no whitespace because Coding Standards allow for single-line mixtures of HTML and PHP.Hopefully this breaks down the root cause of the issue. This first appeared from [42343] stemming from ticket #41057.