@@ -472,8 +472,8 @@ discard block |
||
472 | 472 | return $values; |
473 | 473 | } |
474 | 474 | |
475 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
476 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
475 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
476 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | $frm_vars['trans_filled'] = true; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | * @param Closure $destroy_callback |
509 | 509 | * @return void |
510 | 510 | */ |
511 | - function () use ( $entry_id, &$destroy_callback ) { |
|
511 | + function() use ( $entry_id, &$destroy_callback ) { |
|
512 | 512 | FrmEntry::destroy( $entry_id ); |
513 | 513 | // Only call this once. |
514 | 514 | remove_action( 'frm_entry_form', $destroy_callback ); |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | * @return array |
529 | 529 | */ |
530 | 530 | public static function before_save_settings( $settings, $action ) { |
531 | - $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
531 | + $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
532 | 532 | |
533 | 533 | if ( in_array( 'square', $settings['gateway'] ) ) { |
534 | 534 | $currency = FrmSquareLiteConnectHelper::get_merchant_currency(); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $section['function'] = $original; |
174 | 174 | } |
175 | 175 | |
176 | - $sections[ $key ] = $section; |
|
176 | + $sections[$key] = $section; |
|
177 | 177 | }//end foreach |
178 | 178 | |
179 | 179 | return $sections; |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | |
194 | 194 | foreach ( $sections as $key => $section ) { |
195 | 195 | if ( in_array( $key, $payment_section_keys, true ) ) { |
196 | - self::$removed_payments_sections[ $key ] = $section; |
|
197 | - unset( $sections[ $key ] ); |
|
196 | + self::$removed_payments_sections[$key] = $section; |
|
197 | + unset( $sections[$key] ); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | |
227 | 227 | $section = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' ); |
228 | 228 | $sections = self::get_settings_tabs(); |
229 | - if ( ! isset( $sections[ $section ] ) ) { |
|
229 | + if ( ! isset( $sections[$section] ) ) { |
|
230 | 230 | wp_die(); |
231 | 231 | } |
232 | 232 | |
233 | - $section = $sections[ $section ]; |
|
233 | + $section = $sections[$section]; |
|
234 | 234 | |
235 | 235 | if ( isset( $section['class'] ) ) { |
236 | 236 | call_user_func( array( $section['class'], $section['function'] ) ); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | $_GET['page'] = 'formidable'; |
27 | 27 | |
28 | - $values = array( |
|
28 | + $values = array( |
|
29 | 29 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
30 | 30 | 'doing_ajax' => true, |
31 | 31 | ); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | ob_start(); |
50 | 50 | self::load_single_field( $field, $values ); |
51 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
51 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
52 | 52 | ob_end_clean(); |
53 | 53 | } |
54 | 54 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | foreach ( $opts as $opt_key => $opt ) { |
264 | 264 | if ( strpos( $opt, '|' ) !== false ) { |
265 | 265 | $vals = explode( '|', $opt ); |
266 | - $opts[ $opt_key ] = array( |
|
266 | + $opts[$opt_key] = array( |
|
267 | 267 | 'label' => trim( $vals[0] ), |
268 | 268 | 'value' => trim( $vals[1] ), |
269 | 269 | ); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $other_array = array(); |
279 | 279 | foreach ( $field['options'] as $opt_key => $opt ) { |
280 | 280 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
281 | - $other_array[ $opt_key ] = $opt; |
|
281 | + $other_array[$opt_key] = $opt; |
|
282 | 282 | } |
283 | 283 | unset( $opt_key, $opt ); |
284 | 284 | } |
@@ -321,18 +321,18 @@ discard block |
||
321 | 321 | $frm_settings = FrmAppHelper::get_settings(); |
322 | 322 | $field_types = FrmFieldTypeOptionData::get_field_types( $field['type'] ); |
323 | 323 | |
324 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
324 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
325 | 325 | // Add fallback for an add-on field type that has been deactivated. |
326 | - $all_field_types[ $field['type'] ] = array( |
|
326 | + $all_field_types[$field['type']] = array( |
|
327 | 327 | 'name' => ucfirst( $field['type'] ), |
328 | 328 | 'icon' => 'frm_icon_font frm_pencil_icon', |
329 | 329 | ); |
330 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
330 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
331 | 331 | // Fallback for fields added in a more basic way. |
332 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
332 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
333 | 333 | } |
334 | 334 | |
335 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
335 | + $type_name = $all_field_types[$field['type']]['name']; |
|
336 | 336 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
337 | 337 | $type_name = $all_field_types['divider|repeat']['name']; |
338 | 338 | } |
@@ -409,14 +409,14 @@ discard block |
||
409 | 409 | |
410 | 410 | if ( FrmAppHelper::pro_is_connected() ) { |
411 | 411 | foreach ( $settings as $type ) { |
412 | - if ( ! empty( $field[ $type ] ) ) { |
|
412 | + if ( ! empty( $field[$type] ) ) { |
|
413 | 413 | $active = $type; |
414 | 414 | } |
415 | 415 | } |
416 | 416 | } |
417 | 417 | |
418 | - $types[ $active ]['class'] .= ' current'; |
|
419 | - $types[ $active ]['current'] = true; |
|
418 | + $types[$active]['class'] .= ' current'; |
|
419 | + $types[$active]['current'] = true; |
|
420 | 420 | |
421 | 421 | return $types; |
422 | 422 | } |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | 'website' => 'url', |
435 | 435 | 'image' => 'url', |
436 | 436 | ); |
437 | - if ( isset( $type_switch[ $type ] ) ) { |
|
438 | - $type = $type_switch[ $type ]; |
|
437 | + if ( isset( $type_switch[$type] ) ) { |
|
438 | + $type = $type_switch[$type]; |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | $pro_fields = FrmField::pro_field_selection(); |
@@ -590,11 +590,11 @@ discard block |
||
590 | 590 | // include "col" for valid html |
591 | 591 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
592 | 592 | |
593 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
593 | + if ( ! isset( $calc[$unit] ) ) { |
|
594 | 594 | return; |
595 | 595 | } |
596 | 596 | |
597 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
597 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
598 | 598 | |
599 | 599 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
600 | 600 | } |
@@ -827,11 +827,11 @@ discard block |
||
827 | 827 | private static function get_form_for_js_validation( $field ) { |
828 | 828 | global $frm_vars; |
829 | 829 | if ( ! empty( $frm_vars['js_validate_forms'] ) ) { |
830 | - if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) { |
|
831 | - return $frm_vars['js_validate_forms'][ $field['form_id'] ]; |
|
830 | + if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) { |
|
831 | + return $frm_vars['js_validate_forms'][$field['form_id']]; |
|
832 | 832 | } |
833 | - if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) { |
|
834 | - return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ]; |
|
833 | + if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) { |
|
834 | + return $frm_vars['js_validate_forms'][$field['parent_form_id']]; |
|
835 | 835 | } |
836 | 836 | } |
837 | 837 | return false; |
@@ -918,13 +918,13 @@ discard block |
||
918 | 918 | foreach ( $field['shortcodes'] as $k => $v ) { |
919 | 919 | if ( isset( $field['subfield_name'] ) && 0 === strpos( $k, 'aria-invalid' ) ) { |
920 | 920 | $subfield_name = $field['subfield_name']; |
921 | - if ( ! isset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ) ) { |
|
921 | + if ( ! isset( $field['shortcodes']['aria-invalid-' . $subfield_name] ) ) { |
|
922 | 922 | continue; |
923 | 923 | } |
924 | 924 | // Change the key to the correct aria-invalid value so that $add_html is set correctly for the current subfield of a combo field. |
925 | 925 | $k = 'aria-invalid'; |
926 | - $v = $field['shortcodes'][ 'aria-invalid-' . $subfield_name ]; |
|
927 | - unset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ); |
|
926 | + $v = $field['shortcodes']['aria-invalid-' . $subfield_name]; |
|
927 | + unset( $field['shortcodes']['aria-invalid-' . $subfield_name] ); |
|
928 | 928 | } |
929 | 929 | if ( 'opt' === $k || ! self::should_allow_input_attribute( $k ) ) { |
930 | 930 | continue; |
@@ -932,10 +932,10 @@ discard block |
||
932 | 932 | |
933 | 933 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
934 | 934 | $add_html[] = $v; |
935 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
936 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
935 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
936 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
937 | 937 | } else { |
938 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
938 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
939 | 939 | } |
940 | 940 | |
941 | 941 | unset( $k, $v ); |
@@ -31,8 +31,8 @@ |
||
31 | 31 | if ( $is_active ) { |
32 | 32 | $input_params['checked'] = 'checked'; |
33 | 33 | } |
34 | - $other_section_selectors = array_map( |
|
35 | - function ( $section ) { |
|
34 | + $other_section_selectors = array_map( |
|
35 | + function( $section ) { |
|
36 | 36 | return "#frm_{$section}_settings_section"; |
37 | 37 | }, |
38 | 38 | array_diff( array_keys( $payment_sections ), array( $key ) ) |
@@ -8,7 +8,7 @@ |
||
8 | 8 | <?php esc_html_e( 'Content', 'formidable' ); ?> |
9 | 9 | </label> |
10 | 10 | <?php |
11 | - $e_args = array( |
|
11 | + $e_args = array( |
|
12 | 12 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
13 | 13 | 'textarea_rows' => 7, |
14 | 14 | ); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if ( FrmAppHelper::pro_is_connected() && ! is_callable( array( 'FrmProHtmlHelper', 'echo_radio_group' ) ) ) { |
190 | 190 | switch ( $type ) { |
191 | 191 | case 'calc': |
192 | - $default_value_type['data'] = array( |
|
192 | + $default_value_type['data'] = array( |
|
193 | 193 | 'show' => '#calc-for-{id}', |
194 | 194 | 'disable' => '#default-value-for-{id}', |
195 | 195 | ); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | ); |
217 | 217 | |
218 | 218 | foreach ( $default_value_type['data'] as $data_key => $data_value ) { |
219 | - $toggle_args['input_html'][ 'data-' . $data_key ] = $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' ); |
|
219 | + $toggle_args['input_html']['data-' . $data_key] = $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' ); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | ?> |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | public function __construct( $data ) { |
90 | 90 | $sections = array( 'counters', 'license', 'get_free_templates', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
91 | 91 | foreach ( $sections as $section ) { |
92 | - if ( isset( $data[ $section ] ) ) { |
|
93 | - $this->view[ $section ] = $data[ $section ]; |
|
92 | + if ( isset( $data[$section] ) ) { |
|
93 | + $this->view[$section] = $data[$section]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | private static function load_entries_list_template( $template ) { |
366 | 366 | add_filter( |
367 | 367 | 'formidable_page_formidable_entries_per_page', |
368 | - function () { |
|
368 | + function() { |
|
369 | 369 | return 7; |
370 | 370 | } |
371 | 371 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // Check if the selected style is available and selectable. |
91 | 91 | $styles = self::get_email_styles(); |
92 | 92 | $style = $frm_settings->email_style; |
93 | - if ( isset( $styles[ $style ] ) && ! empty( $styles[ $style ]['selectable'] ) ) { |
|
93 | + if ( isset( $styles[$style] ) && ! empty( $styles[$style]['selectable'] ) ) { |
|
94 | 94 | return $style; |
95 | 95 | } |
96 | 96 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | $styles = self::get_email_styles(); |
252 | - if ( ! isset( $styles[ $style_key ] ) ) { |
|
252 | + if ( ! isset( $styles[$style_key] ) ) { |
|
253 | 253 | die( esc_html( $not_exist_msg ) ); |
254 | 254 | } |
255 | 255 |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | 'description' => esc_html__( 'Just add your email address and you\'ll get 30+ free form templates to your account.', 'formidable' ), |
240 | 240 | 'submit_button_text' => esc_html_x( 'Get Templates', 'get free templates modal submit button text', 'formidable' ), |
241 | 241 | ); |
242 | - $view_parts[] = 'modals/leave-email-modal.php'; |
|
242 | + $view_parts[] = 'modals/leave-email-modal.php'; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | // Add 'upgrade' modal view for non-elite users. |
@@ -338,11 +338,11 @@ discard block |
||
338 | 338 | |
339 | 339 | // Perform add or remove operation. |
340 | 340 | if ( 'add' === $operation ) { |
341 | - self::$favorite_templates[ $key ][] = $template_id; |
|
341 | + self::$favorite_templates[$key][] = $template_id; |
|
342 | 342 | } elseif ( 'remove' === $operation ) { |
343 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
343 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
344 | 344 | if ( $position !== false ) { |
345 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
345 | + unset( self::$favorite_templates[$key][$position] ); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | foreach ( self::$templates as $key => &$template ) { |
501 | 501 | // Skip the template if the categories are not set. |
502 | 502 | if ( ! isset( $template['categories'] ) || ! isset( $template['id'] ) ) { |
503 | - unset( self::$templates[ $key ] ); |
|
503 | + unset( self::$templates[$key] ); |
|
504 | 504 | continue; |
505 | 505 | } |
506 | 506 | |
@@ -514,14 +514,12 @@ discard block |
||
514 | 514 | // Add the slug to the new array. |
515 | 515 | $template['category_slugs'][] = $category_slug; |
516 | 516 | |
517 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
518 | - self::$categories[ $category_slug ] = array( |
|
517 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
518 | + self::$categories[$category_slug] = array( |
|
519 | 519 | 'name' => $category, |
520 | 520 | 'count' => 0, |
521 | 521 | ); |
522 | - } |
|
523 | - |
|
524 | - ++self::$categories[ $category_slug ]['count']; |
|
522 | + } ++self::$categories[$category_slug]['count']; |
|
525 | 523 | } |
526 | 524 | |
527 | 525 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -536,7 +534,7 @@ discard block |
||
536 | 534 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::get_license_types() ); |
537 | 535 | foreach ( $redundant_cats as $redundant_cat ) { |
538 | 536 | $category_slug = sanitize_title( $redundant_cat ); |
539 | - unset( self::$categories[ $category_slug ] ); |
|
537 | + unset( self::$categories[$category_slug] ); |
|
540 | 538 | } |
541 | 539 | |
542 | 540 | // Sort the categories by keys alphabetically. |
@@ -561,7 +559,7 @@ discard block |
||
561 | 559 | 'count' => 0, |
562 | 560 | ); |
563 | 561 | } |
564 | - $special_categories['all-items'] = array( |
|
562 | + $special_categories['all-items'] = array( |
|
565 | 563 | 'name' => __( 'All Templates', 'formidable' ), |
566 | 564 | 'count' => self::get_template_count(), |
567 | 565 | ); |
@@ -584,9 +582,9 @@ discard block |
||
584 | 582 | */ |
585 | 583 | private static function assign_featured_templates() { |
586 | 584 | foreach ( self::FEATURED_TEMPLATES_IDS as $key ) { |
587 | - if ( isset( self::$templates[ $key ] ) ) { |
|
588 | - self::$templates[ $key ]['is_featured'] = true; |
|
589 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
585 | + if ( isset( self::$templates[$key] ) ) { |
|
586 | + self::$templates[$key]['is_featured'] = true; |
|
587 | + self::$featured_templates[] = self::$templates[$key]; |
|
590 | 588 | } |
591 | 589 | } |
592 | 590 | } |