[wp-trac] [WordPress Trac] #19910: Appearance Improvements: Theme Customization Frame

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 26 19:56:20 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:8 azaozz]:
 > Some initial thoughts about [19995]:

 I handled the merge of [19995] into core (koopersmith advised, then
 committed), so I can speak to these decisions.

 > This code can't run on the front-end, wouldn't it be better to be in wp-
 admin, not in wp-content.

 Yes it can. And in fact, it does, due to how the preview iframe works.
 There is no actual harm to placing JS in wp-includes over wp-admin. The
 rule of thumb I have used is that if it is a library of sorts, or
 decoupled nicely to the admin, or something that could be employed on the
 frontend (like pointers), it should go into wp-includes. The only things
 that should go into wp-admin is code intrinsically tied to the admin
 interface.

 > Why do we need another JS framework on top of jQuery to handle this? It
 only makes the code harder to read/understand, brings a lot of complexity
 and a lot of unneeded features (for example how many instances of the
 classes and subclasses would we need to show a preview?).

 There is not another framework here, nor is there a whole lot of
 complexity. (I was able to understand what was going on.) I cover the
 breakdown of JS files.

 > Wouldn't it be better to reduce the number of files? As far as I see
 customize-loader can be added to an existing JS file and customize-base,
 customize-controls and customize-preview can be merged into one file. Same
 with the four new php files and two css files.

 For the JS files, no. They are loaded in different places. customize-
 loader.js handles the ability to load the customizer. customize-controls
 gets loaded in the frame that handles the controls. customize-preview gets
 loaded in the preview iframe. customize-base is a shared base class of
 both customize-preview and customize-controls. As they are nicely
 decoupled, they should remain separate.

 For the PHP files, no. Individual classes belong in separate files. The
 fourth file, customize-controls.php, is a special file that is included to
 handle the controls after WP is hijacked.

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


More information about the wp-trac mailing list