@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
| 98 | 98 | if ( ! empty( $cats ) ) { |
| 99 | - unset( $addons[ $k ] ); |
|
| 99 | + unset( $addons[$k] ); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | return $addon; |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 142 | - $plugin = $addons[ $download_id ]; |
|
| 141 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 142 | + $plugin = $addons[$download_id]; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | return $plugin; |
@@ -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 | |
@@ -443,11 +443,11 @@ discard block |
||
| 443 | 443 | ), |
| 444 | 444 | ); |
| 445 | 445 | |
| 446 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
| 446 | + if ( ! isset( $available_status[$status] ) ) { |
|
| 447 | 447 | return; |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
| 450 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
| 451 | 451 | |
| 452 | 452 | $params = FrmForm::list_page_params(); |
| 453 | 453 | |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | check_admin_referer( $status . '_form_' . $params['id'] ); |
| 456 | 456 | |
| 457 | 457 | $count = 0; |
| 458 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
| 458 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
| 459 | 459 | $count ++; |
| 460 | 460 | } |
| 461 | 461 | |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 473 | 473 | $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>' ); |
| 474 | 474 | |
| 475 | - $message = $available_status[ $status ]['message']; |
|
| 475 | + $message = $available_status[$status]['message']; |
|
| 476 | 476 | |
| 477 | 477 | self::display_forms_list( $params, $message ); |
| 478 | 478 | } |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | 'type' => 'request', |
| 494 | 494 | ) |
| 495 | 495 | ); |
| 496 | - $message = sprintf( |
|
| 496 | + $message = sprintf( |
|
| 497 | 497 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 498 | 498 | _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' ), |
| 499 | 499 | $count, |
@@ -861,11 +861,11 @@ discard block |
||
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | foreach ( $template['categories'] as $category ) { |
| 864 | - if ( ! isset( $templates_by_category[ $category ] ) ) { |
|
| 865 | - $templates_by_category[ $category ] = array(); |
|
| 864 | + if ( ! isset( $templates_by_category[$category] ) ) { |
|
| 865 | + $templates_by_category[$category] = array(); |
|
| 866 | 866 | } |
| 867 | 867 | |
| 868 | - $templates_by_category[ $category ][] = $template; |
|
| 868 | + $templates_by_category[$category][] = $template; |
|
| 869 | 869 | } |
| 870 | 870 | } |
| 871 | 871 | unset( $template ); |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | $forms = FrmForm::get_published_forms( $where ); |
| 895 | 895 | $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/'; |
| 896 | 896 | |
| 897 | - $templates_by_category[ $my_templates_translation ] = $custom_templates; |
|
| 897 | + $templates_by_category[$my_templates_translation] = $custom_templates; |
|
| 898 | 898 | |
| 899 | 899 | unset( $pricing, $license_type, $where ); |
| 900 | 900 | wp_enqueue_script( 'accordion' ); // register accordion for template groups |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | $section['id'] = $section['anchor']; |
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | - $sections[ $key ] = $section; |
|
| 1131 | + $sections[$key] = $section; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | return $sections; |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | if ( ! empty( $user_fields ) ) { |
| 1232 | 1232 | $user_helpers = array(); |
| 1233 | 1233 | foreach ( $user_fields as $uk => $uf ) { |
| 1234 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
| 1234 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
| 1235 | 1235 | unset( $uk, $uf ); |
| 1236 | 1236 | } |
| 1237 | 1237 | |
@@ -1361,7 +1361,7 @@ discard block |
||
| 1361 | 1361 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
| 1362 | 1362 | $frm_vars['js_validate_forms'] = array(); |
| 1363 | 1363 | } |
| 1364 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
| 1364 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
| 1365 | 1365 | } |
| 1366 | 1366 | |
| 1367 | 1367 | public static function get_email_html() { |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
| 1483 | 1483 | } else { |
| 1484 | 1484 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
| 1485 | - $action = $vars[ $action ]; |
|
| 1485 | + $action = $vars[$action]; |
|
| 1486 | 1486 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1487 | 1487 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1488 | 1488 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | $actions = array(); |
| 1609 | 1609 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
| 1610 | 1610 | if ( is_object( $form ) ) { |
| 1611 | - $actions[ $form->id ] = $form->name; |
|
| 1611 | + $actions[$form->id] = $form->name; |
|
| 1612 | 1612 | } |
| 1613 | 1613 | unset( $form ); |
| 1614 | 1614 | } |
@@ -1817,8 +1817,8 @@ discard block |
||
| 1817 | 1817 | private static function get_saved_errors( $form, $params ) { |
| 1818 | 1818 | global $frm_vars; |
| 1819 | 1819 | |
| 1820 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1821 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
| 1820 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1821 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
| 1822 | 1822 | } else { |
| 1823 | 1823 | $errors = array(); |
| 1824 | 1824 | } |
@@ -1832,7 +1832,7 @@ discard block |
||
| 1832 | 1832 | public static function just_created_entry( $form_id ) { |
| 1833 | 1833 | global $frm_vars; |
| 1834 | 1834 | |
| 1835 | - 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; |
|
| 1835 | + 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; |
|
| 1836 | 1836 | } |
| 1837 | 1837 | |
| 1838 | 1838 | /** |
@@ -1840,7 +1840,7 @@ discard block |
||
| 1840 | 1840 | */ |
| 1841 | 1841 | private static function get_confirmation_method( $atts ) { |
| 1842 | 1842 | $opt = 'success_action'; |
| 1843 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 1843 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
| 1844 | 1844 | $method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' ); |
| 1845 | 1845 | |
| 1846 | 1846 | if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) { |
@@ -1853,7 +1853,7 @@ discard block |
||
| 1853 | 1853 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
| 1854 | 1854 | if ( ! isset( $params['id'] ) ) { |
| 1855 | 1855 | global $frm_vars; |
| 1856 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
| 1856 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
| 1857 | 1857 | } |
| 1858 | 1858 | |
| 1859 | 1859 | $conf_method = self::get_confirmation_method( |
@@ -1897,7 +1897,7 @@ discard block |
||
| 1897 | 1897 | $opt = ( ! isset( $args['action'] ) || $args['action'] === 'create' ) ? 'success' : 'edit'; |
| 1898 | 1898 | |
| 1899 | 1899 | $args['success_opt'] = $opt; |
| 1900 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
| 1900 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
| 1901 | 1901 | self::load_page_after_submit( $args ); |
| 1902 | 1902 | } elseif ( $args['conf_method'] === 'redirect' ) { |
| 1903 | 1903 | self::redirect_after_submit( $args ); |
@@ -1912,8 +1912,8 @@ discard block |
||
| 1912 | 1912 | private static function load_page_after_submit( $args ) { |
| 1913 | 1913 | global $post; |
| 1914 | 1914 | $opt = $args['success_opt']; |
| 1915 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
| 1916 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
| 1915 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
| 1916 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
| 1917 | 1917 | $old_post = $post; |
| 1918 | 1918 | $post = $page; |
| 1919 | 1919 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -1931,11 +1931,11 @@ discard block |
||
| 1931 | 1931 | add_filter( 'frm_use_wpautop', '__return_false' ); |
| 1932 | 1932 | |
| 1933 | 1933 | $opt = $args['success_opt']; |
| 1934 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
| 1934 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
| 1935 | 1935 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
| 1936 | 1936 | $success_url = do_shortcode( $success_url ); |
| 1937 | 1937 | |
| 1938 | - $success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
| 1938 | + $success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' ); |
|
| 1939 | 1939 | |
| 1940 | 1940 | $redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args ); |
| 1941 | 1941 | |
@@ -2073,7 +2073,7 @@ discard block |
||
| 2073 | 2073 | 'description' => false, |
| 2074 | 2074 | 'reset' => false, |
| 2075 | 2075 | ); |
| 2076 | - $args = wp_parse_args( $args, $defaults ); |
|
| 2076 | + $args = wp_parse_args( $args, $defaults ); |
|
| 2077 | 2077 | } |
| 2078 | 2078 | |
| 2079 | 2079 | /** |
@@ -1465,7 +1465,8 @@ discard block |
||
| 1465 | 1465 | $vars = array(); |
| 1466 | 1466 | FrmAppHelper::include_svg(); |
| 1467 | 1467 | |
| 1468 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1468 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
| 1469 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1469 | 1470 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| 1470 | 1471 | |
| 1471 | 1472 | // Javascript needs to be allowed in some field settings. |
@@ -1735,7 +1736,8 @@ discard block |
||
| 1735 | 1736 | private static function maybe_get_form_to_show( $id ) { |
| 1736 | 1737 | $form = false; |
| 1737 | 1738 | |
| 1738 | - if ( ! empty( $id ) ) { // no form id or key set |
|
| 1739 | + if ( ! empty( $id ) ) { |
|
| 1740 | +// no form id or key set |
|
| 1739 | 1741 | $form = FrmForm::getOne( $id ); |
| 1740 | 1742 | if ( ! $form || $form->parent_form_id || $form->status == 'trash' ) { |
| 1741 | 1743 | $form = false; |
@@ -1817,7 +1819,8 @@ discard block |
||
| 1817 | 1819 | private static function get_saved_errors( $form, $params ) { |
| 1818 | 1820 | global $frm_vars; |
| 1819 | 1821 | |
| 1820 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1822 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
| 1823 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1821 | 1824 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
| 1822 | 1825 | } else { |
| 1823 | 1826 | $errors = array(); |
@@ -75,19 +75,19 @@ discard block |
||
| 75 | 75 | global $frm_vars; |
| 76 | 76 | $form_id = FrmForm::get_current_form_id(); |
| 77 | 77 | |
| 78 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 79 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 78 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 79 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 80 | 80 | |
| 81 | 81 | if ( $form_id ) { |
| 82 | 82 | self::get_columns_for_form( $form_id, $columns ); |
| 83 | 83 | } else { |
| 84 | - $columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' ); |
|
| 85 | - $columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' ); |
|
| 86 | - $columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' ); |
|
| 84 | + $columns[$form_id . '_form_id'] = __( 'Form', 'formidable' ); |
|
| 85 | + $columns[$form_id . '_name'] = __( 'Entry Name', 'formidable' ); |
|
| 86 | + $columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' ); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 90 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 89 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 90 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 91 | 91 | self::maybe_add_ip_col( $form_id, $columns ); |
| 92 | 92 | |
| 93 | 93 | $frm_vars['cols'] = $columns; |
@@ -145,10 +145,10 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 147 | 147 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 148 | - unset( $sub_form_cols[ $k ] ); |
|
| 148 | + unset( $sub_form_cols[$k] ); |
|
| 149 | 149 | continue; |
| 150 | 150 | } |
| 151 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 151 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 152 | 152 | unset( $sub_form_col ); |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -165,15 +165,15 @@ discard block |
||
| 165 | 165 | $has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' ); |
| 166 | 166 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status'; |
| 167 | 167 | if ( $has_separate_value && ! $is_post_status ) { |
| 168 | - $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 168 | + $columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 171 | + $columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 ); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 175 | 175 | if ( FrmAppHelper::ips_saved() ) { |
| 176 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 176 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | foreach ( $meta_value as $mk => $mv ) { |
| 212 | 212 | // Remove blank values. |
| 213 | 213 | if ( empty( $mv ) ) { |
| 214 | - unset( $meta_value[ $mk ] ); |
|
| 214 | + unset( $meta_value[$mk] ); |
|
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | foreach ( $fields as $field ) { |
| 289 | 289 | if ( self::field_supports_sorting( $field ) ) { |
| 290 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 290 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $atts['form_id'] . '_item_key' => '', |
| 364 | 364 | $atts['form_id'] . '_id' => '', |
| 365 | 365 | ); |
| 366 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 366 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 367 | 367 | |
| 368 | 368 | $i = $atts['i']; |
| 369 | 369 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 376 | 376 | $result[] = $col_key; |
| 377 | - $i--; |
|
| 377 | + $i --; |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | unset( $col_key, $col ); |
@@ -507,9 +507,9 @@ discard block |
||
| 507 | 507 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 508 | 508 | $frm_vars['form_params'] = array(); |
| 509 | 509 | } |
| 510 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 510 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 511 | 511 | |
| 512 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 512 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 513 | 513 | return; |
| 514 | 514 | } |
| 515 | 515 | |
@@ -525,16 +525,16 @@ discard block |
||
| 525 | 525 | */ |
| 526 | 526 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 527 | 527 | |
| 528 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 528 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 529 | 529 | |
| 530 | 530 | if ( empty( $errors ) ) { |
| 531 | 531 | $_POST['frm_skip_cookie'] = 1; |
| 532 | 532 | $do_success = false; |
| 533 | 533 | if ( $params['action'] === 'create' ) { |
| 534 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 535 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 534 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 535 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 536 | 536 | |
| 537 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 537 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 538 | 538 | $do_success = true; |
| 539 | 539 | } |
| 540 | 540 | } |
@@ -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 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | foreach ( $values as $value_key => $value ) { |
| 155 | 155 | if ( $value_key && in_array( $value_key, $form_fields ) ) { |
| 156 | - $new_values[ $value_key ] = $value; |
|
| 156 | + $new_values[$value_key] = $value; |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
@@ -224,15 +224,15 @@ discard block |
||
| 224 | 224 | $existing_keys = array_keys( $values['item_meta'] ); |
| 225 | 225 | foreach ( $all_fields as $fid ) { |
| 226 | 226 | if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) { |
| 227 | - $values['item_meta'][ $fid->id ] = ''; |
|
| 227 | + $values['item_meta'][$fid->id] = ''; |
|
| 228 | 228 | } |
| 229 | - $field_array[ $fid->id ] = $fid; |
|
| 229 | + $field_array[$fid->id] = $fid; |
|
| 230 | 230 | } |
| 231 | 231 | unset( $all_fields ); |
| 232 | 232 | |
| 233 | 233 | foreach ( $values['item_meta'] as $field_id => $default_value ) { |
| 234 | - if ( isset( $field_array[ $field_id ] ) ) { |
|
| 235 | - $field = $field_array[ $field_id ]; |
|
| 234 | + if ( isset( $field_array[$field_id] ) ) { |
|
| 235 | + $field = $field_array[$field_id]; |
|
| 236 | 236 | } else { |
| 237 | 237 | $field = FrmField::getOne( $field_id ); |
| 238 | 238 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | continue; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ); |
|
| 244 | + $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) ); |
|
| 245 | 245 | if ( $is_settings_page ) { |
| 246 | 246 | self::get_settings_page_html( $values, $field ); |
| 247 | 247 | |
@@ -256,15 +256,15 @@ discard block |
||
| 256 | 256 | $update_options = apply_filters( 'frm_field_options_to_update', $update_options ); |
| 257 | 257 | |
| 258 | 258 | foreach ( $update_options as $opt => $default ) { |
| 259 | - $field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default; |
|
| 260 | - self::sanitize_field_opt( $opt, $field->field_options[ $opt ] ); |
|
| 259 | + $field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default; |
|
| 260 | + self::sanitize_field_opt( $opt, $field->field_options[$opt] ); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | $field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values ); |
| 264 | 264 | |
| 265 | 265 | $new_field = array( |
| 266 | 266 | 'field_options' => $field->field_options, |
| 267 | - 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', |
|
| 267 | + 'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '', |
|
| 268 | 268 | ); |
| 269 | 269 | |
| 270 | 270 | self::prepare_field_update_values( $field, $values, $new_field ); |
@@ -326,11 +326,11 @@ discard block |
||
| 326 | 326 | * Updating the settings page |
| 327 | 327 | */ |
| 328 | 328 | private static function get_settings_page_html( $values, &$field ) { |
| 329 | - if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) { |
|
| 329 | + if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) { |
|
| 330 | 330 | $prev_opts = array(); |
| 331 | 331 | $fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type ); |
| 332 | 332 | |
| 333 | - $field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html; |
|
| 333 | + $field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html; |
|
| 334 | 334 | } elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) { |
| 335 | 335 | $prev_opts = $field->field_options; |
| 336 | 336 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | foreach ( $field_cols as $col => $default ) { |
| 357 | 357 | $default = ( $default === '' ) ? $field->{$col} : $default; |
| 358 | 358 | |
| 359 | - $new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default; |
|
| 359 | + $new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default; |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | // Don't save the template option. |
@@ -770,8 +770,8 @@ discard block |
||
| 770 | 770 | self::maybe_get_form( $form ); |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | - if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) { |
|
| 774 | - return $frm_vars['form_params'][ $form->id ]; |
|
| 773 | + if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) { |
|
| 774 | + return $frm_vars['form_params'][$form->id]; |
|
| 775 | 775 | } |
| 776 | 776 | |
| 777 | 777 | $action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -800,15 +800,15 @@ discard block |
||
| 800 | 800 | //if there are two forms on the same page, make sure not to submit both |
| 801 | 801 | foreach ( $default_values as $var => $default ) { |
| 802 | 802 | if ( $var == 'action' ) { |
| 803 | - $values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 803 | + $values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 804 | 804 | } else { |
| 805 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 805 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 806 | 806 | } |
| 807 | 807 | unset( $var, $default ); |
| 808 | 808 | } |
| 809 | 809 | } else { |
| 810 | 810 | foreach ( $default_values as $var => $default ) { |
| 811 | - $values[ $var ] = $default; |
|
| 811 | + $values[$var] = $default; |
|
| 812 | 812 | unset( $var, $default ); |
| 813 | 813 | } |
| 814 | 814 | } |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | 'sdir' => '', |
| 835 | 835 | ); |
| 836 | 836 | foreach ( $defaults as $var => $default ) { |
| 837 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 837 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | return $values; |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | 'keep_post' => '', |
| 863 | 863 | ); |
| 864 | 864 | foreach ( $defaults as $var => $default ) { |
| 865 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 865 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | return $values; |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | $form = $atts['form']; |
| 966 | 966 | $default = isset( $atts['default'] ) ? $atts['default'] : ''; |
| 967 | 967 | |
| 968 | - return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default; |
|
| 968 | + return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $default; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | /** |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | protected function get_field_value( $args ) { |
| 53 | 53 | $user_ID = get_current_user_id(); |
| 54 | 54 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 55 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 55 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 56 | 56 | $action = ( isset( $args['action'] ) ? $args['action'] : ( isset( $args['form_action'] ) ? $args['form_action'] : '' ) ); |
| 57 | 57 | $updating = $action == 'update'; |
| 58 | 58 | return ( is_numeric( $this->field['value'] ) || $posted_value || $updating ) ? $this->field['value'] : $user_ID; |
@@ -5,15 +5,15 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | class FrmFormAction { |
| 7 | 7 | |
| 8 | - public $id_base; // Root id for all actions of this type. |
|
| 9 | - public $name; // Name for this action type. |
|
| 8 | + public $id_base; // Root id for all actions of this type. |
|
| 9 | + public $name; // Name for this action type. |
|
| 10 | 10 | public $option_name; |
| 11 | - public $action_options; // Option array passed to wp_register_sidebar_widget() |
|
| 11 | + public $action_options; // Option array passed to wp_register_sidebar_widget() |
|
| 12 | 12 | public $control_options; // Option array passed to wp_register_widget_control() |
| 13 | 13 | |
| 14 | - public $form_id; // The ID of the form to evaluate |
|
| 15 | - public $number = false; // Unique ID number of the current instance. |
|
| 16 | - public $id = ''; // Unique ID string of the current instance (id_base-number) |
|
| 14 | + public $form_id; // The ID of the form to evaluate |
|
| 15 | + public $number = false; // Unique ID number of the current instance. |
|
| 16 | + public $id = ''; // Unique ID string of the current instance (id_base-number) |
|
| 17 | 17 | public $updated = false; // Set true when we update the data after a POST submit - makes sure we don't do it twice. |
| 18 | 18 | |
| 19 | 19 | // Member functions that you must over-ride. |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | $groups = FrmFormActionsController::form_action_groups(); |
| 152 | 152 | $group = 'misc'; |
| 153 | 153 | |
| 154 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
| 154 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
| 155 | 155 | $group = $action_options['group']; |
| 156 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
| 156 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
| 157 | 157 | $group = $this->id_base; |
| 158 | 158 | } else { |
| 159 | 159 | foreach ( $groups as $name => $check_group ) { |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $groups[ $group ]['id'] = $group; |
|
| 168 | - return $groups[ $group ]; |
|
| 167 | + $groups[$group]['id'] = $group; |
|
| 168 | + return $groups[$group]; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * @return integer $post_id |
| 268 | 268 | */ |
| 269 | 269 | public function maybe_create_action( $action, $forms ) { |
| 270 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] == 'updated' ) { |
|
| 270 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] == 'updated' ) { |
|
| 271 | 271 | // Update action only |
| 272 | 272 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
| 273 | 273 | $post_id = $this->save_settings( $action ); |
@@ -287,18 +287,18 @@ discard block |
||
| 287 | 287 | $switch = $this->get_global_switch_fields(); |
| 288 | 288 | |
| 289 | 289 | foreach ( (array) $action->post_content as $key => $val ) { |
| 290 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
| 291 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
| 290 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
| 291 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
| 292 | 292 | } elseif ( ! is_array( $val ) ) { |
| 293 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
| 294 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
| 293 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
| 294 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
| 295 | 295 | // loop through each value if empty |
| 296 | - if ( empty( $switch[ $key ] ) ) { |
|
| 297 | - $switch[ $key ] = array_keys( $val ); |
|
| 296 | + if ( empty( $switch[$key] ) ) { |
|
| 297 | + $switch[$key] = array_keys( $val ); |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - foreach ( $switch[ $key ] as $subkey ) { |
|
| 301 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
| 300 | + foreach ( $switch[$key] as $subkey ) { |
|
| 301 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | |
@@ -316,20 +316,20 @@ discard block |
||
| 316 | 316 | foreach ( $subkey as $subkey2 ) { |
| 317 | 317 | foreach ( (array) $val as $ck => $cv ) { |
| 318 | 318 | if ( is_array( $cv ) ) { |
| 319 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
| 320 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
| 321 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
| 319 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
| 320 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
| 321 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | } else { |
| 326 | 326 | foreach ( (array) $val as $ck => $cv ) { |
| 327 | 327 | if ( is_array( $cv ) ) { |
| 328 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
| 329 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
| 330 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
| 328 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
| 329 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
| 330 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
| 331 | 331 | } elseif ( $ck == $subkey ) { |
| 332 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
| 332 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | } |
@@ -353,10 +353,10 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 356 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
| 356 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
| 357 | 357 | // Sanitizing removes scripts and <email> type of values. |
| 358 | 358 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 359 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
| 359 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
| 360 | 360 | } else { |
| 361 | 361 | return; |
| 362 | 362 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | foreach ( $settings as $number => $new_instance ) { |
| 367 | 367 | $this->_set( $number ); |
| 368 | 368 | |
| 369 | - $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); |
|
| 369 | + $old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array(); |
|
| 370 | 370 | |
| 371 | 371 | if ( ! isset( $new_instance['post_status'] ) ) { |
| 372 | 372 | $new_instance['post_status'] = 'draft'; |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $new_instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
| 407 | 407 | |
| 408 | 408 | if ( false !== $instance ) { |
| 409 | - $all_instances[ $number ] = $instance; |
|
| 409 | + $all_instances[$number] = $instance; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $action_ids[] = $this->save_settings( $instance ); |
@@ -482,12 +482,12 @@ discard block |
||
| 482 | 482 | // some plugins/themes are formatting the post_excerpt |
| 483 | 483 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
| 484 | 484 | |
| 485 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
| 485 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
| 486 | 486 | continue; |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
| 490 | - $settings[ $action->ID ] = $action; |
|
| 489 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
| 490 | + $settings[$action->ID] = $action; |
|
| 491 | 491 | |
| 492 | 492 | if ( count( $settings ) >= $limit ) { |
| 493 | 493 | break; |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | 'limit' => 99, |
| 518 | 518 | 'post_status' => $default_status, |
| 519 | 519 | ); |
| 520 | - $args = wp_parse_args( $args, $defaults ); |
|
| 520 | + $args = wp_parse_args( $args, $defaults ); |
|
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | /** |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | $action = $this->prepare_action( $action ); |
| 580 | 580 | |
| 581 | - $settings[ $action->ID ] = $action; |
|
| 581 | + $settings[$action->ID] = $action; |
|
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | if ( 1 === $limit ) { |
@@ -615,10 +615,10 @@ discard block |
||
| 615 | 615 | |
| 616 | 616 | foreach ( $default_values as $k => $vals ) { |
| 617 | 617 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
| 618 | - if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
| 618 | + if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
| 619 | 619 | continue; |
| 620 | 620 | } |
| 621 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
| 621 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | |
@@ -693,14 +693,14 @@ discard block |
||
| 693 | 693 | * Migrate settings from form->options into new action. |
| 694 | 694 | */ |
| 695 | 695 | public function migrate_to_2( $form, $update = 'update' ) { |
| 696 | - $action = $this->prepare_new( $form->id ); |
|
| 696 | + $action = $this->prepare_new( $form->id ); |
|
| 697 | 697 | FrmAppHelper::unserialize_or_decode( $form->options ); |
| 698 | 698 | |
| 699 | 699 | // fill with existing options |
| 700 | 700 | foreach ( $action->post_content as $name => $val ) { |
| 701 | - if ( isset( $form->options[ $name ] ) ) { |
|
| 702 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
| 703 | - unset( $form->options[ $name ] ); |
|
| 701 | + if ( isset( $form->options[$name] ) ) { |
|
| 702 | + $action->post_content[$name] = $form->options[$name]; |
|
| 703 | + unset( $form->options[$name] ); |
|
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | $stop = $stop ? false : true; |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | - $met[ $stop ] = $stop; |
|
| 769 | + $met[$stop] = $stop; |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | if ( $notification['conditions']['any_all'] == 'all' && ! empty( $met ) && isset( $met[0] ) && isset( $met[1] ) ) { |
@@ -817,8 +817,8 @@ discard block |
||
| 817 | 817 | private static function get_value_from_entry( $entry, $field_id ) { |
| 818 | 818 | $observed_value = ''; |
| 819 | 819 | |
| 820 | - if ( isset( $entry->metas[ $field_id ] ) ) { |
|
| 821 | - $observed_value = $entry->metas[ $field_id ]; |
|
| 820 | + if ( isset( $entry->metas[$field_id] ) ) { |
|
| 821 | + $observed_value = $entry->metas[$field_id]; |
|
| 822 | 822 | } elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) { |
| 823 | 823 | $field = FrmField::getOne( $field_id ); |
| 824 | 824 | $observed_value = FrmProEntryMetaHelper::get_post_or_meta_value( |
@@ -180,7 +180,8 @@ discard block |
||
| 180 | 180 | * @param mixed $value |
| 181 | 181 | */ |
| 182 | 182 | private static function get_posted_field_setting( $setting, &$value ) { |
| 183 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 183 | + if ( ! isset( $_POST['field_options'][ $setting ] ) ) { |
|
| 184 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 184 | 185 | return; |
| 185 | 186 | } |
| 186 | 187 | |
@@ -1084,7 +1085,8 @@ discard block |
||
| 1084 | 1085 | |
| 1085 | 1086 | // Check posted vals before checking saved values |
| 1086 | 1087 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1087 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1088 | + if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { |
|
| 1089 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1088 | 1090 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1089 | 1091 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1090 | 1092 | $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
@@ -1094,7 +1096,8 @@ discard block |
||
| 1094 | 1096 | |
| 1095 | 1097 | return $other_val; |
| 1096 | 1098 | |
| 1097 | - } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1099 | + } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { |
|
| 1100 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1098 | 1101 | // For normal fields |
| 1099 | 1102 | |
| 1100 | 1103 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | if ( in_array( $type, array( 'data', 'lookup' ) ) ) { |
| 27 | 27 | $values['field_options']['data_type'] = $setting; |
| 28 | 28 | } else { |
| 29 | - $values['field_options'][ $setting ] = 1; |
|
| 29 | + $values['field_options'][$setting] = 1; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | foreach ( $defaults as $opt => $default ) { |
| 136 | - $values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default; |
|
| 136 | + $values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default; |
|
| 137 | 137 | |
| 138 | 138 | if ( $check_post ) { |
| 139 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
| 139 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | unset( $opt, $default ); |
@@ -180,18 +180,18 @@ discard block |
||
| 180 | 180 | * @param mixed $value |
| 181 | 181 | */ |
| 182 | 182 | private static function get_posted_field_setting( $setting, &$value ) { |
| 183 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 183 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 184 | 184 | return; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | if ( strpos( $setting, 'html' ) !== false ) { |
| 188 | 188 | // Strip slashes from HTML but not regex or script tags. |
| 189 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 189 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 190 | 190 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 191 | 191 | // TODO: Remove stripslashes on output, and use on input only. |
| 192 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 192 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 193 | 193 | } else { |
| 194 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 194 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 195 | 195 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 265 | 265 | |
| 266 | 266 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 267 | - $values[ $col ] = $field->{$col}; |
|
| 267 | + $values[$col] = $field->{$col}; |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | ); |
| 305 | 305 | |
| 306 | 306 | $msg = FrmField::get_option( $field, $error ); |
| 307 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 307 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 308 | 308 | $msg = do_shortcode( $msg ); |
| 309 | 309 | |
| 310 | 310 | return $msg; |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | $base_name = 'default_value_' . $field['id']; |
| 417 | - $html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field ); |
|
| 417 | + $html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field ); |
|
| 418 | 418 | |
| 419 | 419 | $default_type = self::get_default_value_type( $field ); |
| 420 | 420 | |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | continue; |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 741 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 742 | 742 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 743 | 743 | |
| 744 | 744 | $atts['entry'] = $entry; |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | if ( $replace_with !== null ) { |
| 749 | 749 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 750 | 750 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 751 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 751 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | unset( $atts, $replace_with ); |
@@ -821,8 +821,8 @@ discard block |
||
| 821 | 821 | |
| 822 | 822 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' ); |
| 823 | 823 | |
| 824 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 825 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 824 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 825 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 826 | 826 | } elseif ( in_array( $atts['tag'], $dynamic_default ) ) { |
| 827 | 827 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 828 | 828 | } elseif ( $clean_tag == 'user_agent' ) { |
@@ -1033,8 +1033,8 @@ discard block |
||
| 1033 | 1033 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1034 | 1034 | } elseif ( in_array( $type, $multiple_input ) ) { |
| 1035 | 1035 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1036 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1037 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1036 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1037 | + $field_types[$type] = $field_selection[$type]; |
|
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | 1040 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | |
| 1068 | 1068 | private static function field_types_for_input( $inputs, $fields, &$field_types ) { |
| 1069 | 1069 | foreach ( $inputs as $input ) { |
| 1070 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1070 | + $field_types[$input] = $fields[$input]; |
|
| 1071 | 1071 | unset( $input ); |
| 1072 | 1072 | } |
| 1073 | 1073 | } |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | 'parent' => false, |
| 1100 | 1100 | 'pointer' => false, |
| 1101 | 1101 | ); |
| 1102 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1102 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1103 | 1103 | |
| 1104 | 1104 | $opt_key = $args['opt_key']; |
| 1105 | 1105 | $field = $args['field']; |
@@ -1115,24 +1115,24 @@ discard block |
||
| 1115 | 1115 | |
| 1116 | 1116 | // Check posted vals before checking saved values |
| 1117 | 1117 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1118 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1118 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1119 | 1119 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1120 | 1120 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1121 | - $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1121 | + $other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1122 | 1122 | } else { |
| 1123 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1123 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | 1126 | return $other_val; |
| 1127 | 1127 | |
| 1128 | - } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1128 | + } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1129 | 1129 | // For normal fields |
| 1130 | 1130 | |
| 1131 | 1131 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1132 | 1132 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1133 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1133 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1134 | 1134 | } else { |
| 1135 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1135 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | return $other_val; |
@@ -1142,8 +1142,8 @@ discard block |
||
| 1142 | 1142 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1143 | 1143 | // Check if there is an "other" val in saved value and make sure the |
| 1144 | 1144 | // "other" val is not equal to the Other checkbox option |
| 1145 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1146 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1145 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1146 | + $other_val = $field['value'][$opt_key]; |
|
| 1147 | 1147 | } |
| 1148 | 1148 | } else { |
| 1149 | 1149 | /** |
@@ -1155,8 +1155,8 @@ discard block |
||
| 1155 | 1155 | // Multi-select dropdowns - key is not preserved |
| 1156 | 1156 | if ( is_array( $field['value'] ) ) { |
| 1157 | 1157 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1158 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1159 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1158 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1159 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1160 | 1160 | } |
| 1161 | 1161 | } elseif ( $temp_val == $field['value'] ) { |
| 1162 | 1162 | // For radio and regular dropdowns |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | return $other_args; |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | - $other_opt = true; |
|
| 1201 | + $other_opt = true; |
|
| 1202 | 1202 | |
| 1203 | 1203 | self::set_other_name( $args, $other_args ); |
| 1204 | 1204 | self::set_other_value( $args, $other_args ); |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | if ( is_array( $val ) ) { |
| 1353 | 1353 | foreach ( $val as $k => $v ) { |
| 1354 | 1354 | if ( is_string( $v ) ) { |
| 1355 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1355 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1356 | 1356 | unset( $k, $v ); |
| 1357 | 1357 | } |
| 1358 | 1358 | } |
@@ -1705,7 +1705,7 @@ discard block |
||
| 1705 | 1705 | $countries['class'] = 'frm-countries-opts'; |
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 1708 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 1709 | 1709 | |
| 1710 | 1710 | // State abv. |
| 1711 | 1711 | $states = self::get_us_states(); |
@@ -1715,7 +1715,7 @@ discard block |
||
| 1715 | 1715 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 1716 | 1716 | } |
| 1717 | 1717 | |
| 1718 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 1718 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 1719 | 1719 | |
| 1720 | 1720 | // States. |
| 1721 | 1721 | $states = array_values( $states ); |
@@ -1724,7 +1724,7 @@ discard block |
||
| 1724 | 1724 | $states['class'] = 'frm-states-opts'; |
| 1725 | 1725 | } |
| 1726 | 1726 | |
| 1727 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 1727 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 1728 | 1728 | unset( $state_abv, $states ); |
| 1729 | 1729 | |
| 1730 | 1730 | // Age. |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | $ages['class'] = 'frm-age-opts'; |
| 1743 | 1743 | } |
| 1744 | 1744 | |
| 1745 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 1745 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 1746 | 1746 | |
| 1747 | 1747 | // Satisfaction. |
| 1748 | 1748 | $satisfaction = array( |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 1758 | 1758 | } |
| 1759 | 1759 | |
| 1760 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 1760 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 1761 | 1761 | |
| 1762 | 1762 | // Importance. |
| 1763 | 1763 | $importance = array( |
@@ -1772,7 +1772,7 @@ discard block |
||
| 1772 | 1772 | $importance['class'] = 'frm-importance-opts'; |
| 1773 | 1773 | } |
| 1774 | 1774 | |
| 1775 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 1775 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 1776 | 1776 | |
| 1777 | 1777 | // Agreement. |
| 1778 | 1778 | $agreement = array( |
@@ -1787,7 +1787,7 @@ discard block |
||
| 1787 | 1787 | $agreement['class'] = 'frm-agreement-opts'; |
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 1790 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 1791 | 1791 | |
| 1792 | 1792 | // Likely. |
| 1793 | 1793 | $likely = array( |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | $likely['class'] = 'frm-likely-opts'; |
| 1803 | 1803 | } |
| 1804 | 1804 | |
| 1805 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 1805 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 1806 | 1806 | |
| 1807 | 1807 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 1808 | 1808 | } |
@@ -1977,16 +1977,16 @@ discard block |
||
| 1977 | 1977 | */ |
| 1978 | 1978 | private static function fill_image_setting_options( $options, &$args ) { |
| 1979 | 1979 | foreach ( $options as $key => $option ) { |
| 1980 | - $args['options'][ $key ] = $option; |
|
| 1980 | + $args['options'][$key] = $option; |
|
| 1981 | 1981 | |
| 1982 | 1982 | if ( ! empty( $option['addon'] ) ) { |
| 1983 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 1983 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 1984 | 1984 | } |
| 1985 | 1985 | |
| 1986 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 1986 | + unset( $args['options'][$key]['addon'] ); |
|
| 1987 | 1987 | $fill = array( 'upgrade', 'message', 'content' ); |
| 1988 | 1988 | foreach ( $fill as $f ) { |
| 1989 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 1989 | + unset( $args['options'][$key][$f], $f ); |
|
| 1990 | 1990 | } |
| 1991 | 1991 | } |
| 1992 | 1992 | } |
@@ -2007,8 +2007,8 @@ discard block |
||
| 2007 | 2007 | |
| 2008 | 2008 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2009 | 2009 | foreach ( $fill as $f ) { |
| 2010 | - if ( isset( $option[ $f ] ) ) { |
|
| 2011 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2010 | + if ( isset( $option[$f] ) ) { |
|
| 2011 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2012 | 2012 | } |
| 2013 | 2013 | } |
| 2014 | 2014 | |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | return $this->get_pagenum(); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - if ( isset( $this->_pagination_args[ $key ] ) ) { |
|
| 239 | - return $this->_pagination_args[ $key ]; |
|
| 238 | + if ( isset( $this->_pagination_args[$key] ) ) { |
|
| 239 | + return $this->_pagination_args[$key]; |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
@@ -284,8 +284,8 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | private function hidden_search_inputs( $param_name ) { |
| 287 | - if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
|
| 288 | - $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
|
| 287 | + if ( ! empty( $_REQUEST[$param_name] ) ) { |
|
| 288 | + $value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) ); |
|
| 289 | 289 | echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />'; |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | echo "<ul class='subsubsub'>\n"; |
| 331 | 331 | foreach ( $views as $class => $view ) { |
| 332 | - $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 332 | + $views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 333 | 333 | } |
| 334 | 334 | echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 335 | 335 | echo '</ul>'; |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | 'next' => __( 'Next page', 'formidable' ), |
| 703 | 703 | ); |
| 704 | 704 | |
| 705 | - return $labels[ $link ]; |
|
| 705 | + return $labels[$link]; |
|
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | private function current_url() { |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | |
| 796 | 796 | // If the primary column doesn't exist fall back to the |
| 797 | 797 | // first non-checkbox column. |
| 798 | - if ( ! isset( $columns[ $default ] ) ) { |
|
| 798 | + if ( ! isset( $columns[$default] ) ) { |
|
| 799 | 799 | $default = self::get_default_primary_column_name(); |
| 800 | 800 | } |
| 801 | 801 | |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | */ |
| 810 | 810 | $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); |
| 811 | 811 | |
| 812 | - if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { |
|
| 812 | + if ( empty( $column ) || ! isset( $columns[$column] ) ) { |
|
| 813 | 813 | $column = $default; |
| 814 | 814 | } |
| 815 | 815 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | // In 4.3, we added a fourth argument for primary column. |
| 832 | 832 | $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); |
| 833 | 833 | foreach ( $this->_column_headers as $key => $value ) { |
| 834 | - $column_headers[ $key ] = $value; |
|
| 834 | + $column_headers[$key] = $value; |
|
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | return $column_headers; |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | $data[1] = false; |
| 865 | 865 | } |
| 866 | 866 | |
| 867 | - $sortable[ $id ] = $data; |
|
| 867 | + $sortable[$id] = $data; |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | 870 | $primary = $this->get_primary_column_name(); |
@@ -941,8 +941,8 @@ discard block |
||
| 941 | 941 | $class[] = 'column-primary'; |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | - if ( isset( $sortable[ $column_key ] ) ) { |
|
| 945 | - list( $orderby, $desc_first ) = $sortable[ $column_key ]; |
|
| 944 | + if ( isset( $sortable[$column_key] ) ) { |
|
| 945 | + list( $orderby, $desc_first ) = $sortable[$column_key]; |
|
| 946 | 946 | |
| 947 | 947 | if ( $current_orderby == $orderby ) { |
| 948 | 948 | $order = 'asc' == $current_order ? 'desc' : 'asc'; |