[wp-trac] [WordPress Trac] #43531: $content_width and Add Media (+ twentyseverteen?)
WordPress Trac
noreply at wordpress.org
Mon Mar 12 20:07:39 UTC 2018
#43531: $content_width and Add Media (+ twentyseverteen?)
----------------------------+-----------------------------
Reporter: ChiefAlchemist | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9.4
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
I apologize in advance if this isn't a bug. However, I couldn't seem to
find any documentation on the expected behavior (e.g., there's nothing on
the codex page for the image_size_names_choose filter). None the less, it
certainly feels odd / awkward.
When adding an image (to a post / page), the size setting select (Add
Media > Attachment Display Setting > Size) doesn't feel quite right. I
understand the relationship between (global) $content_width and this
setting. That is, the <img> tag's width= is forced / maxed to the
$content_width (if the image is wider than the $content_width).
I see this happening for the size = large images, as well as any image
sizes I've added via add_image_size() that are too wide. However, it
(i.e., the forced max width=) doesn't happen to the size Medium when the
Medium width is set wider than the content width.
Perhaps this is intentional?
Theme was twentyseventeen. Unfortunately, I've haven't had time to try to
reproduce this on another theme. The size Medium was set to 800 x 800.
I'd like to suggest the Settings > Media page display the current
$content_width, as well as explain a bit, as well as link to a deeper
explanation. As it is, a user can select a theme, blindly set the image
sizes (not realizing who they actually map to the theme), and then be hit
with the experience (?) described above, AND have no idea why.
Truth be told, it took me too long to figure this out. Somehow I've
managed to avoid $content_width. Too many custom themes maybe? :)
Or am I just missing something about the intent of what otherwise feels
like a sloppy experience?
I hope this helps. TIA
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43531>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list