@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | '-' => 'down', |
| 163 | 163 | '+' => 'up', |
| 164 | 164 | ); |
| 165 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
| 165 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
| 166 | 166 | } else { |
| 167 | 167 | // frm_minus1_icon. |
| 168 | 168 | $key = str_replace( 'p', '', $key ); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | '-' => 'minus', |
| 171 | 171 | '+' => 'plus', |
| 172 | 172 | ); |
| 173 | - $class = 'frm_' . $plus[ $icon ]; |
|
| 173 | + $class = 'frm_' . $plus[$icon]; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | if ( $key ) { |
@@ -198,8 +198,8 @@ discard block |
||
| 198 | 198 | ?> |
| 199 | 199 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
| 200 | 200 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
| 201 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
| 202 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
| 201 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
| 202 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
| 203 | 203 | <b class="caret"></b> |
| 204 | 204 | </button> |
| 205 | 205 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | <li <?php echo $style->post_content['collapse_icon'] == $key ? 'class="active"' : ''; ?>> |
| 208 | 208 | <a href="javascript:void(0);"> |
| 209 | 209 | <label> |
| 210 | - <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 ); ?> /> |
|
| 210 | + <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 ); ?> /> |
|
| 211 | 211 | <span> |
| 212 | 212 | <?php |
| 213 | 213 | FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); |
@@ -487,12 +487,12 @@ discard block |
||
| 487 | 487 | $vars = array_diff( $vars, self::get_style_keys_to_remove_from_output_vars() ); |
| 488 | 488 | |
| 489 | 489 | foreach ( $vars as $var ) { |
| 490 | - if ( ! isset( $settings[ $var ] ) || ! self::css_key_is_valid( $var ) ) { |
|
| 490 | + if ( ! isset( $settings[$var] ) || ! self::css_key_is_valid( $var ) ) { |
|
| 491 | 491 | continue; |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
| 495 | - $defaults[ $var ] = ''; |
|
| 494 | + if ( ! isset( $defaults[$var] ) ) { |
|
| 495 | + $defaults[$var] = ''; |
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | $prepared_value = ''; |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | return false; |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | - if ( $defaults && $defaults[ $var ] === $prepared_value ) { |
|
| 552 | + if ( $defaults && $defaults[$var] === $prepared_value ) { |
|
| 553 | 553 | return false; |
| 554 | 554 | } |
| 555 | 555 | |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | * @return string |
| 629 | 629 | */ |
| 630 | 630 | private static function css_var_prepare_value( $settings, $key ) { |
| 631 | - $value = $settings[ $key ]; |
|
| 631 | + $value = $settings[$key]; |
|
| 632 | 632 | |
| 633 | 633 | if ( ! is_string( $value ) && ! is_numeric( $value ) ) { |
| 634 | 634 | return ''; |
@@ -718,8 +718,8 @@ discard block |
||
| 718 | 718 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
| 719 | 719 | |
| 720 | 720 | foreach ( $checkbox_opts as $opt ) { |
| 721 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
| 722 | - $settings[ $opt ] = 0; |
|
| 721 | + if ( ! isset( $settings[$opt] ) ) { |
|
| 722 | + $settings[$opt] = 0; |
|
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | |
@@ -769,9 +769,9 @@ discard block |
||
| 769 | 769 | ); |
| 770 | 770 | |
| 771 | 771 | array_map( |
| 772 | - function ( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
| 773 | - if ( isset( $settings[ $key ] ) ) { |
|
| 774 | - $settings[ $key ] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
| 772 | + function( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
| 773 | + if ( isset( $settings[$key] ) ) { |
|
| 774 | + $settings[$key] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
| 775 | 775 | } |
| 776 | 776 | }, |
| 777 | 777 | $font_sizes_to_update |
@@ -792,11 +792,11 @@ discard block |
||
| 792 | 792 | * @return float |
| 793 | 793 | */ |
| 794 | 794 | private static function get_base_font_size_scale( $key, $value, $defaults ) { |
| 795 | - if ( empty( $defaults[ $key ] ) || ! is_numeric( (int) $defaults[ $key ] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
| 795 | + if ( empty( $defaults[$key] ) || ! is_numeric( (int) $defaults[$key] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
| 796 | 796 | return 1; |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | - return round( (int) $defaults[ $key ] / (int) $value, 2 ); |
|
| 799 | + return round( (int) $defaults[$key] / (int) $value, 2 ); |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | /** |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | } |
| 817 | 817 | |
| 818 | 818 | foreach ( $opts as $opt ) { |
| 819 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
| 819 | + self::get_color_output( $css, $settings[$opt] ); |
|
| 820 | 820 | } |
| 821 | 821 | } |
| 822 | 822 | } |
@@ -1045,13 +1045,13 @@ discard block |
||
| 1045 | 1045 | */ |
| 1046 | 1046 | private static function get_default_style_count( $style_id, $conversational_style_id ) { |
| 1047 | 1047 | $substrings = array_map( |
| 1048 | - function ( $value ) { |
|
| 1048 | + function( $value ) { |
|
| 1049 | 1049 | $substring = serialize( array( 'custom_style' => $value ) ); |
| 1050 | 1050 | return substr( $substring, 5, -1 ); |
| 1051 | 1051 | }, |
| 1052 | 1052 | array( '1', 1 ) |
| 1053 | 1053 | ); |
| 1054 | - $where = array( |
|
| 1054 | + $where = array( |
|
| 1055 | 1055 | 'status' => 'published', |
| 1056 | 1056 | 0 => array( |
| 1057 | 1057 | 'options NOT LIKE' => 'custom_style', |