Administration: Restore the full-width upload folder row on Settings > Media - #13322
Administration: Restore the full-width upload folder row on Settings > Media#13322dknauss wants to merge 1 commit into
Conversation
…> Media.
The "Organize my uploads into month- and year-based folders" row spanned both
columns unconditionally until [40823] moved it inside the upload-path
conditional in order to change its `th` to a `td`, and carried `colspan="2"`
onto only the editable-paths branch.
On the `else` branch — what a site with default upload paths gets — the cell
has no colspan. With no fields registered the table has one column and the cell
fills it, so nothing looks wrong. Any field added through the
`do_settings_fields( 'media', 'uploads' )` call on the next line gives the table
a second column, `.form-table th { width: 200px }` claims the first, and the
core label wraps onto three lines.
Closing the conditional above the row restores the single unconditional cell
while keeping the `td`/`td-full` markup [40823] introduced. Rendering is
unchanged when no fields are registered, since `colspan="2"` on a lone cell in a
one-column table spans what it already spanned.
See #51190.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The props line above credits only me. imath reported this on #51190, worked out the cause, and attached the first patch — this PR takes a different route to the same fix, but the diagnosis is theirs. For SVN: |
Trac ticket: https://core.trac.wordpress.org/ticket/51190
Problem
On Settings > Media, "Organize my uploads into month- and year-based folders" wraps onto three lines as soon as any plugin registers a field in the
uploadssettings section.Cause
The row spanned both columns unconditionally until [40823] (#37004, HTML validation fixes) moved it inside the upload-path conditional in order to change its
thto atd. That carriedcolspan="2"onto the editable-paths branch only:The
elsebranch is what a site with default upload paths gets. With no fields registered the table has one column and the cell fills it, so nothing looks wrong. Thedo_settings_fields( 'media', 'uploads' )call on the next line invites a second column, and once anything takes it,.form-table th { width: 200px }claims the first and the core label wraps.forms.cssdates the change from the other side:.form-table th.th-full, /* Not used by core. Back-compat for pre-4.8 */.Fix
Close the conditional above the row and restore the single unconditional cell, keeping the
td/td-fullmarkup [40823] introduced.Measured at a 1238px content width:
colspan="2"colspan="2"The first two rows are identical because
colspan="2"on a lone cell in a one-column table spans what it already spanned, so no check for registered fields is needed and rendering is unchanged for sites without them.Testing instructions
upload_pathandupload_url_pathare at their defaults, so the paths are locked (the common case).wp-content/mu-plugins/:Props imath for the report and diagnosis.