mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
Theme Customizer: Sanitize selectors by transforming square brackets into dashes. see #19910.
This both better conforms to the CSS spec and prevents bugs from occurring in JavaScript selector engines. git-svn-id: http://svn.automattic.com/wordpress/trunk@20299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e6acfbf233
commit
b41d074b1b
@ -145,7 +145,7 @@ class WP_Customize_Control {
|
|||||||
* @since 3.4.0
|
* @since 3.4.0
|
||||||
*/
|
*/
|
||||||
protected function render() {
|
protected function render() {
|
||||||
$id = 'customize-control-' . $this->id;
|
$id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
|
||||||
$class = 'customize-control customize-control-' . $this->type;
|
$class = 'customize-control customize-control-' . $this->type;
|
||||||
|
|
||||||
$style = '';
|
$style = '';
|
||||||
|
@ -48,7 +48,8 @@
|
|||||||
$.extend( this, options || {} );
|
$.extend( this, options || {} );
|
||||||
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.container = $( '#customize-control-' + id );
|
this.selector = '#customize-control-' + id.replace( ']', '' ).replace( '[', '-' );
|
||||||
|
this.container = $( this.selector );
|
||||||
|
|
||||||
settings = $.map( this.params.settings, function( value ) {
|
settings = $.map( this.params.settings, function( value ) {
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
Reference in New Issue
Block a user