[wp-trac] [WordPress Trac] #27863: Move $content_width inside setup function in core-bundled Themes

WordPress Trac noreply at wordpress.org
Thu Apr 17 16:05:30 UTC 2014


#27863: Move $content_width inside setup function in core-bundled Themes
-------------------------+-----------------------------
 Reporter:  chipbennett  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Themes       |    Version:  3.9
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 For all core-bundled Themes (Twenty Ten through Twenty Fourteen), the
 Theme defines the `$content_width` global directly in `functions.php`,
 outside of any callbacks hooked into an explicit action.

 Each of the Themes has a setup function, hooked into `after_setup_theme`,
 that is the appropriate action for Themes to perform Theme-specific setup
 actions, including defining `$content_width`.

 With `$content_width` defined directly in `functions.php`, the action
 happens implicitly when `functions.php` is parsed, which makes the action
 more difficult to override explicitly via Child Theme or Plugin. Child
 Themes can override `$content_width` via similar implicit action, since
 the Child Theme `functions.php` is parsed before the template
 `functions.php`; but having an explicit action to target would be less
 fragile.

 Attached patches move `$content_width` definition inside
 `twenty{year}_setup()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27863>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list