@@ -42,7 +42,8 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | // Only do this for single site installs. |
45 | - if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
45 | + if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { |
|
46 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
46 | 47 | return; |
47 | 48 | } |
48 | 49 |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function add_settings( $sections ) { |
185 | 185 | wp_enqueue_style( 'formidable-pro-fields' ); |
186 | - $sections[ $this->plugin_slug ] = array( |
|
186 | + $sections[$this->plugin_slug] = array( |
|
187 | 187 | 'class' => $this, |
188 | 188 | 'function' => 'settings_page', |
189 | 189 | 'name' => $this->plugin_name(), |
@@ -349,9 +349,9 @@ discard block |
||
349 | 349 | // Set the current step. |
350 | 350 | if ( ! isset( $step['current'] ) ) { |
351 | 351 | if ( $step['complete'] ) { |
352 | - $steps[ $k ]['current'] = false; |
|
352 | + $steps[$k]['current'] = false; |
|
353 | 353 | } else { |
354 | - $steps[ $k ]['current'] = ! $has_current; |
|
354 | + $steps[$k]['current'] = ! $has_current; |
|
355 | 355 | $has_current = true; |
356 | 356 | } |
357 | 357 | } elseif ( $step['current'] ) { |
@@ -361,10 +361,10 @@ discard block |
||
361 | 361 | // Set disabled buttons. |
362 | 362 | $class = isset( $step['button_class'] ) ? $step['button_class'] : ''; |
363 | 363 | $class .= ' button-primary frm-button-primary'; |
364 | - if ( ! $steps[ $k ]['current'] ) { |
|
364 | + if ( ! $steps[$k]['current'] ) { |
|
365 | 365 | $class .= ' frm_grey disabled'; |
366 | 366 | } |
367 | - $steps[ $k ]['button_class'] = $class; |
|
367 | + $steps[$k]['button_class'] = $class; |
|
368 | 368 | }//end foreach |
369 | 369 | |
370 | 370 | return $steps; |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $addons = $api->get_api_info(); |
520 | 520 | |
521 | 521 | $id = $this->download_id(); |
522 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
522 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
523 | 523 | |
524 | 524 | if ( ! $step['current'] ) { |
525 | 525 | ?> |
@@ -534,10 +534,10 @@ discard block |
||
534 | 534 | |
535 | 535 | if ( ! $has_file ) { |
536 | 536 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
537 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
537 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
538 | 538 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
539 | 539 | } else { |
540 | - $xml = $addons[ $id ]['beta']['package']; |
|
540 | + $xml = $addons[$id]['beta']['package']; |
|
541 | 541 | if ( is_array( $xml ) ) { |
542 | 542 | $xml = reset( $xml ); |
543 | 543 | } |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | foreach ( $options as $info ) { |
615 | 615 | // Count the number of options displayed for css. |
616 | 616 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
617 | - --$count; |
|
617 | + -- $count; |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count ); |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | foreach ( $forms as $form ) { |
705 | 705 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
706 | 706 | if ( $was_imported ) { |
707 | - $imported[ $form['form'] ] = $was_imported; |
|
707 | + $imported[$form['form']] = $was_imported; |
|
708 | 708 | } |
709 | 709 | } |
710 | 710 |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | if ( is_array( $sub_field ) ) { |
60 | 60 | $sub_field = wp_parse_args( $sub_field, $defaults ); |
61 | 61 | $sub_field['name'] = $name; |
62 | - $this->sub_fields[ $name ] = $sub_field; |
|
62 | + $this->sub_fields[$name] = $sub_field; |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | 66 | if ( is_string( $sub_field ) ) { |
67 | - $this->sub_fields[ $name ] = wp_parse_args( |
|
67 | + $this->sub_fields[$name] = wp_parse_args( |
|
68 | 68 | array( |
69 | 69 | 'name' => $name, |
70 | 70 | 'label' => $sub_field, |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | if ( is_string( $option ) ) { |
119 | - $extra_options[ $key . '_' . $option ] = ''; |
|
119 | + $extra_options[$key . '_' . $option] = ''; |
|
120 | 120 | } elseif ( ! empty( $option['name'] ) ) { |
121 | - $extra_options[ $key . '_' . $option['name'] ] = ''; |
|
121 | + $extra_options[$key . '_' . $option['name']] = ''; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | foreach ( $this->sub_fields as $name => $sub_field ) { |
142 | 142 | $sub_field['name'] = $name; |
143 | 143 | $wrapper_classes = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name']; |
144 | - if ( ! isset( $processed_sub_fields[ $name ] ) ) { |
|
144 | + if ( ! isset( $processed_sub_fields[$name] ) ) { |
|
145 | 145 | // Options for this subfield should be hidden. |
146 | 146 | $wrapper_classes .= ' frm_hidden'; |
147 | 147 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $default_value = array(); |
172 | 172 | |
173 | 173 | foreach ( $this->sub_fields as $name => $sub_field ) { |
174 | - $default_value[ $name ] = ''; |
|
174 | + $default_value[$name] = ''; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $default_value; |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | // Placeholder. |
344 | 344 | if ( in_array( 'placeholder', $sub_field['options'], true ) ) { |
345 | 345 | $placeholders = FrmField::get_option( $field, 'placeholder' ); |
346 | - if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) { |
|
347 | - $field['placeholder'] = $placeholders[ $sub_field['name'] ]; |
|
346 | + if ( ! empty( $placeholders[$sub_field['name']] ) ) { |
|
347 | + $field['placeholder'] = $placeholders[$sub_field['name']]; |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | |
402 | 402 | // Validate not empty. |
403 | 403 | foreach ( $sub_fields as $name => $sub_field ) { |
404 | - if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) { |
|
405 | - $errors[ 'field' . $args['id'] . '-' . $name ] = ''; |
|
406 | - $errors[ 'field' . $args['id'] ] = $blank_msg; |
|
404 | + if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) { |
|
405 | + $errors['field' . $args['id'] . '-' . $name] = ''; |
|
406 | + $errors['field' . $args['id']] = $blank_msg; |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $field_key = isset( $this->field->field_key ) ? $this->field->field_key : $this->field['field_key']; |
423 | 423 | $sub_fields = $this->get_processed_sub_fields(); |
424 | 424 | foreach ( $sub_fields as $name => $sub_field ) { |
425 | - $headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
425 | + $headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | return $headings; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | $data_keys = array_keys( $data ); |
7 | 7 | $params = array(); |
8 | 8 | foreach ( $data_keys as $key ) { |
9 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
9 | + $params['data-' . $key] = $data[$key]; |
|
10 | 10 | } |
11 | 11 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
12 | 12 | $params['href'] = '#'; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $max_length = intval( FrmField::get_option( $this->field, 'max' ) ); |
35 | 35 | |
36 | 36 | if ( $max_length && strlen( $args['value'] ) > $max_length ) { |
37 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
37 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | return $errors; |
@@ -119,7 +119,8 @@ |
||
119 | 119 | * @return void |
120 | 120 | */ |
121 | 121 | private static function maybe_hook_into_global_settings_save() { |
122 | - if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
122 | + if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { |
|
123 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
123 | 124 | // Avoid changing any style data if the style array is not sent in the request. |
124 | 125 | return; |
125 | 126 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | /** |
154 | 154 | * Update the form data on the "Manage Styles" tab after global settings are saved. |
155 | 155 | */ |
156 | - function () { |
|
156 | + function() { |
|
157 | 157 | self::manage_styles(); |
158 | 158 | } |
159 | 159 | ); |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | if ( ! $form_id ) { |
401 | 401 | // TODO: Show a message why a random form is being shown (because no form is assigned to the style). |
402 | 402 | // Fallback to any form. |
403 | - $where = array( |
|
403 | + $where = array( |
|
404 | 404 | 'status' => 'published', |
405 | 405 | // Make sure it's not a repeater. |
406 | 406 | 'parent_form_id' => array( null, 0 ), |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | private static function disable_admin_page_styling_on_submit_buttons() { |
420 | 420 | add_filter( |
421 | 421 | 'frm_submit_button_class', |
422 | - function ( $classes ) { |
|
422 | + function( $classes ) { |
|
423 | 423 | $classes[] = 'frm_no_style_button'; |
424 | 424 | return $classes; |
425 | 425 | } |
@@ -627,13 +627,13 @@ discard block |
||
627 | 627 | private static function force_form_style( $style ) { |
628 | 628 | add_filter( |
629 | 629 | 'frm_add_form_style_class', |
630 | - function ( $class ) use ( $style ) { |
|
631 | - $split = array_filter( |
|
630 | + function( $class ) use ( $style ) { |
|
631 | + $split = array_filter( |
|
632 | 632 | explode( ' ', $class ), |
633 | 633 | /** |
634 | 634 | * @param string $class |
635 | 635 | */ |
636 | - function ( $class ) { |
|
636 | + function( $class ) { |
|
637 | 637 | return $class && 0 !== strpos( $class, 'frm_style_' ); |
638 | 638 | } |
639 | 639 | ); |
@@ -749,8 +749,8 @@ discard block |
||
749 | 749 | |
750 | 750 | $forms = FrmForm::get_published_forms(); |
751 | 751 | foreach ( $forms as $form ) { |
752 | - $new_style = isset( $_POST['style'] ) && isset( $_POST['style'][ $form->id ] ) ? sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
753 | - $previous_style = isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][ $form->id ] ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
752 | + $new_style = isset( $_POST['style'] ) && isset( $_POST['style'][$form->id] ) ? sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
753 | + $previous_style = isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][$form->id] ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][$form->id] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
754 | 754 | if ( $new_style == $previous_style ) { |
755 | 755 | continue; |
756 | 756 | } |
@@ -1159,8 +1159,8 @@ discard block |
||
1159 | 1159 | */ |
1160 | 1160 | public static function get_style_val( $val, $form = 'default' ) { |
1161 | 1161 | $style = self::get_form_style( $form ); |
1162 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
1163 | - return $style->post_content[ $val ]; |
|
1162 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
1163 | + return $style->post_content[$val]; |
|
1164 | 1164 | } |
1165 | 1165 | } |
1166 | 1166 | |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | } elseif ( 'alt_bg_color' == $name ) { |
1180 | 1180 | $setting = 'bg_color_active'; |
1181 | 1181 | } |
1182 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
1182 | + $default_styles[$name] = $style->post_content[$setting]; |
|
1183 | 1183 | unset( $name, $val ); |
1184 | 1184 | } |
1185 | 1185 | |
@@ -1225,16 +1225,16 @@ discard block |
||
1225 | 1225 | $i = 0; |
1226 | 1226 | $first_open = false; |
1227 | 1227 | |
1228 | - if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
|
1228 | + if ( isset( $wp_meta_boxes[$page][$context] ) ) { |
|
1229 | 1229 | foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
1230 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
1231 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
1230 | + if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
|
1231 | + foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
|
1232 | 1232 | if ( false === $box || ! $box['title'] ) { |
1233 | 1233 | continue; |
1234 | 1234 | } |
1235 | 1235 | |
1236 | - ++$i; |
|
1237 | - $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id']; |
|
1236 | + ++ $i; |
|
1237 | + $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[$box['id']] : 'frm-' . $box['id']; |
|
1238 | 1238 | |
1239 | 1239 | $open_class = ''; |
1240 | 1240 | if ( ! $first_open ) { |
@@ -67,7 +67,8 @@ |
||
67 | 67 | $new_instance = (array) $new_instance; |
68 | 68 | $this->id = $new_instance['ID']; |
69 | 69 | |
70 | - if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
70 | + if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { |
|
71 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
71 | 72 | // Don't continue if not saving this style. |
72 | 73 | continue; |
73 | 74 | } |
@@ -102,21 +102,21 @@ discard block |
||
102 | 102 | $default_settings = $this->get_defaults(); |
103 | 103 | |
104 | 104 | foreach ( $default_settings as $setting => $default ) { |
105 | - if ( ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
106 | - $new_instance['post_content'][ $setting ] = $default; |
|
105 | + if ( ! isset( $new_instance['post_content'][$setting] ) ) { |
|
106 | + $new_instance['post_content'][$setting] = $default; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | if ( $this->is_color( $setting ) ) { |
110 | - $color_val = $new_instance['post_content'][ $setting ]; |
|
110 | + $color_val = $new_instance['post_content'][$setting]; |
|
111 | 111 | if ( $color_val !== '' && false !== strpos( $color_val, 'rgb' ) ) { |
112 | 112 | // Maybe sanitize if invalid rgba value is entered. |
113 | 113 | $this->maybe_sanitize_rgba_value( $color_val ); |
114 | 114 | } |
115 | - $new_instance['post_content'][ $setting ] = str_replace( '#', '', $color_val ); |
|
116 | - } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
117 | - $new_instance['post_content'][ $setting ] = 0; |
|
115 | + $new_instance['post_content'][$setting] = str_replace( '#', '', $color_val ); |
|
116 | + } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][$setting] ) ) { |
|
117 | + $new_instance['post_content'][$setting] = 0; |
|
118 | 118 | } elseif ( $setting === 'font' ) { |
119 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
119 | + $new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -236,14 +236,14 @@ discard block |
||
236 | 236 | $valid_keys = array_keys( $defaults ); |
237 | 237 | $sanitized_settings = array(); |
238 | 238 | foreach ( $valid_keys as $key ) { |
239 | - if ( isset( $settings[ $key ] ) ) { |
|
240 | - $sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] ); |
|
239 | + if ( isset( $settings[$key] ) ) { |
|
240 | + $sanitized_settings[$key] = sanitize_textarea_field( $settings[$key] ); |
|
241 | 241 | } else { |
242 | - $sanitized_settings[ $key ] = $defaults[ $key ]; |
|
242 | + $sanitized_settings[$key] = $defaults[$key]; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | if ( 'custom_css' !== $key ) { |
246 | - $sanitized_settings[ $key ] = $this->strip_invalid_characters( $sanitized_settings[ $key ] ); |
|
246 | + $sanitized_settings[$key] = $this->strip_invalid_characters( $sanitized_settings[$key] ); |
|
247 | 247 | } |
248 | 248 | } |
249 | 249 | return $sanitized_settings; |
@@ -493,13 +493,13 @@ discard block |
||
493 | 493 | $style->post_content = $this->override_defaults( $style->post_content ); |
494 | 494 | $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
495 | 495 | |
496 | - $styles[ $style->ID ] = $style; |
|
496 | + $styles[$style->ID] = $style; |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | if ( ! $default_style ) { |
500 | 500 | $default_style = reset( $styles ); |
501 | 501 | |
502 | - $styles[ $default_style->ID ]->menu_order = 1; |
|
502 | + $styles[$default_style->ID]->menu_order = 1; |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | return $styles; |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | continue; |
744 | 744 | } |
745 | 745 | |
746 | - if ( $value && $char === $value[ strlen( $value ) - 1 ] ) { |
|
746 | + if ( $value && $char === $value[strlen( $value ) - 1] ) { |
|
747 | 747 | $value = $char . $value; |
748 | 748 | } else { |
749 | 749 | $value .= $char; |
@@ -285,7 +285,8 @@ |
||
285 | 285 | public static function get_settings_for_output( $style ) { |
286 | 286 | if ( self::previewing_style() ) { |
287 | 287 | $frm_style = new FrmStyle(); |
288 | - if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
288 | + if ( isset( $_POST['frm_style_setting'] ) ) { |
|
289 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
289 | 290 | |
290 | 291 | // Sanitizing is done later. |
291 | 292 | $posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | '-' => 'down', |
127 | 127 | '+' => 'up', |
128 | 128 | ); |
129 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
129 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
130 | 130 | } else { |
131 | 131 | // frm_minus1_icon. |
132 | 132 | $key = str_replace( 'p', '', $key ); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | '-' => 'minus', |
135 | 135 | '+' => 'plus', |
136 | 136 | ); |
137 | - $class = 'frm_' . $plus[ $icon ]; |
|
137 | + $class = 'frm_' . $plus[$icon]; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | if ( $key ) { |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | ?> |
161 | 161 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
162 | 162 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
163 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
164 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
163 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
164 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
165 | 165 | <b class="caret"></b> |
166 | 166 | </button> |
167 | 167 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | <li <?php echo $style->post_content['collapse_icon'] == $key ? 'class="active"' : ''; ?>> |
170 | 170 | <a href="javascript:void(0);"> |
171 | 171 | <label> |
172 | - <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 ); ?> /> |
|
172 | + <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 ); ?> /> |
|
173 | 173 | <span> |
174 | 174 | <?php |
175 | 175 | FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); |
@@ -421,15 +421,15 @@ discard block |
||
421 | 421 | $vars = array_diff( $vars, $remove ); |
422 | 422 | |
423 | 423 | foreach ( $vars as $var ) { |
424 | - if ( ! isset( $settings[ $var ] ) ) { |
|
424 | + if ( ! isset( $settings[$var] ) ) { |
|
425 | 425 | continue; |
426 | 426 | } |
427 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
428 | - $defaults[ $var ] = ''; |
|
427 | + if ( ! isset( $defaults[$var] ) ) { |
|
428 | + $defaults[$var] = ''; |
|
429 | 429 | } |
430 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
430 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
431 | 431 | if ( $show ) { |
432 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
432 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
433 | 433 | } |
434 | 434 | } |
435 | 435 | } |
@@ -478,8 +478,8 @@ discard block |
||
478 | 478 | |
479 | 479 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
480 | 480 | foreach ( $checkbox_opts as $opt ) { |
481 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
482 | - $settings[ $opt ] = 0; |
|
481 | + if ( ! isset( $settings[$opt] ) ) { |
|
482 | + $settings[$opt] = 0; |
|
483 | 483 | } |
484 | 484 | } |
485 | 485 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $css = ''; |
508 | 508 | } |
509 | 509 | foreach ( $opts as $opt ) { |
510 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
510 | + self::get_color_output( $css, $settings[$opt] ); |
|
511 | 511 | } |
512 | 512 | } |
513 | 513 | } |
@@ -727,13 +727,13 @@ discard block |
||
727 | 727 | */ |
728 | 728 | private static function get_default_style_count( $style_id, $conversational_style_id ) { |
729 | 729 | $substrings = array_map( |
730 | - function ( $value ) { |
|
730 | + function( $value ) { |
|
731 | 731 | $substring = serialize( array( 'custom_style' => $value ) ); |
732 | 732 | return substr( $substring, 5, -1 ); |
733 | 733 | }, |
734 | 734 | array( '1', 1 ) |
735 | 735 | ); |
736 | - $where = array( |
|
736 | + $where = array( |
|
737 | 737 | 'status' => 'published', |
738 | 738 | 0 => array( |
739 | 739 | 'options NOT LIKE' => 'custom_style', |
@@ -50,7 +50,7 @@ |
||
50 | 50 | // Remove 'Styling Template' from titles. |
51 | 51 | foreach ( $api_info as $id => $template ) { |
52 | 52 | if ( isset( $template['name'] ) ) { |
53 | - $api_info[ $id ]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
53 | + $api_info[$id]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'text-color' => $style->post_content['text_color'], |
41 | 41 | 'submit-bg-color' => $style->post_content['submit_bg_color'], |
42 | 42 | ); |
43 | - $index = 0; |
|
43 | + $index = 0; |
|
44 | 44 | foreach ( $colors as $css_var_name => $color ) { |
45 | 45 | if ( 0 !== strpos( $color, 'rgb' ) ) { |
46 | 46 | $color = '#' . $color; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'style' => 'background-color: var(--' . $css_var_name . ')', |
52 | 52 | ); |
53 | 53 | |
54 | - ++$index; |
|
54 | + ++ $index; |
|
55 | 55 | ?> |
56 | 56 | <div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div> |
57 | 57 | <?php |