@@ -217,7 +217,8 @@ |
||
| 217 | 217 | } |
| 218 | 218 | // If 'choice' is defined check for sub-values too. |
| 219 | 219 | // Fixes https://github.com/aristath/kirki/issues/1416. |
| 220 | - if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison |
|
| 220 | + if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { |
|
| 221 | +// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison |
|
| 221 | 222 | $skip = true; |
| 222 | 223 | } |
| 223 | 224 | } |
@@ -1,55 +1,68 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // @codingStandardsIgnoreFile |
| 3 | 3 | |
| 4 | -add_filter( 'kirki_config', function( $args ) { |
|
| 4 | +add_filter( 'kirki_config', function( $args ) |
|
| 5 | +{ |
|
| 5 | 6 | return apply_filters( 'kirki/config', $args ); |
| 6 | 7 | }, 99 ); |
| 7 | 8 | |
| 8 | -add_filter( 'kirki_control_types', function( $args ) { |
|
| 9 | +add_filter( 'kirki_control_types', function( $args ) |
|
| 10 | +{ |
|
| 9 | 11 | return apply_filters( 'kirki/control_types', $args ); |
| 10 | 12 | }, 99 ); |
| 11 | 13 | |
| 12 | -add_filter( 'kirki_section_types', function( $args ) { |
|
| 14 | +add_filter( 'kirki_section_types', function( $args ) |
|
| 15 | +{ |
|
| 13 | 16 | return apply_filters( 'kirki/section_types', $args ); |
| 14 | 17 | }, 99 ); |
| 15 | 18 | |
| 16 | -add_filter( 'kirki_section_types_exclude', function( $args ) { |
|
| 19 | +add_filter( 'kirki_section_types_exclude', function( $args ) |
|
| 20 | +{ |
|
| 17 | 21 | return apply_filters( 'kirki/section_types/exclude', $args ); |
| 18 | 22 | }, 99 ); |
| 19 | 23 | |
| 20 | -add_filter( 'kirki_control_types_exclude', function( $args ) { |
|
| 24 | +add_filter( 'kirki_control_types_exclude', function( $args ) |
|
| 25 | +{ |
|
| 21 | 26 | return apply_filters( 'kirki/control_types/exclude', $args ); |
| 22 | 27 | }, 99 ); |
| 23 | 28 | |
| 24 | -add_filter( 'kirki_controls', function( $args ) { |
|
| 29 | +add_filter( 'kirki_controls', function( $args ) |
|
| 30 | +{ |
|
| 25 | 31 | return apply_filters( 'kirki/controls', $args ); |
| 26 | 32 | }, 99 ); |
| 27 | 33 | |
| 28 | -add_filter( 'kirki_fields', function( $args ) { |
|
| 34 | +add_filter( 'kirki_fields', function( $args ) |
|
| 35 | +{ |
|
| 29 | 36 | return apply_filters( 'kirki/fields', $args ); |
| 30 | 37 | }, 99 ); |
| 31 | 38 | |
| 32 | -add_filter( 'kirki_modules', function( $args ) { |
|
| 39 | +add_filter( 'kirki_modules', function( $args ) |
|
| 40 | +{ |
|
| 33 | 41 | return apply_filters( 'kirki/modules', $args ); |
| 34 | 42 | }, 99 ); |
| 35 | 43 | |
| 36 | -add_filter( 'kirki_panel_types', function( $args ) { |
|
| 44 | +add_filter( 'kirki_panel_types', function( $args ) |
|
| 45 | +{ |
|
| 37 | 46 | return apply_filters( 'kirki/panel_types', $args ); |
| 38 | 47 | }, 99 ); |
| 39 | 48 | |
| 40 | -add_filter( 'kirki_setting_types', function( $args ) { |
|
| 49 | +add_filter( 'kirki_setting_types', function( $args ) |
|
| 50 | +{ |
|
| 41 | 51 | return apply_filters( 'kirki/setting_types', $args ); |
| 42 | 52 | }, 99 ); |
| 43 | 53 | |
| 44 | -add_filter( 'kirki_variable', function( $args ) { |
|
| 54 | +add_filter( 'kirki_variable', function( $args ) |
|
| 55 | +{ |
|
| 45 | 56 | return apply_filters( 'kirki/variable', $args ); |
| 46 | 57 | }, 99 ); |
| 47 | 58 | |
| 48 | -add_filter( 'kirki_values_get_value', function( $arg1, $arg2 ) { |
|
| 59 | +add_filter( 'kirki_values_get_value', function( $arg1, $arg2 ) |
|
| 60 | +{ |
|
| 49 | 61 | return apply_filters( 'kirki/values/get_value', $arg1, $arg2 ); |
| 50 | 62 | }, 99, 2 ); |
| 51 | 63 | |
| 52 | -add_action( 'init', function() { |
|
| 64 | +add_action( 'init', function() |
|
| 65 | +{ |
|
| 53 | 66 | $config_ids = Kirki_Config::get_config_ids(); |
| 54 | 67 | global $kirki_deprecated_filters_iteration; |
| 55 | 68 | foreach ( $config_ids as $config_id ) { |
@@ -62,14 +75,16 @@ discard block |
||
| 62 | 75 | '/webfonts/skip_hidden', |
| 63 | 76 | ) as $filter_suffix ) { |
| 64 | 77 | $kirki_deprecated_filters_iteration = array( $config_id, $filter_suffix ); |
| 65 | - add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) { |
|
| 78 | + add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) |
|
| 79 | + { |
|
| 66 | 80 | global $kirki_deprecated_filters_iteration; |
| 67 | 81 | $kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] ); |
| 68 | 82 | return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args ); |
| 69 | 83 | }, 99 ); |
| 70 | 84 | if ( false !== strpos( $kirki_deprecated_filters_iteration[1], '-' ) ) { |
| 71 | 85 | $kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] ); |
| 72 | - add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) { |
|
| 86 | + add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) |
|
| 87 | + { |
|
| 73 | 88 | global $kirki_deprecated_filters_iteration; |
| 74 | 89 | $kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] ); |
| 75 | 90 | return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args ); |
@@ -79,38 +94,47 @@ discard block |
||
| 79 | 94 | } |
| 80 | 95 | }, 99 ); |
| 81 | 96 | |
| 82 | -add_filter( 'kirki_enqueue_google_fonts', function( $args ) { |
|
| 97 | +add_filter( 'kirki_enqueue_google_fonts', function( $args ) |
|
| 98 | +{ |
|
| 83 | 99 | return apply_filters( 'kirki/enqueue_google_fonts', $args ); |
| 84 | 100 | }, 99 ); |
| 85 | 101 | |
| 86 | -add_filter( 'kirki_styles_array', function( $args ) { |
|
| 102 | +add_filter( 'kirki_styles_array', function( $args ) |
|
| 103 | +{ |
|
| 87 | 104 | return apply_filters( 'kirki/styles_array', $args ); |
| 88 | 105 | }, 99 ); |
| 89 | 106 | |
| 90 | -add_filter( 'kirki_dynamic_css_method', function( $args ) { |
|
| 107 | +add_filter( 'kirki_dynamic_css_method', function( $args ) |
|
| 108 | +{ |
|
| 91 | 109 | return apply_filters( 'kirki/dynamic_css/method', $args ); |
| 92 | 110 | }, 99 ); |
| 93 | 111 | |
| 94 | -add_filter( 'kirki_postmessage_script', function( $args ) { |
|
| 112 | +add_filter( 'kirki_postmessage_script', function( $args ) |
|
| 113 | +{ |
|
| 95 | 114 | return apply_filters( 'kirki/postmessage/script', $args ); |
| 96 | 115 | }, 99 ); |
| 97 | 116 | |
| 98 | -add_filter( 'kirki_fonts_all', function( $args ) { |
|
| 117 | +add_filter( 'kirki_fonts_all', function( $args ) |
|
| 118 | +{ |
|
| 99 | 119 | return apply_filters( 'kirki/fonts/all', $args ); |
| 100 | 120 | }, 99 ); |
| 101 | 121 | |
| 102 | -add_filter( 'kirki_fonts_standard_fonts', function( $args ) { |
|
| 122 | +add_filter( 'kirki_fonts_standard_fonts', function( $args ) |
|
| 123 | +{ |
|
| 103 | 124 | return apply_filters( 'kirki/fonts/standard_fonts', $args ); |
| 104 | 125 | }, 99 ); |
| 105 | 126 | |
| 106 | -add_filter( 'kirki_fonts_backup_fonts', function( $args ) { |
|
| 127 | +add_filter( 'kirki_fonts_backup_fonts', function( $args ) |
|
| 128 | +{ |
|
| 107 | 129 | return apply_filters( 'kirki/fonts/backup_fonts', $args ); |
| 108 | 130 | }, 99 ); |
| 109 | 131 | |
| 110 | -add_filter( 'kirki_fonts_google_fonts', function( $args ) { |
|
| 132 | +add_filter( 'kirki_fonts_google_fonts', function( $args ) |
|
| 133 | +{ |
|
| 111 | 134 | return apply_filters( 'kirki/fonts/google_fonts', $args ); |
| 112 | 135 | }, 99 ); |
| 113 | 136 | |
| 114 | -add_filter( 'kirki_googlefonts_load_method', function( $args ) { |
|
| 137 | +add_filter( 'kirki_googlefonts_load_method', function( $args ) |
|
| 138 | +{ |
|
| 115 | 139 | return apply_filters( 'kirki/googlefonts_load_method', $args ); |
| 116 | 140 | }, 99 ); |
@@ -453,7 +453,8 @@ |
||
| 453 | 453 | $variants = array_keys( $this->files ); |
| 454 | 454 | } |
| 455 | 455 | foreach ( $this->files as $variant => $file ) { |
| 456 | - if ( in_array( $variant, $variants ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict |
|
| 456 | + if ( in_array( $variant, $variants ) ) { |
|
| 457 | +// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict |
|
| 457 | 458 | $this->download_font_file( $file ); |
| 458 | 459 | } |
| 459 | 460 | } |
@@ -441,7 +441,8 @@ |
||
| 441 | 441 | if ( 'contains' === $operator || 'in' === $operator ) { |
| 442 | 442 | if ( is_array( $value1 ) && is_array( $value2 ) ) { |
| 443 | 443 | foreach ( $value2 as $val ) { |
| 444 | - if ( in_array( $val, $value1 ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict |
|
| 444 | + if ( in_array( $val, $value1 ) ) { |
|
| 445 | +// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict |
|
| 445 | 446 | return true; |
| 446 | 447 | } |
| 447 | 448 | } |