@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @return mixed |
| 34 | 34 | */ |
| 35 | 35 | protected function get_root_value( $default = null ) { |
| 36 | - return get_site_option( $this->id_data['base'], $default ); |
|
| 36 | + return get_site_option( $this->id_data[ 'base' ], $default ); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @return bool Whether the multidimensional root was updated successfully. |
| 46 | 46 | */ |
| 47 | 47 | protected function set_root_value( $value ) { |
| 48 | - return update_site_option( $this->id_data['base'], $value ); |
|
| 48 | + return update_site_option( $this->id_data[ 'base' ], $value ); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | public static function add_module( $module ) { |
| 105 | 105 | |
| 106 | 106 | if ( ! in_array( $module, self::$modules, true ) ) { |
| 107 | - self::$modules[] = $module; |
|
| 107 | + self::$modules[ ] = $module; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | } |
@@ -46,12 +46,12 @@ |
||
| 46 | 46 | public function add_panel( $args ) { |
| 47 | 47 | global $wp_customize; |
| 48 | 48 | |
| 49 | - if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) { |
|
| 50 | - $args['type'] = 'default'; |
|
| 49 | + if ( ! isset( $args[ 'type' ] ) || ! array_key_exists( $args[ 'type' ], $this->panel_types ) ) { |
|
| 50 | + $args[ 'type' ] = 'default'; |
|
| 51 | 51 | } |
| 52 | - $panel_classname = $this->panel_types[ $args['type'] ]; |
|
| 52 | + $panel_classname = $this->panel_types[ $args[ 'type' ] ]; |
|
| 53 | 53 | |
| 54 | - $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) ); |
|
| 54 | + $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args[ 'id' ] ), $args ) ); |
|
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | // Echo the styles. |
| 21 | 21 | $configs = Kirki::$config; |
| 22 | 22 | foreach ( $configs as $config_id => $args ) { |
| 23 | - if ( true === $args['disable_output'] ) { |
|
| 23 | + if ( true === $args[ 'disable_output' ] ) { |
|
| 24 | 24 | continue; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | $css = ''; |
| 37 | 37 | if ( ! empty( Kirki::$sections ) ) { |
| 38 | 38 | foreach ( Kirki::$sections as $section_args ) { |
| 39 | - if ( isset( $section_args['id'] ) && isset( $section_args['type'] ) && 'outer' === $section_args['type'] || 'kirki-outer' === $section_args['type'] ) { |
|
| 40 | - $css .= '#customize-theme-controls li#accordion-section-' . $section_args['id'] . '{display:list-item!important;}'; |
|
| 39 | + if ( isset( $section_args[ 'id' ] ) && isset( $section_args[ 'type' ] ) && 'outer' === $section_args[ 'type' ] || 'kirki-outer' === $section_args[ 'type' ] ) { |
|
| 40 | + $css .= '#customize-theme-controls li#accordion-section-' . $section_args[ 'id' ] . '{display:list-item!important;}'; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $family = $this->value; |
| 28 | 28 | $backup = ''; |
| 29 | - if ( is_array( $this->value ) && isset( $this->value[0] ) && isset( $this->value[1] ) ) { |
|
| 30 | - $family = $this->value[0]; |
|
| 31 | - $backup = $this->value[1]; |
|
| 29 | + if ( is_array( $this->value ) && isset( $this->value[ 0 ] ) && isset( $this->value[ 1 ] ) ) { |
|
| 30 | + $family = $this->value[ 0 ]; |
|
| 31 | + $backup = $this->value[ 1 ]; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // Make sure the value is a string. |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | // Add backup font. |
| 44 | 44 | if ( Kirki_Fonts::is_google_font( $family ) ) { |
| 45 | 45 | |
| 46 | - if ( '' === $backup && isset( $google_fonts_array[ $family ] ) && isset( $backup_fonts[ $google_fonts_array[ $family ]['category'] ] ) ) { |
|
| 47 | - $backup = $backup_fonts[ $google_fonts_array[ $family ]['category'] ]; |
|
| 46 | + if ( '' === $backup && isset( $google_fonts_array[ $family ] ) && isset( $backup_fonts[ $google_fonts_array[ $family ][ 'category' ] ] ) ) { |
|
| 47 | + $backup = $backup_fonts[ $google_fonts_array[ $family ][ 'category' ] ]; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Add double quotes if needed. |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | if ( false !== strpos( $this->value, ' ' ) ) { |
| 43 | 43 | $xy = explode( ' ', $this->value ); |
| 44 | 44 | |
| 45 | - $x = trim( $xy[0] ); |
|
| 46 | - $y = trim( $xy[1] ); |
|
| 45 | + $x = trim( $xy[ 0 ] ); |
|
| 46 | + $y = trim( $xy[ 1 ] ); |
|
| 47 | 47 | |
| 48 | 48 | // If x is not left/center/right, we need to sanitize it. |
| 49 | 49 | if ( ! in_array( $x, $x_dimensions, true ) ) { |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | protected function process_value() { |
| 23 | 23 | |
| 24 | - if ( is_array( $this->value ) && isset( $this->value['url'] ) ) { |
|
| 25 | - $this->value = $this->value['url']; |
|
| 24 | + if ( is_array( $this->value ) && isset( $this->value[ 'url' ] ) ) { |
|
| 25 | + $this->value = $this->value[ 'url' ]; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) { |
@@ -26,28 +26,28 @@ |
||
| 26 | 26 | foreach ( $value as $key => $sub_value ) { |
| 27 | 27 | |
| 28 | 28 | // If "element" is not defined, there's no reason to continue. |
| 29 | - if ( ! isset( $output['element'] ) ) { |
|
| 29 | + if ( ! isset( $output[ 'element' ] ) ) { |
|
| 30 | 30 | continue; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | // If the "choice" is not the same as the $key in our loop, there's no reason to proceed. |
| 34 | - if ( isset( $output['choice'] ) && $key !== $output['choice'] ) { |
|
| 34 | + if ( isset( $output[ 'choice' ] ) && $key !== $output[ 'choice' ] ) { |
|
| 35 | 35 | continue; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // If "property" is not defined, fallback to the $key. |
| 39 | - $property = ( ! isset( $output['property'] ) || empty( $output['property'] ) ) ? $key : $output['property']; |
|
| 39 | + $property = ( ! isset( $output[ 'property' ] ) || empty( $output[ 'property' ] ) ) ? $key : $output[ 'property' ]; |
|
| 40 | 40 | |
| 41 | 41 | // If "media_query" is not defined, use "global". |
| 42 | - if ( ! isset( $output['media_query'] ) || empty( $output['media_query'] ) ) { |
|
| 43 | - $output['media_query'] = 'global'; |
|
| 42 | + if ( ! isset( $output[ 'media_query' ] ) || empty( $output[ 'media_query' ] ) ) { |
|
| 43 | + $output[ 'media_query' ] = 'global'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // If "suffix" is defined, add it to the value. |
| 47 | - $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
| 47 | + $output[ 'suffix' ] = ( isset( $output[ 'suffix' ] ) ) ? $output[ 'suffix' ] : ''; |
|
| 48 | 48 | |
| 49 | 49 | // Create the styles. |
| 50 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value . $output['suffix']; |
|
| 50 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $sub_value . $output[ 'suffix' ]; |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | } |