@@ -491,7 +491,8 @@ |
||
491 | 491 | |
492 | 492 | public static function process_entry( $errors = '', $ajax = false ) { |
493 | 493 | $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' ); |
494 | - if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
494 | + if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { |
|
495 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
495 | 496 | return; |
496 | 497 | } |
497 | 498 |
@@ -77,20 +77,20 @@ discard block |
||
77 | 77 | global $frm_vars; |
78 | 78 | $form_id = FrmForm::get_current_form_id(); |
79 | 79 | |
80 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
81 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
80 | + $columns[$form_id . '_id'] = 'ID'; |
|
81 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
82 | 82 | |
83 | 83 | if ( $form_id ) { |
84 | 84 | self::get_columns_for_form( $form_id, $columns ); |
85 | 85 | } else { |
86 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
87 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
88 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
86 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
87 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
88 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
89 | 89 | } |
90 | 90 | |
91 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
92 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
93 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
91 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
92 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
93 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
94 | 94 | self::maybe_add_ip_col( $form_id, $columns ); |
95 | 95 | |
96 | 96 | $frm_vars['cols'] = $columns; |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | |
149 | 149 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
150 | 150 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
151 | - unset( $sub_form_cols[ $k ] ); |
|
151 | + unset( $sub_form_cols[$k] ); |
|
152 | 152 | continue; |
153 | 153 | } |
154 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
154 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
155 | 155 | unset( $sub_form_col ); |
156 | 156 | } |
157 | 157 | } |
@@ -168,15 +168,15 @@ discard block |
||
168 | 168 | $has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' ); |
169 | 169 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] === 'post_status'; |
170 | 170 | if ( $has_separate_value && ! $is_post_status ) { |
171 | - $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
171 | + $columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
172 | 172 | } |
173 | 173 | |
174 | - $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
174 | + $columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
178 | 178 | if ( FrmAppHelper::ips_saved() ) { |
179 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
179 | + $columns[$form_id . '_ip'] = 'IP'; |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | foreach ( $meta_value as $mk => $mv ) { |
216 | 216 | // Remove blank values. |
217 | 217 | if ( empty( $mv ) ) { |
218 | - unset( $meta_value[ $mk ] ); |
|
218 | + unset( $meta_value[$mk] ); |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | ); |
291 | 291 | |
292 | 292 | if ( ! $form_id ) { |
293 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
294 | - $columns[ $form_id . '_name' ] = 'name'; |
|
295 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
293 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
294 | + $columns[$form_id . '_name'] = 'name'; |
|
295 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | foreach ( $fields as $field ) { |
299 | 299 | if ( self::field_supports_sorting( $field ) ) { |
300 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
300 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $atts['form_id'] . '_item_key' => '', |
385 | 385 | $atts['form_id'] . '_id' => '', |
386 | 386 | ); |
387 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
387 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
388 | 388 | |
389 | 389 | $i = $atts['i']; |
390 | 390 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
397 | 397 | $result[] = $col_key; |
398 | - --$i; |
|
398 | + -- $i; |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | unset( $col_key, $col ); |
@@ -545,9 +545,9 @@ discard block |
||
545 | 545 | if ( ! isset( $frm_vars['form_params'] ) ) { |
546 | 546 | $frm_vars['form_params'] = array(); |
547 | 547 | } |
548 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
548 | + $frm_vars['form_params'][$form->id] = $params; |
|
549 | 549 | |
550 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
550 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
551 | 551 | return; |
552 | 552 | } |
553 | 553 | |
@@ -563,16 +563,16 @@ discard block |
||
563 | 563 | */ |
564 | 564 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
565 | 565 | |
566 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
566 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
567 | 567 | |
568 | 568 | if ( empty( $errors ) ) { |
569 | 569 | $_POST['frm_skip_cookie'] = 1; |
570 | 570 | $do_success = false; |
571 | 571 | if ( $params['action'] === 'create' ) { |
572 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
573 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
572 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
573 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
574 | 574 | |
575 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
575 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
576 | 576 | $do_success = true; |
577 | 577 | } |
578 | 578 | } |
@@ -114,13 +114,16 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public static function value_is_posted( $field, $args ) { |
116 | 116 | $value_is_posted = false; |
117 | - if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
117 | + if ( $_POST ) { |
|
118 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
118 | 119 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
119 | 120 | if ( $repeating ) { |
120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
121 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
122 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
121 | 123 | $value_is_posted = true; |
122 | 124 | } |
123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
125 | + } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
126 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
124 | 127 | $value_is_posted = true; |
125 | 128 | } |
126 | 129 | } |
@@ -322,8 +325,10 @@ discard block |
||
322 | 325 | * @since 4.01 |
323 | 326 | */ |
324 | 327 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
325 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
326 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
328 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
329 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
330 | + if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
331 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
327 | 332 | $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
328 | 333 | } |
329 | 334 | } else { |
@@ -395,7 +400,8 @@ discard block |
||
395 | 400 | self::set_other_repeating_vals( $field, $value, $args ); |
396 | 401 | |
397 | 402 | // Check if there are any posted "Other" values. |
398 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
403 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
404 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
399 | 405 | |
400 | 406 | // Save original value. |
401 | 407 | $args['temp_value'] = $value; |
@@ -425,7 +431,8 @@ discard block |
||
425 | 431 | } |
426 | 432 | |
427 | 433 | // Check if there are any other posted "other" values for this field. |
428 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
434 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
435 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
429 | 436 | // Save original value |
430 | 437 | $args['temp_value'] = $value; |
431 | 438 | $args['other'] = true; |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
138 | 138 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
139 | 139 | if ( $repeating ) { |
140 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
140 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
141 | 141 | $value_is_posted = true; |
142 | 142 | } |
143 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
143 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
144 | 144 | $value_is_posted = true; |
145 | 145 | } |
146 | 146 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
173 | 173 | |
174 | 174 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
175 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
175 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
176 | 176 | if ( ! empty( $add_atts ) ) { |
177 | 177 | $this_atts = array_merge( $atts, $add_atts ); |
178 | 178 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
183 | 183 | |
184 | 184 | // Add the default message. |
185 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
185 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $message; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @return string |
196 | 196 | */ |
197 | 197 | public static function prepare_display_value( $entry, $field, $atts ) { |
198 | - $field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
198 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
199 | 199 | |
200 | 200 | if ( FrmAppHelper::pro_is_installed() ) { |
201 | 201 | $empty = empty( $field_value ); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
221 | 221 | } else { |
222 | 222 | // Get all values for this field. |
223 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
223 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
224 | 224 | |
225 | 225 | if ( $child_values ) { |
226 | 226 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $value = $args['temp_value']; |
339 | 339 | } |
340 | 340 | if ( empty( $args['parent_field_id'] ) ) { |
341 | - $_POST['item_meta'][ $field->id ] = $value; |
|
341 | + $_POST['item_meta'][$field->id] = $value; |
|
342 | 342 | } else { |
343 | 343 | self::set_parent_field_posted_value( $field, $value, $args ); |
344 | 344 | } |
@@ -350,17 +350,17 @@ discard block |
||
350 | 350 | * @since 4.01 |
351 | 351 | */ |
352 | 352 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
353 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
354 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
355 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
353 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
354 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
355 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
356 | 356 | } |
357 | 357 | } else { |
358 | 358 | // All of the section was probably removed. |
359 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
360 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
359 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
360 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
361 | 361 | } |
362 | 362 | |
363 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
363 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -390,9 +390,9 @@ discard block |
||
390 | 390 | private static function get_posted_meta( $field_id, $args ) { |
391 | 391 | if ( empty( $args['parent_field_id'] ) ) { |
392 | 392 | // Sanitizing is done next. |
393 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
393 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
394 | 394 | } else { |
395 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
395 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
396 | 396 | } |
397 | 397 | return $value; |
398 | 398 | } |
@@ -423,14 +423,14 @@ discard block |
||
423 | 423 | self::set_other_repeating_vals( $field, $value, $args ); |
424 | 424 | |
425 | 425 | // Check if there are any posted "Other" values. |
426 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
426 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
427 | 427 | |
428 | 428 | // Save original value. |
429 | 429 | $args['temp_value'] = $value; |
430 | 430 | $args['other'] = true; |
431 | 431 | |
432 | 432 | // Sanitizing is done next. |
433 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
433 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
434 | 434 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
435 | 435 | |
436 | 436 | // Set the validation value now |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | } |
454 | 454 | |
455 | 455 | // Check if there are any other posted "other" values for this field. |
456 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
456 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
457 | 457 | // Save original value |
458 | 458 | $args['temp_value'] = $value; |
459 | 459 | $args['other'] = true; |
460 | 460 | |
461 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
461 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
462 | 462 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
463 | 463 | |
464 | 464 | // Set the validation value now. |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
486 | 486 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
487 | 487 | foreach ( $other_vals as $k => $v ) { |
488 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
488 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
489 | 489 | // If the other box is checked, but doesn't have a value. |
490 | 490 | $value = ''; |
491 | 491 | break; |
@@ -502,25 +502,25 @@ discard block |
||
502 | 502 | |
503 | 503 | // Multi-select dropdown. |
504 | 504 | if ( is_array( $value ) ) { |
505 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
505 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
506 | 506 | |
507 | 507 | if ( $o_key !== false ) { |
508 | 508 | // Modify the original value so other key will be preserved. |
509 | - $value[ $other_key ] = $value[ $o_key ]; |
|
509 | + $value[$other_key] = $value[$o_key]; |
|
510 | 510 | |
511 | 511 | // By default, the array keys will be numeric for multi-select dropdowns. |
512 | 512 | // If going backwards and forwards between pages, the array key will match the other key. |
513 | 513 | if ( $o_key !== $other_key ) { |
514 | - unset( $value[ $o_key ] ); |
|
514 | + unset( $value[$o_key] ); |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | $args['temp_value'] = $value; |
518 | - $value[ $other_key ] = reset( $other_vals ); |
|
519 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
520 | - unset( $value[ $other_key ] ); |
|
518 | + $value[$other_key] = reset( $other_vals ); |
|
519 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
520 | + unset( $value[$other_key] ); |
|
521 | 521 | } |
522 | 522 | } |
523 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
523 | + } elseif ( $field->options[$other_key] == $value ) { |
|
524 | 524 | $value = $other_vals; |
525 | 525 | }//end if |
526 | 526 | }//end if |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | * @return void |
767 | 767 | */ |
768 | 768 | public static function maybe_render_captcha_score( $entry_id ) { |
769 | - $query = array( |
|
769 | + $query = array( |
|
770 | 770 | 'item_id' => (int) $entry_id, |
771 | 771 | 'field_id' => 0, |
772 | 772 | ); |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | public static function get_entry_status_label( $status ) { |
821 | 821 | $statuses = self::get_entry_statuses(); |
822 | 822 | |
823 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
823 | + return $statuses[self::get_entry_status( $status )]; |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | /** |
@@ -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 |
@@ -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'] = '#'; |
@@ -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 |
@@ -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,14 +437,14 @@ 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 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
447 | - if ( $show && self::css_value_is_valid( $settings[ $var ] ) ) { |
|
446 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
447 | + if ( $show && self::css_value_is_valid( $settings[$var] ) ) { |
|
448 | 448 | echo '--' . esc_html( self::clean_var_name( str_replace( '_', '-', $var ) ) ) . ':' . self::css_var_prepare_value( $settings, $var ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
449 | 449 | } |
450 | 450 | } |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @return string |
517 | 517 | */ |
518 | 518 | private static function css_var_prepare_value( $settings, $key ) { |
519 | - $value = $settings[ $key ]; |
|
519 | + $value = $settings[$key]; |
|
520 | 520 | |
521 | 521 | switch ( $key ) { |
522 | 522 | case 'font': |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | break; |
549 | 549 | }//end switch |
550 | 550 | |
551 | - return esc_html( $settings[ $key ] ); |
|
551 | + return esc_html( $settings[$key] ); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | /** |
@@ -597,8 +597,8 @@ discard block |
||
597 | 597 | |
598 | 598 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
599 | 599 | foreach ( $checkbox_opts as $opt ) { |
600 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
601 | - $settings[ $opt ] = 0; |
|
600 | + if ( ! isset( $settings[$opt] ) ) { |
|
601 | + $settings[$opt] = 0; |
|
602 | 602 | } |
603 | 603 | } |
604 | 604 | |
@@ -646,9 +646,9 @@ discard block |
||
646 | 646 | ); |
647 | 647 | |
648 | 648 | array_map( |
649 | - function ( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
650 | - if ( isset( $settings[ $key ] ) ) { |
|
651 | - $settings[ $key ] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
649 | + function( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
650 | + if ( isset( $settings[$key] ) ) { |
|
651 | + $settings[$key] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
652 | 652 | } |
653 | 653 | }, |
654 | 654 | $font_sizes_to_update |
@@ -665,11 +665,11 @@ discard block |
||
665 | 665 | * @return float |
666 | 666 | */ |
667 | 667 | private static function get_base_font_size_scale( $key, $value, $defaults ) { |
668 | - if ( empty( $defaults[ $key ] ) || ! is_numeric( (int) $defaults[ $key ] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
668 | + if ( empty( $defaults[$key] ) || ! is_numeric( (int) $defaults[$key] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
669 | 669 | return 1; |
670 | 670 | } |
671 | 671 | |
672 | - return round( (int) $defaults[ $key ] / (int) $value, 2 ); |
|
672 | + return round( (int) $defaults[$key] / (int) $value, 2 ); |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | /** |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | $css = ''; |
683 | 683 | } |
684 | 684 | foreach ( $opts as $opt ) { |
685 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
685 | + self::get_color_output( $css, $settings[$opt] ); |
|
686 | 686 | } |
687 | 687 | } |
688 | 688 | } |
@@ -895,13 +895,13 @@ discard block |
||
895 | 895 | */ |
896 | 896 | private static function get_default_style_count( $style_id, $conversational_style_id ) { |
897 | 897 | $substrings = array_map( |
898 | - function ( $value ) { |
|
898 | + function( $value ) { |
|
899 | 899 | $substring = serialize( array( 'custom_style' => $value ) ); |
900 | 900 | return substr( $substring, 5, -1 ); |
901 | 901 | }, |
902 | 902 | array( '1', 1 ) |
903 | 903 | ); |
904 | - $where = array( |
|
904 | + $where = array( |
|
905 | 905 | 'status' => 'published', |
906 | 906 | 0 => array( |
907 | 907 | '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 |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | if ( isset( $addon['categories'] ) ) { |
106 | 106 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
107 | 107 | if ( ! empty( $cats ) ) { |
108 | - unset( $addons[ $k ] ); |
|
108 | + unset( $addons[$k] ); |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | 113 | if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) { |
114 | - $addons[ $k ]['is_new'] = $this->is_new( $addon ); |
|
114 | + $addons[$k]['is_new'] = $this->is_new( $addon ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | return $addon; |
154 | 154 | } |
155 | 155 | } |
156 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
157 | - $plugin = $addons[ $download_id ]; |
|
156 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
157 | + $plugin = $addons[$download_id]; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return $plugin; |