@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | '-' => 'down', |
| 144 | 144 | '+' => 'up', |
| 145 | 145 | ); |
| 146 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
| 146 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
| 147 | 147 | } else { |
| 148 | 148 | // frm_minus1_icon. |
| 149 | 149 | $key = str_replace( 'p', '', $key ); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | '-' => 'minus', |
| 152 | 152 | '+' => 'plus', |
| 153 | 153 | ); |
| 154 | - $class = 'frm_' . $plus[ $icon ]; |
|
| 154 | + $class = 'frm_' . $plus[$icon]; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if ( $key ) { |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | ?> |
| 178 | 178 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
| 179 | 179 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
| 180 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
| 181 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
| 180 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
| 181 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
| 182 | 182 | <b class="caret"></b> |
| 183 | 183 | </button> |
| 184 | 184 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | <li <?php echo $style->post_content['collapse_icon'] == $key ? 'class="active"' : ''; ?>> |
| 187 | 187 | <a href="javascript:void(0);"> |
| 188 | 188 | <label> |
| 189 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?> /> |
|
| 189 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?> /> |
|
| 190 | 190 | <span> |
| 191 | 191 | <?php |
| 192 | 192 | FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | $vars = array_diff( $vars, $remove ); |
| 438 | 438 | |
| 439 | 439 | foreach ( $vars as $var ) { |
| 440 | - if ( ! isset( $settings[ $var ] ) || ! self::css_key_is_valid( $var ) ) { |
|
| 440 | + if ( ! isset( $settings[$var] ) || ! self::css_key_is_valid( $var ) ) { |
|
| 441 | 441 | continue; |
| 442 | 442 | } |
| 443 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
| 444 | - $defaults[ $var ] = ''; |
|
| 443 | + if ( ! isset( $defaults[$var] ) ) { |
|
| 444 | + $defaults[$var] = ''; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | $prepared_value = ''; |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | return false; |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | - if ( $defaults && $defaults[ $var ] === $prepared_value ) { |
|
| 471 | + if ( $defaults && $defaults[$var] === $prepared_value ) { |
|
| 472 | 472 | return false; |
| 473 | 473 | } |
| 474 | 474 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | * @return string |
| 550 | 550 | */ |
| 551 | 551 | private static function css_var_prepare_value( $settings, $key ) { |
| 552 | - $value = $settings[ $key ]; |
|
| 552 | + $value = $settings[$key]; |
|
| 553 | 553 | |
| 554 | 554 | if ( ! is_string( $value ) && ! is_numeric( $value ) ) { |
| 555 | 555 | return ''; |
@@ -634,8 +634,8 @@ discard block |
||
| 634 | 634 | |
| 635 | 635 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
| 636 | 636 | foreach ( $checkbox_opts as $opt ) { |
| 637 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
| 638 | - $settings[ $opt ] = 0; |
|
| 637 | + if ( ! isset( $settings[$opt] ) ) { |
|
| 638 | + $settings[$opt] = 0; |
|
| 639 | 639 | } |
| 640 | 640 | } |
| 641 | 641 | |
@@ -683,9 +683,9 @@ discard block |
||
| 683 | 683 | ); |
| 684 | 684 | |
| 685 | 685 | array_map( |
| 686 | - function ( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
| 687 | - if ( isset( $settings[ $key ] ) ) { |
|
| 688 | - $settings[ $key ] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
| 686 | + function( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
| 687 | + if ( isset( $settings[$key] ) ) { |
|
| 688 | + $settings[$key] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
| 689 | 689 | } |
| 690 | 690 | }, |
| 691 | 691 | $font_sizes_to_update |
@@ -702,11 +702,11 @@ discard block |
||
| 702 | 702 | * @return float |
| 703 | 703 | */ |
| 704 | 704 | private static function get_base_font_size_scale( $key, $value, $defaults ) { |
| 705 | - if ( empty( $defaults[ $key ] ) || ! is_numeric( (int) $defaults[ $key ] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
| 705 | + if ( empty( $defaults[$key] ) || ! is_numeric( (int) $defaults[$key] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
| 706 | 706 | return 1; |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - return round( (int) $defaults[ $key ] / (int) $value, 2 ); |
|
| 709 | + return round( (int) $defaults[$key] / (int) $value, 2 ); |
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | /** |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $css = ''; |
| 720 | 720 | } |
| 721 | 721 | foreach ( $opts as $opt ) { |
| 722 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
| 722 | + self::get_color_output( $css, $settings[$opt] ); |
|
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | } |
@@ -932,13 +932,13 @@ discard block |
||
| 932 | 932 | */ |
| 933 | 933 | private static function get_default_style_count( $style_id, $conversational_style_id ) { |
| 934 | 934 | $substrings = array_map( |
| 935 | - function ( $value ) { |
|
| 935 | + function( $value ) { |
|
| 936 | 936 | $substring = serialize( array( 'custom_style' => $value ) ); |
| 937 | 937 | return substr( $substring, 5, -1 ); |
| 938 | 938 | }, |
| 939 | 939 | array( '1', 1 ) |
| 940 | 940 | ); |
| 941 | - $where = array( |
|
| 941 | + $where = array( |
|
| 942 | 942 | 'status' => 'published', |
| 943 | 943 | 0 => array( |
| 944 | 944 | 'options NOT LIKE' => 'custom_style', |