@@ -89,15 +89,15 @@ |
||
| 89 | 89 | |
| 90 | 90 | // Parse sections and find ones with icons. |
| 91 | 91 | foreach ( $sections as $section ) { |
| 92 | - if ( isset( $section['icon'] ) ) { |
|
| 93 | - $this->add_icon( $section['id'], $section['icon'], 'section' ); |
|
| 92 | + if ( isset( $section[ 'icon' ] ) ) { |
|
| 93 | + $this->add_icon( $section[ 'id' ], $section[ 'icon' ], 'section' ); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // Parse panels and find ones with icons. |
| 98 | 98 | foreach ( $panels as $panel ) { |
| 99 | - if ( isset( $panel['icon'] ) ) { |
|
| 100 | - $this->add_icon( $panel['id'], $panel['icon'], 'panel' ); |
|
| 99 | + if ( isset( $panel[ 'icon' ] ) ) { |
|
| 100 | + $this->add_icon( $panel[ 'id' ], $panel[ 'icon' ], 'panel' ); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function to_json() { |
| 36 | 36 | parent::to_json(); |
| 37 | 37 | |
| 38 | - $this->json['icons'] = Kirki_Helper::get_dashicons(); |
|
| 38 | + $this->json[ 'icons' ] = Kirki_Helper::get_dashicons(); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | |
| 38 | 38 | foreach ( $this->input_attrs as $attr => $value ) { |
| 39 | 39 | if ( 'style' !== $attr ) { |
| 40 | - $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
| 40 | + $this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
| 41 | 41 | continue; |
| 42 | 42 | } |
| 43 | - $this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" '; |
|
| 43 | + $this->json[ 'labelStyle' ] = 'style="' . esc_attr( $value ) . '" '; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | } |
@@ -39,14 +39,14 @@ |
||
| 39 | 39 | if ( is_array( $this->choices ) ) { |
| 40 | 40 | foreach ( $this->choices as $choice => $value ) { |
| 41 | 41 | if ( 'labels' !== $choice && true === $value ) { |
| 42 | - $this->json['choices'][ $choice ] = true; |
|
| 42 | + $this->json[ 'choices' ][ $choice ] = true; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - if ( is_array( $this->json['default'] ) ) { |
|
| 47 | - foreach ( $this->json['default'] as $key => $value ) { |
|
| 48 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
| 49 | - $this->json['value'][ $key ] = $value; |
|
| 46 | + if ( is_array( $this->json[ 'default' ] ) ) { |
|
| 47 | + foreach ( $this->json[ 'default' ] as $key => $value ) { |
|
| 48 | + if ( isset( $this->json[ 'choices' ][ $key ] ) && ! isset( $this->json[ 'value' ][ $key ] ) ) { |
|
| 49 | + $this->json[ 'value' ][ $key ] = $value; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | public function to_json() { |
| 44 | 44 | parent::to_json(); |
| 45 | 45 | |
| 46 | - $this->json['alpha'] = (bool) $this->alpha; |
|
| 46 | + $this->json[ 'alpha' ] = (bool) $this->alpha; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | parent::to_json(); |
| 39 | 39 | |
| 40 | 40 | // If no palette has been defined, use Material Design Palette. |
| 41 | - if ( ! isset( $this->json['choices']['colors'] ) || empty( $this->json['choices']['colors'] ) ) { |
|
| 42 | - $this->json['choices']['colors'] = Kirki_Helper::get_material_design_colors( 'primary' ); |
|
| 41 | + if ( ! isset( $this->json[ 'choices' ][ 'colors' ] ) || empty( $this->json[ 'choices' ][ 'colors' ] ) ) { |
|
| 42 | + $this->json[ 'choices' ][ 'colors' ] = Kirki_Helper::get_material_design_colors( 'primary' ); |
|
| 43 | 43 | } |
| 44 | - if ( ! isset( $this->json['choices']['size'] ) || empty( $this->json['choices']['size'] ) ) { |
|
| 45 | - $this->json['choices']['size'] = 20; |
|
| 44 | + if ( ! isset( $this->json[ 'choices' ][ 'size' ] ) || empty( $this->json[ 'choices' ][ 'size' ] ) ) { |
|
| 45 | + $this->json[ 'choices' ][ 'size' ] = 20; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | if ( ! is_array( $this->choices ) ) { |
| 25 | 25 | $this->choices = array(); |
| 26 | 26 | } |
| 27 | - $this->choices['element'] = 'input'; |
|
| 28 | - $this->choices['type'] = 'text'; |
|
| 27 | + $this->choices[ 'element' ] = 'input'; |
|
| 28 | + $this->choices[ 'type' ] = 'text'; |
|
| 29 | 29 | |
| 30 | 30 | } |
| 31 | 31 | |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | // Set a default class name. |
| 67 | 67 | $class_name = 'WP_Customize_Control'; |
| 68 | 68 | // Get the classname from the array of control classnames. |
| 69 | - if ( array_key_exists( $args['type'], self::$control_types ) ) { |
|
| 70 | - $class_name = self::$control_types[ $args['type'] ]; |
|
| 69 | + if ( array_key_exists( $args[ 'type' ], self::$control_types ) ) { |
|
| 70 | + $class_name = self::$control_types[ $args[ 'type' ] ]; |
|
| 71 | 71 | } |
| 72 | 72 | return $class_name; |
| 73 | 73 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | // Get the name of the class we're going to use. |
| 85 | 85 | $class_name = $this->get_control_class_name( $args ); |
| 86 | 86 | // Add the control. |
| 87 | - $this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) ); |
|
| 87 | + $this->wp_customize->add_control( new $class_name( $this->wp_customize, $args[ 'settings' ], $args ) ); |
|
| 88 | 88 | |
| 89 | 89 | } |
| 90 | 90 | |
@@ -97,15 +97,15 @@ discard block |
||
| 97 | 97 | unset( $value[ $row_id ][ $subfield_id ] ); |
| 98 | 98 | } |
| 99 | 99 | // Get the subfield-type. |
| 100 | - if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) { |
|
| 100 | + if ( ! isset( $this->fields[ $subfield_id ][ 'type' ] ) ) { |
|
| 101 | 101 | continue; |
| 102 | 102 | } |
| 103 | - $subfield_type = $this->fields[ $subfield_id ]['type']; |
|
| 103 | + $subfield_type = $this->fields[ $subfield_id ][ 'type' ]; |
|
| 104 | 104 | |
| 105 | 105 | // Allow using a sanitize-callback on a per-field basis. |
| 106 | - if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) { |
|
| 106 | + if ( isset( $this->fields[ $subfield_id ][ 'sanitize_callback' ] ) ) { |
|
| 107 | 107 | |
| 108 | - $subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value ); |
|
| 108 | + $subfield_value = call_user_func( $this->fields[ $subfield_id ][ 'sanitize_callback' ], $subfield_value ); |
|
| 109 | 109 | |
| 110 | 110 | } else { |
| 111 | 111 | |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | $subfield_value = (bool) $subfield_value; |
| 143 | 143 | break; |
| 144 | 144 | case 'select': |
| 145 | - if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) { |
|
| 146 | - if ( true === $this->fields[ $subfield_id ]['multiple'] ) { |
|
| 145 | + if ( isset( $this->fields[ $subfield_id ][ 'multiple' ] ) ) { |
|
| 146 | + if ( true === $this->fields[ $subfield_id ][ 'multiple' ] ) { |
|
| 147 | 147 | $multiple = 2; |
| 148 | 148 | } |
| 149 | - $multiple = (int) $this->fields[ $subfield_id ]['multiple']; |
|
| 149 | + $multiple = (int) $this->fields[ $subfield_id ][ 'multiple' ]; |
|
| 150 | 150 | if ( 1 < $multiple ) { |
| 151 | 151 | $subfield_value = (array) $subfield_value; |
| 152 | 152 | foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) { |