@@ -1082,7 +1082,8 @@ |
||
1082 | 1082 | private static function maybe_get_form_to_show( $id ) { |
1083 | 1083 | $form = false; |
1084 | 1084 | |
1085 | - if ( ! empty( $id ) ) { // no form id or key set |
|
1085 | + if ( ! empty( $id ) ) { |
|
1086 | +// no form id or key set |
|
1086 | 1087 | $form = FrmForm::getOne( $id ); |
1087 | 1088 | if ( ! $form || $form->parent_form_id || $form->status == 'trash' ) { |
1088 | 1089 | $form = false; |
@@ -1126,6 +1126,7 @@ discard block |
||
1126 | 1126 | * Get an array of the helper shortcodes to display in the customization panel |
1127 | 1127 | * |
1128 | 1128 | * @since 2.0.6 |
1129 | + * @param boolean $settings_tab |
|
1129 | 1130 | */ |
1130 | 1131 | private static function get_shortcode_helpers( $settings_tab ) { |
1131 | 1132 | $entry_shortcodes = array( |
@@ -1204,6 +1205,9 @@ discard block |
||
1204 | 1205 | return $content; |
1205 | 1206 | } |
1206 | 1207 | |
1208 | + /** |
|
1209 | + * @param boolean $entry |
|
1210 | + */ |
|
1207 | 1211 | private static function get_entry_by_param( &$entry ) { |
1208 | 1212 | if ( ! $entry || ! is_object( $entry ) ) { |
1209 | 1213 | if ( ! $entry || ! is_numeric( $entry ) ) { |
@@ -1498,6 +1502,9 @@ discard block |
||
1498 | 1502 | return $form; |
1499 | 1503 | } |
1500 | 1504 | |
1505 | + /** |
|
1506 | + * @param string $id |
|
1507 | + */ |
|
1501 | 1508 | private static function maybe_get_form_to_show( $id ) { |
1502 | 1509 | $form = false; |
1503 | 1510 | |
@@ -1921,6 +1928,7 @@ discard block |
||
1921 | 1928 | |
1922 | 1929 | /** |
1923 | 1930 | * @since 2.0.8 |
1931 | + * @param string $content |
|
1924 | 1932 | */ |
1925 | 1933 | private static function maybe_minimize_form( $atts, &$content ) { |
1926 | 1934 | // check if minimizing is turned on |
@@ -418,11 +418,11 @@ discard block |
||
418 | 418 | ), |
419 | 419 | ); |
420 | 420 | |
421 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
421 | + if ( ! isset( $available_status[$status] ) ) { |
|
422 | 422 | return; |
423 | 423 | } |
424 | 424 | |
425 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
425 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
426 | 426 | |
427 | 427 | $params = FrmForm::list_page_params(); |
428 | 428 | |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | check_admin_referer( $status . '_form_' . $params['id'] ); |
431 | 431 | |
432 | 432 | $count = 0; |
433 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
433 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
434 | 434 | $count ++; |
435 | 435 | } |
436 | 436 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
448 | 448 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
449 | 449 | |
450 | - $message = $available_status[ $status ]['message']; |
|
450 | + $message = $available_status[$status]['message']; |
|
451 | 451 | |
452 | 452 | self::display_forms_list( $params, $message ); |
453 | 453 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | 'type' => 'request', |
469 | 469 | ) |
470 | 470 | ); |
471 | - $message = sprintf( |
|
471 | + $message = sprintf( |
|
472 | 472 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
473 | 473 | _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), |
474 | 474 | $count, |
@@ -834,11 +834,11 @@ discard block |
||
834 | 834 | } |
835 | 835 | |
836 | 836 | foreach ( $template['categories'] as $category ) { |
837 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
838 | - $templates_by_category[ $category ] = array(); |
|
837 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
838 | + $templates_by_category[$category] = array(); |
|
839 | 839 | } |
840 | 840 | |
841 | - $templates_by_category[ $category ][] = $template; |
|
841 | + $templates_by_category[$category][] = $template; |
|
842 | 842 | } |
843 | 843 | } |
844 | 844 | unset( $template ); |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | $forms = FrmForm::get_published_forms( $where ); |
865 | 865 | $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/'; |
866 | 866 | |
867 | - $templates_by_category[ $my_templates_translation ] = $custom_templates; |
|
867 | + $templates_by_category[$my_templates_translation] = $custom_templates; |
|
868 | 868 | |
869 | 869 | unset( $pricing, $license_type, $where ); |
870 | 870 | wp_enqueue_script( 'accordion' ); // register accordion for template groups |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | $section['id'] = $section['anchor']; |
1079 | 1079 | } |
1080 | 1080 | |
1081 | - $sections[ $key ] = $section; |
|
1081 | + $sections[$key] = $section; |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | return $sections; |
@@ -1160,7 +1160,7 @@ discard block |
||
1160 | 1160 | if ( ! empty( $user_fields ) ) { |
1161 | 1161 | $user_helpers = array(); |
1162 | 1162 | foreach ( $user_fields as $uk => $uf ) { |
1163 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1163 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1164 | 1164 | unset( $uk, $uf ); |
1165 | 1165 | } |
1166 | 1166 | |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1398 | 1398 | } else { |
1399 | 1399 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1400 | - $action = $vars[ $action ]; |
|
1400 | + $action = $vars[$action]; |
|
1401 | 1401 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); |
1402 | 1402 | $_REQUEST = array_merge( $_REQUEST, $vars ); |
1403 | 1403 | $_POST = array_merge( $_POST, $_REQUEST ); |
@@ -1523,7 +1523,7 @@ discard block |
||
1523 | 1523 | $actions = array(); |
1524 | 1524 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1525 | 1525 | if ( is_object( $form ) ) { |
1526 | - $actions[ $form->id ] = $form->name; |
|
1526 | + $actions[$form->id] = $form->name; |
|
1527 | 1527 | } |
1528 | 1528 | unset( $form ); |
1529 | 1529 | } |
@@ -1732,8 +1732,8 @@ discard block |
||
1732 | 1732 | private static function get_saved_errors( $form, $params ) { |
1733 | 1733 | global $frm_vars; |
1734 | 1734 | |
1735 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
1736 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
1735 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { |
|
1736 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
1737 | 1737 | } else { |
1738 | 1738 | $errors = array(); |
1739 | 1739 | } |
@@ -1747,7 +1747,7 @@ discard block |
||
1747 | 1747 | public static function just_created_entry( $form_id ) { |
1748 | 1748 | global $frm_vars; |
1749 | 1749 | |
1750 | - return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
1750 | + return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
1751 | 1751 | } |
1752 | 1752 | |
1753 | 1753 | /** |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | */ |
1756 | 1756 | private static function get_confirmation_method( $atts ) { |
1757 | 1757 | $opt = 'success_action'; |
1758 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
1758 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
1759 | 1759 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
1760 | 1760 | |
1761 | 1761 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
1769 | 1769 | if ( ! isset( $params['id'] ) ) { |
1770 | 1770 | global $frm_vars; |
1771 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
1771 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
1772 | 1772 | } |
1773 | 1773 | |
1774 | 1774 | $conf_method = self::get_confirmation_method( |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | $opt = ( ! isset( $args['action'] ) || $args['action'] == 'create' ) ? 'success' : 'edit'; |
1813 | 1813 | |
1814 | 1814 | $args['success_opt'] = $opt; |
1815 | - if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
1815 | + if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
1816 | 1816 | self::load_page_after_submit( $args ); |
1817 | 1817 | } elseif ( $args['conf_method'] == 'redirect' ) { |
1818 | 1818 | self::redirect_after_submit( $args ); |
@@ -1827,8 +1827,8 @@ discard block |
||
1827 | 1827 | private static function load_page_after_submit( $args ) { |
1828 | 1828 | global $post; |
1829 | 1829 | $opt = $args['success_opt']; |
1830 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
1831 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
1830 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
1831 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
1832 | 1832 | $old_post = $post; |
1833 | 1833 | $post = $page; |
1834 | 1834 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -1846,11 +1846,11 @@ discard block |
||
1846 | 1846 | add_filter( 'frm_use_wpautop', '__return_false' ); |
1847 | 1847 | |
1848 | 1848 | $opt = $args['success_opt']; |
1849 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
1849 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
1850 | 1850 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
1851 | 1851 | $success_url = do_shortcode( $success_url ); |
1852 | 1852 | |
1853 | - $success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1853 | + $success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1854 | 1854 | |
1855 | 1855 | $redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args ); |
1856 | 1856 | |
@@ -1986,7 +1986,7 @@ discard block |
||
1986 | 1986 | 'description' => false, |
1987 | 1987 | 'reset' => false, |
1988 | 1988 | ); |
1989 | - $args = wp_parse_args( $args, $defaults ); |
|
1989 | + $args = wp_parse_args( $args, $defaults ); |
|
1990 | 1990 | } |
1991 | 1991 | |
1992 | 1992 | /** |
@@ -75,7 +75,7 @@ |
||
75 | 75 | /** |
76 | 76 | * FrmFieldValueSelector constructor |
77 | 77 | * |
78 | - * @param int|string $field_id |
|
78 | + * @param integer $field_id |
|
79 | 79 | */ |
80 | 80 | public function __construct( $field_id, $args ) { |
81 | 81 | $this->set_html_name( $args ); |
@@ -285,7 +285,7 @@ |
||
285 | 285 | 'type' => $field->type, |
286 | 286 | ); |
287 | 287 | |
288 | - $this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
288 | + $this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | * |
364 | 364 | * @since 2.04 |
365 | 365 | * |
366 | - * @param array $field_values |
|
366 | + * @param FrmFieldValue[] $field_values |
|
367 | 367 | * @param array $output |
368 | 368 | */ |
369 | 369 | protected function push_field_values_to_array( $field_values, &$output ) { |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | * |
571 | 571 | * @param mixed $value |
572 | 572 | * |
573 | - * @return mixed|string |
|
573 | + * @return FrmFieldValue |
|
574 | 574 | */ |
575 | 575 | protected function prepare_display_value_for_array( $value ) { |
576 | 576 | return $this->strip_html( $value ); |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | * @param mixed $display_value |
586 | 586 | * @param string $field_type |
587 | 587 | * |
588 | - * @return mixed|string |
|
588 | + * @return string |
|
589 | 589 | */ |
590 | 590 | protected function prepare_display_value_for_html_table( $display_value, $field_type = '' ) { |
591 | 591 | $display_value = $this->flatten_array( $display_value ); |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | |
162 | 162 | $conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' ); |
163 | 163 | foreach ( $conditionally_add as $index ) { |
164 | - if ( isset( $atts[ $index ] ) ) { |
|
165 | - $entry_atts[ $index ] = $atts[ $index ]; |
|
164 | + if ( isset( $atts[$index] ) ) { |
|
165 | + $entry_atts[$index] = $atts[$index]; |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
@@ -331,8 +331,8 @@ discard block |
||
331 | 331 | |
332 | 332 | $unset = array( 'id', 'entry', 'form_id', 'format' ); |
333 | 333 | foreach ( $unset as $param ) { |
334 | - if ( isset( $atts[ $param ] ) ) { |
|
335 | - unset( $atts[ $param ] ); |
|
334 | + if ( isset( $atts[$param] ) ) { |
|
335 | + unset( $atts[$param] ); |
|
336 | 336 | } |
337 | 337 | } |
338 | 338 | |
@@ -485,11 +485,11 @@ discard block |
||
485 | 485 | |
486 | 486 | $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() ); |
487 | 487 | |
488 | - $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value; |
|
488 | + $output[$this->get_key_or_id( $field_value )] = $displayed_value; |
|
489 | 489 | |
490 | 490 | $has_separate_value = (bool) $field_value->get_field_option( 'separate_value' ); |
491 | 491 | if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) { |
492 | - $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value(); |
|
492 | + $output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value(); |
|
493 | 493 | } |
494 | 494 | } |
495 | 495 | } |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | |
877 | 877 | if ( is_array( $value ) ) { |
878 | 878 | foreach ( $value as $key => $single_value ) { |
879 | - $value[ $key ] = $this->strip_html( $single_value ); |
|
879 | + $value[$key] = $this->strip_html( $single_value ); |
|
880 | 880 | } |
881 | 881 | } elseif ( $this->is_plain_text && ! is_array( $value ) ) { |
882 | 882 | if ( strpos( $value, '<img' ) !== false ) { |
@@ -86,7 +86,7 @@ |
||
86 | 86 | 'captcha' => 'FrmFieldCaptcha', |
87 | 87 | ); |
88 | 88 | |
89 | - $class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : ''; |
|
89 | + $class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : ''; |
|
90 | 90 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
91 | 91 | } |
92 | 92 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @since 3.0 |
56 | 56 | * |
57 | 57 | * @param string $field_type |
58 | - * @param int|array|object $field |
|
58 | + * @param integer $field |
|
59 | 59 | * |
60 | 60 | * @return stdClass |
61 | 61 | */ |
@@ -111,6 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | /** |
113 | 113 | * @since 3.0 |
114 | + * @param string $property |
|
114 | 115 | */ |
115 | 116 | public static function field_has_property( $type, $property ) { |
116 | 117 | $field = self::get_field_type( $type ); |
@@ -246,6 +246,7 @@ |
||
246 | 246 | |
247 | 247 | /** |
248 | 248 | * @since 3.0 |
249 | + * @param stdClass $field_info |
|
249 | 250 | */ |
250 | 251 | private static function get_classes_for_builder_field( $field, $display, $field_info ) { |
251 | 252 | $li_classes = $field_info->form_builder_classes( $display['type'] ); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $_GET['page'] = 'formidable'; |
15 | 15 | |
16 | - $values = array( |
|
16 | + $values = array( |
|
17 | 17 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
18 | 18 | 'doing_ajax' => true, |
19 | 19 | ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | ob_start(); |
38 | 38 | self::load_single_field( $field, $values ); |
39 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
39 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
40 | 40 | ob_end_clean(); |
41 | 41 | } |
42 | 42 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | foreach ( $opts as $opt_key => $opt ) { |
238 | 238 | if ( strpos( $opt, '|' ) !== false ) { |
239 | 239 | $vals = explode( '|', $opt ); |
240 | - $opts[ $opt_key ] = array( |
|
240 | + $opts[$opt_key] = array( |
|
241 | 241 | 'label' => trim( $vals[0] ), |
242 | 242 | 'value' => trim( $vals[1] ), |
243 | 243 | ); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $other_array = array(); |
253 | 253 | foreach ( $field['options'] as $opt_key => $opt ) { |
254 | 254 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
255 | - $other_array[ $opt_key ] = $opt; |
|
255 | + $other_array[$opt_key] = $opt; |
|
256 | 256 | } |
257 | 257 | unset( $opt_key, $opt ); |
258 | 258 | } |
@@ -294,18 +294,18 @@ discard block |
||
294 | 294 | $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection; |
295 | 295 | $frm_settings = FrmAppHelper::get_settings(); |
296 | 296 | |
297 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
297 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
298 | 298 | // Add fallback for an add-on field type that has been deactivated. |
299 | - $all_field_types[ $field['type'] ] = array( |
|
299 | + $all_field_types[$field['type']] = array( |
|
300 | 300 | 'name' => ucfirst( $field['type'] ), |
301 | 301 | 'icon' => 'frm_icon_font frm_pencil_icon', |
302 | 302 | ); |
303 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
303 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
304 | 304 | // Fallback for fields added in a more basic way. |
305 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
305 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
306 | 306 | } |
307 | 307 | |
308 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
308 | + $type_name = $all_field_types[$field['type']]['name']; |
|
309 | 309 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
310 | 310 | $type_name = $all_field_types['divider|repeat']['name']; |
311 | 311 | } |
@@ -387,13 +387,13 @@ discard block |
||
387 | 387 | $active = 'default_value'; |
388 | 388 | |
389 | 389 | foreach ( $settings as $type ) { |
390 | - if ( ! empty( $field[ $type ] ) ) { |
|
390 | + if ( ! empty( $field[$type] ) ) { |
|
391 | 391 | $active = $type; |
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
395 | - $types[ $active ]['class'] .= ' current'; |
|
396 | - $types[ $active ]['current'] = true; |
|
395 | + $types[$active]['class'] .= ' current'; |
|
396 | + $types[$active]['current'] = true; |
|
397 | 397 | |
398 | 398 | return $types; |
399 | 399 | } |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | 'website' => 'url', |
408 | 408 | 'image' => 'url', |
409 | 409 | ); |
410 | - if ( isset( $type_switch[ $type ] ) ) { |
|
411 | - $type = $type_switch[ $type ]; |
|
410 | + if ( isset( $type_switch[$type] ) ) { |
|
411 | + $type = $type_switch[$type]; |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | $pro_fields = FrmField::pro_field_selection(); |
@@ -532,11 +532,11 @@ discard block |
||
532 | 532 | // include "col" for valid html |
533 | 533 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
534 | 534 | |
535 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
535 | + if ( ! isset( $calc[$unit] ) ) { |
|
536 | 536 | return; |
537 | 537 | } |
538 | 538 | |
539 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
539 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
540 | 540 | |
541 | 541 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
542 | 542 | } |
@@ -696,10 +696,10 @@ discard block |
||
696 | 696 | |
697 | 697 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
698 | 698 | $add_html[] = $v; |
699 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
700 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
699 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
700 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
701 | 701 | } else { |
702 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
702 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | unset( $k, $v ); |
@@ -149,6 +149,9 @@ |
||
149 | 149 | return $name; |
150 | 150 | } |
151 | 151 | |
152 | + /** |
|
153 | + * @param string $version |
|
154 | + */ |
|
152 | 155 | private static function get_css_version( $css_key, $version ) { |
153 | 156 | if ( 'formidable' == $css_key ) { |
154 | 157 | $this_version = get_option( 'frm_last_style_update' ); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $styles = $frm_style->get_all(); |
235 | 235 | |
236 | 236 | if ( is_numeric( $style ) ) { |
237 | - $style = $styles[ $style ]; |
|
237 | + $style = $styles[$style]; |
|
238 | 238 | } elseif ( 'default' == $style ) { |
239 | 239 | $style = $frm_style->get_default_style( $styles ); |
240 | 240 | } |
@@ -270,8 +270,8 @@ discard block |
||
270 | 270 | |
271 | 271 | $forms = FrmForm::get_published_forms(); |
272 | 272 | foreach ( $forms as $form ) { |
273 | - $new_style = ( isset( $_POST['style'] ) && isset( $_POST['style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ) : ''; |
|
274 | - $previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][ $form->id ] ) ) : ''; |
|
273 | + $new_style = ( isset( $_POST['style'] ) && isset( $_POST['style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ) : ''; |
|
274 | + $previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][$form->id] ) ) : ''; |
|
275 | 275 | if ( $new_style == $previous_style ) { |
276 | 276 | continue; |
277 | 277 | } |
@@ -530,8 +530,8 @@ discard block |
||
530 | 530 | */ |
531 | 531 | public static function get_style_val( $val, $form = 'default' ) { |
532 | 532 | $style = self::get_form_style( $form ); |
533 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
534 | - return $style->post_content[ $val ]; |
|
533 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
534 | + return $style->post_content[$val]; |
|
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | } elseif ( 'alt_bg_color' == $name ) { |
551 | 551 | $setting = 'bg_color_active'; |
552 | 552 | } |
553 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
553 | + $default_styles[$name] = $style->post_content[$setting]; |
|
554 | 554 | unset( $name, $val ); |
555 | 555 | } |
556 | 556 |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | <?php |
8 | 8 | foreach ( $type as $tb_type ) { |
9 | 9 | |
10 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
10 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
11 | 11 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
12 | 12 | continue; |
13 | 13 | } |
14 | 14 | |
15 | 15 | //no records |
16 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
16 | + if ( ! isset( $records[$tb_type] ) ) { |
|
17 | 17 | continue; |
18 | 18 | } |
19 | 19 | |
20 | - $item_ids = $records[ $tb_type ]; |
|
20 | + $item_ids = $records[$tb_type]; |
|
21 | 21 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
22 | 22 | include( dirname( __FILE__ ) . '/posts_xml.php' ); |
23 | 23 | } elseif ( file_exists( dirname( __FILE__ ) . '/' . $tb_type . '_xml.php' ) ) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | include( FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php' ); |
27 | 27 | } |
28 | 28 | |
29 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
29 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | ?> |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | * @return array |
137 | 137 | */ |
138 | 138 | private function prepare_array_property( $index, $atts ) { |
139 | - if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) { |
|
139 | + if ( isset( $atts[$index] ) && ! empty( $atts[$index] ) ) { |
|
140 | 140 | |
141 | - if ( is_array( $atts[ $index ] ) ) { |
|
142 | - $property = $atts[ $index ]; |
|
141 | + if ( is_array( $atts[$index] ) ) { |
|
142 | + $property = $atts[$index]; |
|
143 | 143 | } else { |
144 | - $property = explode( ',', $atts[ $index ] ); |
|
144 | + $property = explode( ',', $atts[$index] ); |
|
145 | 145 | } |
146 | 146 | } else { |
147 | 147 | $property = array(); |
@@ -274,6 +274,6 @@ discard block |
||
274 | 274 | * @param stdClass $field |
275 | 275 | */ |
276 | 276 | protected function add_field_values( $field ) { |
277 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
277 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
278 | 278 | } |
279 | 279 | } |