Opened 12 years ago
Closed 12 years ago
#23824 closed defect (bug) (wontfix)
Twenty Thirteen: Correct the hook on which twentythirteen_content_width is fired
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | |
Focuses: | Cc: |
Description
Using template_redirect
for content width readjustment works fine on the front end, but it fails in the admin.
Change the hook on which twentythirteen_content_width
fires to after_setup_theme
instead so that recalculation works on both ends of a user's blog.
Attachments (1)
Change History (15)
#2
@
12 years ago
after_setup_theme
is too early to dynamically set the value of $content_width
for Twenty Thirteen. twentythirteen_content_width()
calls two conditional functions which always return false if used before the query is processed these functions are has_post_format()
and is_attachment()
.
#4
in reply to:
↑ 1
;
follow-ups:
↓ 5
↓ 7
@
12 years ago
Replying to alexvorn2:
why you need width for the admin?
$content_width
also controls the content width in the TinyMCE editor so you that it can accurately portray how it will be displayed on the front end.
#5
in reply to:
↑ 4
@
12 years ago
Replying to DrewAPicture:
Replying to alexvorn2:
why you need width for the admin?
$content_width
also controls the content width in the TinyMCE editor so you that it can accurately portray how it will be displayed on the front end.
It can also be used to control things like thumbnail size (we do this on WordPress.com).
#6
@
12 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 3.6
Used also in Media, when you select the size to insert an image to a post or page.
#7
in reply to:
↑ 4
@
12 years ago
Replying to DrewAPicture:
Replying to alexvorn2:
why you need width for the admin?
$content_width
also controls the content width in the TinyMCE editor so you that it can accurately portray how it will be displayed on the front end.
For that we use editor-style.css, no? :)
#8
@
12 years ago
- Keywords reporter-feedback added
Is there a specific example where this fails in admin with Twenty Thirteen? Just want to be able to test and make a smart choice.
#9
@
12 years ago
- Go to new post
- change it to image post format
- save post
- add media
- full size should be set to 724px but it's set to 604px
Definitely okay with leaving the theme as-is due to mfields' comments above.
#10
@
12 years ago
obenland also made a good point in IRC:
post formats will use the new API - no content-width necessary
So if has_post_format( 'image' ) || has_post_format( 'video' )
is eventually removed from twentythirteen_content_width
due to post format API changes then leaving template_redirect
should be fine, since we only care about an attachment's content width on the front when it's being viewed.
#11
@
12 years ago
Discussion: https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2013-03-21&sort=asc#m579207
Sorry to comment-bomb. My Trac mojo is off today.
why you need width for the admin?