[wp-trac] [WordPress Trac] #19910: Appearance Improvements: Theme Customization Frame
WordPress Trac
wp-trac at lists.automattic.com
Wed Feb 29 23:14:24 UTC 2012
#19910: Appearance Improvements: Theme Customization Frame
----------------------------+--------------------------
Reporter: koopersmith | Owner: koopersmith
Type: task (blessed) | Status: accepted
Priority: normal | Milestone: 3.4
Component: Themes | Version: 3.3.1
Severity: normal | Resolution:
Keywords: |
----------------------------+--------------------------
Comment (by nacin):
Replying to [comment:27 cais]:
> Starting at line 248 is the `desk_mess_mirrored_setup` function that is
used with the 'after_theme_setup' hook, while inside that function
starting at line 365 is the 'register_nav_menu' function call which uses
the 'init' hook ...
Nesting function calls in PHP is not very intuitive or easy to read, and
since they all end up in global scope, it's functionally the same.
Koopersmith is correct when he says "If I'm reading this correctly, is the
only difference that the nav menu registration is attached to init instead
of after_setup_theme?" That is exactly what ends up happening here.
> ... the more I look at this the more I think using the 'init' hook this
way is not correct and could just be awkward code catching up to me.
Although I have not seen any issues with this "menu code" since I
implemented it back around WP 3.1.
Correct. init is the wrong hook. after_setup_theme is the only valid hook
to use for custom menus, custom backgrounds, custom headers, post
thumbnails, etc. The init hook does work in those cases, nonetheless.
[20055] should consider wp_loaded — init should probably be given a chance
to finish.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19910#comment:30>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list