@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $max_length = intval( FrmField::get_option( $this->field, 'max' ) ); |
| 43 | 43 | |
| 44 | 44 | if ( $max_length && FrmAppHelper::mb_function( array( 'mb_strlen', 'strlen' ), array( $args['value'] ) ) > $max_length ) { |
| 45 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 45 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | return $errors; |
@@ -137,10 +137,13 @@ discard block |
||
| 137 | 137 | </div> |
| 138 | 138 | <input type="hidden" <?php echo esc_attr( $field_name ); ?> value="<?php echo esc_attr( $field_value ); ?>" id="<?php echo esc_attr( $component['id'] ); ?>" /> |
| 139 | 139 | </div> |
| 140 | -<?php else : ?> |
|
| 140 | +<?php else { |
|
| 141 | + : ?> |
|
| 141 | 142 | <div> |
| 142 | 143 | <?php if ( empty( $component['independent_fields'] ) ) : ?> |
| 143 | - <div class="frm-slider-component <?php echo esc_attr( $component_class ); ?>" <?php echo esc_attr( $component_attr ); ?> data-display-sliders="top,bottom" data-type="vertical" data-max-value="<?php echo (int) $component['max_value']; ?>"> |
|
| 144 | + <div class="frm-slider-component <?php echo esc_attr( $component_class ); |
|
| 145 | +} |
|
| 146 | +?>" <?php echo esc_attr( $component_attr ); ?> data-display-sliders="top,bottom" data-type="vertical" data-max-value="<?php echo (int) $component['max_value']; ?>"> |
|
| 144 | 147 | <div class="frm-flex-justify"> |
| 145 | 148 | <div class="frm-slider-container"> |
| 146 | 149 | <?php if ( ! empty( $component['icon'] ) ) : ?> |
@@ -165,8 +168,11 @@ discard block |
||
| 165 | 168 | </div> |
| 166 | 169 | </div> |
| 167 | 170 | </div> |
| 168 | - <?php else : ?> |
|
| 169 | - <div class="<?php echo esc_attr( $component_class ); ?>" <?php echo esc_attr( $component_attr ); ?> > |
|
| 171 | + <?php else { |
|
| 172 | + : ?> |
|
| 173 | + <div class="<?php echo esc_attr( $component_class ); |
|
| 174 | +} |
|
| 175 | +?>" <?php echo esc_attr( $component_attr ); ?> > |
|
| 170 | 176 | <div class="frm-slider-component frm-group-sliders frm-has-independent-fields" data-display-sliders="top,bottom" data-max-value="<?php echo (int) $component['max_value']; ?>"> |
| 171 | 177 | <div class="frm-flex-justify"> |
| 172 | 178 | <div class="frm-slider-container"> |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | $has_field = true; |
| 182 | 182 | $key_exists = array_key_exists( $field_atts['name'], $form_atts['form_action']->post_content ); |
| 183 | 183 | ?> |
| 184 | - <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[ $field_atts['name'] ] : 0, $field->id ); ?>> |
|
| 184 | + <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[$field_atts['name']] : 0, $field->id ); ?>> |
|
| 185 | 185 | <?php |
| 186 | 186 | echo esc_attr( FrmAppHelper::truncate( $field->name, 50, 1 ) ); |
| 187 | 187 | |
@@ -144,7 +144,8 @@ discard block |
||
| 144 | 144 | * @return void |
| 145 | 145 | */ |
| 146 | 146 | private static function maybe_hook_into_global_settings_save() { |
| 147 | - if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 147 | + if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { |
|
| 148 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 148 | 149 | // Avoid changing any style data if the style array is not sent in the request. |
| 149 | 150 | return; |
| 150 | 151 | } |
@@ -765,7 +766,8 @@ discard block |
||
| 765 | 766 | |
| 766 | 767 | $forms = FrmForm::get_published_forms(); |
| 767 | 768 | foreach ( $forms as $form ) { |
| 768 | - if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 769 | + if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { |
|
| 770 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 769 | 771 | continue; |
| 770 | 772 | } |
| 771 | 773 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | /** |
| 161 | 161 | * Update the form data on the "Manage Styles" tab after global settings are saved. |
| 162 | 162 | */ |
| 163 | - function () { |
|
| 163 | + function() { |
|
| 164 | 164 | self::manage_styles(); |
| 165 | 165 | } |
| 166 | 166 | ); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | |
| 439 | 439 | if ( ! $form_id ) { |
| 440 | 440 | // Fallback to any form. |
| 441 | - $where = array( |
|
| 441 | + $where = array( |
|
| 442 | 442 | 'status' => 'published', |
| 443 | 443 | // Make sure it's not a repeater. |
| 444 | 444 | 'parent_form_id' => array( null, 0 ), |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | private static function disable_admin_page_styling_on_submit_buttons() { |
| 458 | 458 | add_filter( |
| 459 | 459 | 'frm_submit_button_class', |
| 460 | - function ( $classes ) { |
|
| 460 | + function( $classes ) { |
|
| 461 | 461 | $classes[] = 'frm_no_style_button'; |
| 462 | 462 | return $classes; |
| 463 | 463 | } |
@@ -689,13 +689,13 @@ discard block |
||
| 689 | 689 | private static function force_form_style( $style ) { |
| 690 | 690 | add_filter( |
| 691 | 691 | 'frm_add_form_style_class', |
| 692 | - function ( $class ) use ( $style ) { |
|
| 693 | - $split = array_filter( |
|
| 692 | + function( $class ) use ( $style ) { |
|
| 693 | + $split = array_filter( |
|
| 694 | 694 | explode( ' ', $class ), |
| 695 | 695 | /** |
| 696 | 696 | * @param string $class |
| 697 | 697 | */ |
| 698 | - function ( $class ) { |
|
| 698 | + function( $class ) { |
|
| 699 | 699 | return $class && 0 !== strpos( $class, 'frm_style_' ); |
| 700 | 700 | } |
| 701 | 701 | ); |
@@ -823,11 +823,11 @@ discard block |
||
| 823 | 823 | $forms = FrmForm::get_published_forms(); |
| 824 | 824 | |
| 825 | 825 | foreach ( $forms as $form ) { |
| 826 | - if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 826 | + if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 827 | 827 | continue; |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | - $new_style = sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 830 | + $new_style = sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 831 | 831 | |
| 832 | 832 | $form->options['custom_style'] = $new_style; |
| 833 | 833 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
@@ -1278,8 +1278,8 @@ discard block |
||
| 1278 | 1278 | public static function get_style_val( $val, $form = 'default' ) { |
| 1279 | 1279 | $style = self::get_form_style( $form ); |
| 1280 | 1280 | |
| 1281 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 1282 | - return $style->post_content[ $val ]; |
|
| 1281 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
| 1282 | + return $style->post_content[$val]; |
|
| 1283 | 1283 | } |
| 1284 | 1284 | |
| 1285 | 1285 | return null; |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | } elseif ( 'alt_bg_color' == $name ) { |
| 1307 | 1307 | $setting = 'bg_color_active'; |
| 1308 | 1308 | } |
| 1309 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 1309 | + $default_styles[$name] = $style->post_content[$setting]; |
|
| 1310 | 1310 | unset( $name, $val ); |
| 1311 | 1311 | } |
| 1312 | 1312 | |
@@ -1362,16 +1362,16 @@ discard block |
||
| 1362 | 1362 | $i = 0; |
| 1363 | 1363 | $first_open = false; |
| 1364 | 1364 | |
| 1365 | - if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
|
| 1365 | + if ( isset( $wp_meta_boxes[$page][$context] ) ) { |
|
| 1366 | 1366 | foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
| 1367 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 1368 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 1367 | + if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
|
| 1368 | + foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
|
| 1369 | 1369 | if ( false === $box || ! $box['title'] ) { |
| 1370 | 1370 | continue; |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | - ++$i; |
|
| 1374 | - $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id']; |
|
| 1373 | + ++ $i; |
|
| 1374 | + $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[$box['id']] : 'frm-' . $box['id']; |
|
| 1375 | 1375 | |
| 1376 | 1376 | $open_class = ''; |
| 1377 | 1377 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | add_filter( |
| 7 | 7 | 'document_title', |
| 8 | - function ( $title ) use ( $form ) { |
|
| 8 | + function( $title ) use ( $form ) { |
|
| 9 | 9 | $form_name = '' === $form->name ? FrmFormsHelper::get_no_title_text() : $form->name; |
| 10 | 10 | return get_bloginfo( 'name', 'display' ) . ' | ' . wp_strip_all_tags( $form_name ); |
| 11 | 11 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | |
| 76 | 76 | foreach ( $forms as $form ) { |
| 77 | 77 | $form_title = '' === $form->name ? FrmFormsHelper::get_no_title_text() : FrmAppHelper::truncate( $form->name, 50 ); |
| 78 | - $options[ $form->id ] = esc_html( $form_title ); |
|
| 78 | + $options[$form->id] = esc_html( $form_title ); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $options; |
@@ -133,15 +133,15 @@ |
||
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if ( ! isset( $flows_data[ $key ] ) ) { |
|
| 137 | - $flows_data[ $key ] = array(); |
|
| 136 | + if ( ! isset( $flows_data[$key] ) ) { |
|
| 137 | + $flows_data[$key] = array(); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if ( ! isset( $flows_data[ $key ][ $value ] ) ) { |
|
| 141 | - $flows_data[ $key ][ $value ] = 0; |
|
| 140 | + if ( ! isset( $flows_data[$key][$value] ) ) { |
|
| 141 | + $flows_data[$key][$value] = 0; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $flows_data[ $key ][ $value ]++; |
|
| 144 | + $flows_data[$key][$value] ++; |
|
| 145 | 145 | update_option( self::FLOWS_ACTION_NAME, $flows_data ); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param array $keys |
| 39 | 39 | */ |
| 40 | - self::$keys = apply_filters( |
|
| 40 | + self::$keys = apply_filters( |
|
| 41 | 41 | 'frm_application_data_keys', |
| 42 | 42 | array( 'key', 'name', 'description', 'link', 'categories', 'views', 'forms', 'used_addons' ) |
| 43 | 43 | ); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | self::get_template_keys_with_local_png_images(), |
| 46 | 46 | self::get_template_keys_with_local_webp_images() |
| 47 | 47 | ); |
| 48 | - self::$categories = array(); |
|
| 48 | + self::$categories = array(); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -144,20 +144,20 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $application = array(); |
| 146 | 146 | foreach ( self::$keys as $key ) { |
| 147 | - if ( ! isset( $this->api_data[ $key ] ) ) { |
|
| 147 | + if ( ! isset( $this->api_data[$key] ) ) { |
|
| 148 | 148 | continue; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $value = $this->api_data[ $key ]; |
|
| 151 | + $value = $this->api_data[$key]; |
|
| 152 | 152 | |
| 153 | 153 | if ( 'icon' === $key ) { |
| 154 | 154 | // Icon is an array. The first array item is the image URL. |
| 155 | - $application[ $key ] = reset( $value ); |
|
| 155 | + $application[$key] = reset( $value ); |
|
| 156 | 156 | } elseif ( 'categories' === $key ) { |
| 157 | - $application[ $key ] = array_values( |
|
| 157 | + $application[$key] = array_values( |
|
| 158 | 158 | array_filter( |
| 159 | 159 | $value, |
| 160 | - function ( $category ) { |
|
| 160 | + function( $category ) { |
|
| 161 | 161 | return false === strpos( $category, '+Views' ); |
| 162 | 162 | } |
| 163 | 163 | ) |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // Strip off the " Template" text at the end of the name as it takes up space. |
| 174 | 174 | $value = substr( $value, 0, -9 ); |
| 175 | 175 | } |
| 176 | - $application[ $key ] = $value; |
|
| 176 | + $application[$key] = $value; |
|
| 177 | 177 | }//end if |
| 178 | 178 | }//end foreach |
| 179 | 179 | |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | * @return bool |
| 128 | 128 | */ |
| 129 | 129 | private static function check_free_segments( $who ) { |
| 130 | - $segments = array( |
|
| 130 | + $segments = array( |
|
| 131 | 131 | 'free_first_1', |
| 132 | 132 | 'free_first_2_3', |
| 133 | 133 | 'free_first_4_7', |