[wp-trac] [WordPress Trac] #21256: New theme feature - add_theme_support( 'content-width', $defaults )

WordPress Trac noreply at wordpress.org
Tue Feb 26 03:56:06 UTC 2013


#21256: New theme feature - add_theme_support( 'content-width', $defaults )
--------------------------------------+------------------------------
 Reporter:  ramiy                     |       Owner:
     Type:  feature request           |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Themes                    |     Version:  3.4.1
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback 2nd-opinion  |
--------------------------------------+------------------------------

Comment (by nacin):

 I don't know how beneficial this is when there is an increasing desire to
 modify content_width based on certain contexts, like a particular page
 template.

 I'm actually a bit concerned about modifying content_width on the fly,
 because of the potential side effects it has. It is good for only three
 things:
  * Embed width — wp_embed_defaults()
  * What images are scaled down to when inserted into the editor —
 image_constrain_size_for_editor()
  * What the fullscreen editor uses as a default width — WP_Editor's
 wp_fullscreen_html()

 Only the first two are important. The problem is that both are used in an
 admin context, so Twenty Twelve's hook into template_redirect
 accomplishes, as far as I can tell, nothing. (Unless the embed isn't
 cached by the time the front page is loaded.) Same for Twenty Thirteen.

 Turning this into theme support seems okay, but it seems like there needs
 to be a getter function (a la #17130) plus a filter — but done in a way
 that provides context and actually works.

 To toss out another use case, Twenty Thirteen is seeing a need to have a
 "content width" being different from the "embed width". Realistically,
 this isn't a "content width" but an "embed width" setting, anyway — CSS is
 what has an effect on the content itself, not this global.

 It just seems the whole idea of $content_width needs a re-think.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21256#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list