@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | // Flag to cancel subscription at period end. |
| 280 | 280 | // In this case, we do not want to cancel immediately. |
| 281 | 281 | $hook = 'frm_stripe_cancel_subscription_at_period_end'; |
| 282 | - $filter = function () { |
|
| 282 | + $filter = function() { |
|
| 283 | 283 | return true; |
| 284 | 284 | }; |
| 285 | 285 | |
@@ -534,8 +534,8 @@ discard block |
||
| 534 | 534 | 'charge.refunded' => 'refunded', |
| 535 | 535 | ); |
| 536 | 536 | |
| 537 | - if ( isset( $events[ $this->event->type ] ) ) { |
|
| 538 | - $this->status = $events[ $this->event->type ]; |
|
| 537 | + if ( isset( $events[$this->event->type] ) ) { |
|
| 538 | + $this->status = $events[$this->event->type]; |
|
| 539 | 539 | $this->set_payment_status(); |
| 540 | 540 | } elseif ( $this->event->type === 'customer.deleted' ) { |
| 541 | 541 | $this->reset_customer(); |
@@ -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 | ); |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $style_id = self::get_style_id_for_styler(); |
| 348 | 348 | |
| 349 | 349 | if ( ! $style_id ) { |
| 350 | - $error_args = array( |
|
| 350 | + $error_args = array( |
|
| 351 | 351 | 'title' => __( 'No styles', 'formidable' ), |
| 352 | 352 | 'body' => __( 'You must have a style to use the Visual Styler.', 'formidable' ), |
| 353 | 353 | 'cancel_url' => admin_url( 'admin.php?page=formidable' ), |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $form = FrmForm::getOne( $form_id ); |
| 366 | 366 | |
| 367 | 367 | if ( ! is_object( $form ) ) { |
| 368 | - $error_args = array( |
|
| 368 | + $error_args = array( |
|
| 369 | 369 | 'title' => __( 'No forms', 'formidable' ), |
| 370 | 370 | 'body' => __( 'You must have a form to use the Visual Styler.', 'formidable' ), |
| 371 | 371 | 'cancel_url' => admin_url( 'admin.php?page=formidable' ), |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | if ( ! $form_id ) { |
| 443 | 443 | // TODO: Show a message why a random form is being shown (because no form is assigned to the style). |
| 444 | 444 | // Fallback to any form. |
| 445 | - $where = array( |
|
| 445 | + $where = array( |
|
| 446 | 446 | 'status' => 'published', |
| 447 | 447 | // Make sure it's not a repeater. |
| 448 | 448 | 'parent_form_id' => array( null, 0 ), |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | private static function disable_admin_page_styling_on_submit_buttons() { |
| 462 | 462 | add_filter( |
| 463 | 463 | 'frm_submit_button_class', |
| 464 | - function ( $classes ) { |
|
| 464 | + function( $classes ) { |
|
| 465 | 465 | $classes[] = 'frm_no_style_button'; |
| 466 | 466 | return $classes; |
| 467 | 467 | } |
@@ -694,13 +694,13 @@ discard block |
||
| 694 | 694 | private static function force_form_style( $style ) { |
| 695 | 695 | add_filter( |
| 696 | 696 | 'frm_add_form_style_class', |
| 697 | - function ( $class ) use ( $style ) { |
|
| 698 | - $split = array_filter( |
|
| 697 | + function( $class ) use ( $style ) { |
|
| 698 | + $split = array_filter( |
|
| 699 | 699 | explode( ' ', $class ), |
| 700 | 700 | /** |
| 701 | 701 | * @param string $class |
| 702 | 702 | */ |
| 703 | - function ( $class ) { |
|
| 703 | + function( $class ) { |
|
| 704 | 704 | return $class && 0 !== strpos( $class, 'frm_style_' ); |
| 705 | 705 | } |
| 706 | 706 | ); |
@@ -828,11 +828,11 @@ discard block |
||
| 828 | 828 | $forms = FrmForm::get_published_forms(); |
| 829 | 829 | |
| 830 | 830 | foreach ( $forms as $form ) { |
| 831 | - if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 831 | + if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 832 | 832 | continue; |
| 833 | 833 | } |
| 834 | 834 | |
| 835 | - $new_style = sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 835 | + $new_style = sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 836 | 836 | |
| 837 | 837 | $form->options['custom_style'] = $new_style; |
| 838 | 838 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
@@ -1261,8 +1261,8 @@ discard block |
||
| 1261 | 1261 | public static function get_style_val( $val, $form = 'default' ) { |
| 1262 | 1262 | $style = self::get_form_style( $form ); |
| 1263 | 1263 | |
| 1264 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 1265 | - return $style->post_content[ $val ]; |
|
| 1264 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
| 1265 | + return $style->post_content[$val]; |
|
| 1266 | 1266 | } |
| 1267 | 1267 | } |
| 1268 | 1268 | |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | } elseif ( 'alt_bg_color' == $name ) { |
| 1288 | 1288 | $setting = 'bg_color_active'; |
| 1289 | 1289 | } |
| 1290 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 1290 | + $default_styles[$name] = $style->post_content[$setting]; |
|
| 1291 | 1291 | unset( $name, $val ); |
| 1292 | 1292 | } |
| 1293 | 1293 | |
@@ -1343,16 +1343,16 @@ discard block |
||
| 1343 | 1343 | $i = 0; |
| 1344 | 1344 | $first_open = false; |
| 1345 | 1345 | |
| 1346 | - if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
|
| 1346 | + if ( isset( $wp_meta_boxes[$page][$context] ) ) { |
|
| 1347 | 1347 | foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
| 1348 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 1349 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 1348 | + if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
|
| 1349 | + foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
|
| 1350 | 1350 | if ( false === $box || ! $box['title'] ) { |
| 1351 | 1351 | continue; |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | - ++$i; |
|
| 1355 | - $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id']; |
|
| 1354 | + ++ $i; |
|
| 1355 | + $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[$box['id']] : 'frm-' . $box['id']; |
|
| 1356 | 1356 | |
| 1357 | 1357 | $open_class = ''; |
| 1358 | 1358 | |
@@ -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 | |