@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'class' => '', |
29 | 29 | 'inc_children' => 'exclude', |
30 | 30 | ); |
31 | - $args = wp_parse_args( $args, $defaults ); |
|
31 | + $args = wp_parse_args( $args, $defaults ); |
|
32 | 32 | |
33 | 33 | if ( ! $args['field_id'] ) { |
34 | 34 | $args['field_id'] = $field_name; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function add_html_attr( $class, $param, &$add_html ) { |
72 | 72 | if ( ! empty( $class ) ) { |
73 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
73 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | 'description' => '', |
277 | 277 | ); |
278 | 278 | foreach ( $defaults as $var => $default ) { |
279 | - if ( ! isset( $values[ $var ] ) ) { |
|
280 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
279 | + if ( ! isset( $values[$var] ) ) { |
|
280 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | 'parent_form_id' => 0, |
293 | 293 | ); |
294 | 294 | foreach ( $defaults as $var => $default ) { |
295 | - if ( ! isset( $values[ $var ] ) ) { |
|
296 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
295 | + if ( ! isset( $values[$var] ) ) { |
|
296 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
297 | 297 | } |
298 | 298 | } |
299 | 299 | unset( $defaults ); |
@@ -330,16 +330,16 @@ discard block |
||
330 | 330 | $defaults = self::get_default_opts(); |
331 | 331 | foreach ( $defaults as $var => $default ) { |
332 | 332 | if ( is_array( $default ) ) { |
333 | - if ( ! isset( $values[ $var ] ) ) { |
|
334 | - $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
333 | + if ( ! isset( $values[$var] ) ) { |
|
334 | + $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | foreach ( $default as $k => $v ) { |
338 | - $values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v ); |
|
338 | + $values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v ); |
|
339 | 339 | |
340 | 340 | if ( is_array( $v ) ) { |
341 | 341 | foreach ( $v as $k1 => $v1 ) { |
342 | - $values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); |
|
342 | + $values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 ); |
|
343 | 343 | unset( $k1, $v1 ); |
344 | 344 | } |
345 | 345 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | unset( $k, $v ); |
348 | 348 | } |
349 | 349 | } else { |
350 | - $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
350 | + $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | unset( $var, $default ); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | public static function fill_form_options( &$options, $values ) { |
386 | 386 | $defaults = self::get_default_opts(); |
387 | 387 | foreach ( $defaults as $var => $default ) { |
388 | - $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
388 | + $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
389 | 389 | unset( $var, $default ); |
390 | 390 | } |
391 | 391 | } |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | public static function insert_opt_html( $args ) { |
542 | 542 | $class = isset( $args['class'] ) ? $args['class'] : ''; |
543 | 543 | $fields = FrmField::all_field_selection(); |
544 | - $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
544 | + $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
545 | 545 | |
546 | 546 | self::prepare_field_type( $field ); |
547 | 547 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) ); |
694 | 694 | } |
695 | 695 | |
696 | - $add_order += 2; |
|
696 | + $add_order += 2; |
|
697 | 697 | $open = false; |
698 | 698 | $reset_fields = true; |
699 | 699 | } |
@@ -1045,10 +1045,10 @@ discard block |
||
1045 | 1045 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
1046 | 1046 | } |
1047 | 1047 | |
1048 | - $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
1049 | - if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
1048 | + $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
1049 | + if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
1050 | 1050 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
1051 | - $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1051 | + $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | $link .= '>' . $label . '</a>'; |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | $status = 'publish'; |
1205 | 1205 | } |
1206 | 1206 | |
1207 | - $name = $nice_names[ $status ]; |
|
1207 | + $name = $nice_names[$status]; |
|
1208 | 1208 | |
1209 | 1209 | return $name; |
1210 | 1210 | } |
@@ -1231,11 +1231,11 @@ discard block |
||
1231 | 1231 | |
1232 | 1232 | if ( count( $categories ) === 1 ) { |
1233 | 1233 | $category = reset( $categories ); |
1234 | - $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
1234 | + $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
1235 | 1235 | } elseif ( ! empty( $categories ) ) { |
1236 | 1236 | foreach ( $icons as $cat => $icon ) { |
1237 | 1237 | if ( ! in_array( $cat, $categories ) ) { |
1238 | - unset( $icons[ $cat ] ); |
|
1238 | + unset( $icons[$cat] ); |
|
1239 | 1239 | } |
1240 | 1240 | } |
1241 | 1241 | $icon = reset( $icons ); |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | |
1362 | 1362 | foreach ( $item['categories'] as $k => $category ) { |
1363 | 1363 | if ( in_array( $category, $plans, true ) ) { |
1364 | - unset( $item['categories'][ $k ] ); |
|
1364 | + unset( $item['categories'][$k] ); |
|
1365 | 1365 | |
1366 | 1366 | if ( $category === 'Personal' ) { |
1367 | 1367 | // Show the current package name. |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | </li><?php |
17 | 17 | $render_icon = true; |
18 | 18 | foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) { |
19 | - if ( isset( $templates[ $template ] ) ) { |
|
20 | - $template = $templates[ $template ]; |
|
19 | + if ( isset( $templates[$template] ) ) { |
|
20 | + $template = $templates[$template]; |
|
21 | 21 | require $view_path . 'list-template.php'; |
22 | 22 | } |
23 | 23 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <ul class="frm-featured-forms-new frm-categories-list"> |
46 | 46 | <?php foreach ( $categories as $category ) { ?> |
47 | 47 | <?php |
48 | - $category_templates = $templates_by_category[ $category ]; |
|
48 | + $category_templates = $templates_by_category[$category]; |
|
49 | 49 | $count = count( $category_templates ); |
50 | 50 | $available = FrmFormsHelper::available_count( $category_templates, $args ); |
51 | 51 | ?> |
@@ -427,11 +427,11 @@ discard block |
||
427 | 427 | ), |
428 | 428 | ); |
429 | 429 | |
430 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
430 | + if ( ! isset( $available_status[$status] ) ) { |
|
431 | 431 | return; |
432 | 432 | } |
433 | 433 | |
434 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
434 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
435 | 435 | |
436 | 436 | $params = FrmForm::list_page_params(); |
437 | 437 | |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | check_admin_referer( $status . '_form_' . $params['id'] ); |
440 | 440 | |
441 | 441 | $count = 0; |
442 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
442 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
443 | 443 | $count ++; |
444 | 444 | } |
445 | 445 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
457 | 457 | $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>' ); |
458 | 458 | |
459 | - $message = $available_status[ $status ]['message']; |
|
459 | + $message = $available_status[$status]['message']; |
|
460 | 460 | |
461 | 461 | self::display_forms_list( $params, $message ); |
462 | 462 | } |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | 'type' => 'request', |
478 | 478 | ) |
479 | 479 | ); |
480 | - $message = sprintf( |
|
480 | + $message = sprintf( |
|
481 | 481 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
482 | 482 | _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' ), |
483 | 483 | $count, |
@@ -885,11 +885,11 @@ discard block |
||
885 | 885 | } |
886 | 886 | |
887 | 887 | foreach ( $template['categories'] as $category ) { |
888 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
889 | - $templates_by_category[ $category ] = array(); |
|
888 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
889 | + $templates_by_category[$category] = array(); |
|
890 | 890 | } |
891 | 891 | |
892 | - $templates_by_category[ $category ][] = $template; |
|
892 | + $templates_by_category[$category][] = $template; |
|
893 | 893 | } |
894 | 894 | } |
895 | 895 | unset( $template ); |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | $section['id'] = $section['anchor']; |
1128 | 1128 | } |
1129 | 1129 | |
1130 | - $sections[ $key ] = $section; |
|
1130 | + $sections[$key] = $section; |
|
1131 | 1131 | } |
1132 | 1132 | |
1133 | 1133 | return $sections; |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | if ( ! empty( $user_fields ) ) { |
1210 | 1210 | $user_helpers = array(); |
1211 | 1211 | foreach ( $user_fields as $uk => $uf ) { |
1212 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1212 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1213 | 1213 | unset( $uk, $uf ); |
1214 | 1214 | } |
1215 | 1215 | |
@@ -1446,7 +1446,7 @@ discard block |
||
1446 | 1446 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1447 | 1447 | } else { |
1448 | 1448 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1449 | - $action = $vars[ $action ]; |
|
1449 | + $action = $vars[$action]; |
|
1450 | 1450 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); |
1451 | 1451 | $_REQUEST = array_merge( $_REQUEST, $vars ); |
1452 | 1452 | $_POST = array_merge( $_POST, $_REQUEST ); |
@@ -1575,7 +1575,7 @@ discard block |
||
1575 | 1575 | $actions = array(); |
1576 | 1576 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1577 | 1577 | if ( is_object( $form ) ) { |
1578 | - $actions[ $form->id ] = $form->name; |
|
1578 | + $actions[$form->id] = $form->name; |
|
1579 | 1579 | } |
1580 | 1580 | unset( $form ); |
1581 | 1581 | } |
@@ -1784,8 +1784,8 @@ discard block |
||
1784 | 1784 | private static function get_saved_errors( $form, $params ) { |
1785 | 1785 | global $frm_vars; |
1786 | 1786 | |
1787 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
1788 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
1787 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { |
|
1788 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
1789 | 1789 | } else { |
1790 | 1790 | $errors = array(); |
1791 | 1791 | } |
@@ -1799,7 +1799,7 @@ discard block |
||
1799 | 1799 | public static function just_created_entry( $form_id ) { |
1800 | 1800 | global $frm_vars; |
1801 | 1801 | |
1802 | - 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; |
|
1802 | + 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; |
|
1803 | 1803 | } |
1804 | 1804 | |
1805 | 1805 | /** |
@@ -1807,7 +1807,7 @@ discard block |
||
1807 | 1807 | */ |
1808 | 1808 | private static function get_confirmation_method( $atts ) { |
1809 | 1809 | $opt = 'success_action'; |
1810 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
1810 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
1811 | 1811 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
1812 | 1812 | |
1813 | 1813 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
1821 | 1821 | if ( ! isset( $params['id'] ) ) { |
1822 | 1822 | global $frm_vars; |
1823 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
1823 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
1824 | 1824 | } |
1825 | 1825 | |
1826 | 1826 | $conf_method = self::get_confirmation_method( |
@@ -1864,7 +1864,7 @@ discard block |
||
1864 | 1864 | $opt = ( ! isset( $args['action'] ) || $args['action'] == 'create' ) ? 'success' : 'edit'; |
1865 | 1865 | |
1866 | 1866 | $args['success_opt'] = $opt; |
1867 | - if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
1867 | + if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
1868 | 1868 | self::load_page_after_submit( $args ); |
1869 | 1869 | } elseif ( $args['conf_method'] == 'redirect' ) { |
1870 | 1870 | self::redirect_after_submit( $args ); |
@@ -1879,8 +1879,8 @@ discard block |
||
1879 | 1879 | private static function load_page_after_submit( $args ) { |
1880 | 1880 | global $post; |
1881 | 1881 | $opt = $args['success_opt']; |
1882 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
1883 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
1882 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
1883 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
1884 | 1884 | $old_post = $post; |
1885 | 1885 | $post = $page; |
1886 | 1886 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -1898,11 +1898,11 @@ discard block |
||
1898 | 1898 | add_filter( 'frm_use_wpautop', '__return_false' ); |
1899 | 1899 | |
1900 | 1900 | $opt = $args['success_opt']; |
1901 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
1901 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
1902 | 1902 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
1903 | 1903 | $success_url = do_shortcode( $success_url ); |
1904 | 1904 | |
1905 | - $success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1905 | + $success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
1906 | 1906 | |
1907 | 1907 | $redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args ); |
1908 | 1908 | |
@@ -2038,7 +2038,7 @@ discard block |
||
2038 | 2038 | 'description' => false, |
2039 | 2039 | 'reset' => false, |
2040 | 2040 | ); |
2041 | - $args = wp_parse_args( $args, $defaults ); |
|
2041 | + $args = wp_parse_args( $args, $defaults ); |
|
2042 | 2042 | } |
2043 | 2043 | |
2044 | 2044 | /** |