[wp-trac] [WordPress Trac] #34747: Provide more flexibility for "You are customizing" text

WordPress Trac noreply at wordpress.org
Wed Mar 2 07:08:40 UTC 2016

#34747: Provide more flexibility for "You are customizing" text
 Reporter:  danielbachhuber  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Customize        |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:

Comment (by ryankienstra):

 '''Patch That Adds "Title" Filter'''

 Hi @westonruter,
 This latest
 patch] and identical [https://github.com/xwp/wordpress-
 develop/pull/143/files PR] may not be what you suggested. Could you let me
 know if they aren't?

 >As for overriding the title, that's a good question. For now probably the
 easiest is just to use JS to replace the elements and use different class
 names. If doing that, then you could also use JS to override the panel
 description, though this isn't the most elegant.

 My [https://github.com/xwp/wordpress-develop/pull/143/files PR] filters
 the Customizer title and description in [https://github.com/xwp/wordpress-
 develop/pull/143/files#diff-a325cc1f63ecc04fdb078079c6ec585bR136 wp-
 customize.php]. And it echoes them there, just
 admin/customize.php#L132 like before].

 If the title filter alters the title, I [https://github.com/xwp/wordpress-
 develop/pull/143/files#diff-a325cc1f63ecc04fdb078079c6ec585bR150 set a
 class] on the element to prevent the title from being replaced in
 controls.js#L3660 customize-controls.js]. This may not be what you had in
 mind with using "JS to replace the elements."

 I looked at ways to send the filtered title and description to
 controls.js#L3660 customize-controls.js]. But the entire panel is
 currently echoed in [https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/customize.php#L132 customize.php]. It looks like there would be 3
 variables that a PHP file would have to send to a JS file like
 58dfe22165ffd9650354f7bdd51002ecR3657 customize-controls.js]:

 $is_title_filtered // to disable Customizer settings from overriding any
 updates to Customizer title

 Since these variables are already produced in a .php file, I thought it
 might be cleanest to also output them in [https://github.com/xwp
 a325cc1f63ecc04fdb078079c6ec585bR136 wp-customize.php]. Instead of sending
 them to a JavaScript file to be added.

 Please let me know if you had something else in mind. Or if there's a
 cleaner way to do this.

Ticket URL: <https://core.trac.wordpress.org/ticket/34747#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list