@@ -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; |
@@ -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 ) ) { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | if ( in_array( $type, array( 'data', 'lookup' ), true ) ) { |
| 32 | 32 | $values['field_options']['data_type'] = $setting; |
| 33 | 33 | } else { |
| 34 | - $values['field_options'][ $setting ] = 1; |
|
| 34 | + $values['field_options'][$setting] = 1; |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | foreach ( $defaults as $opt => $default ) { |
| 141 | - $values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default; |
|
| 141 | + $values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default; |
|
| 142 | 142 | |
| 143 | 143 | if ( $check_post ) { |
| 144 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
| 144 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | unset( $opt, $default ); |
@@ -185,18 +185,18 @@ discard block |
||
| 185 | 185 | * @param mixed $value |
| 186 | 186 | */ |
| 187 | 187 | private static function get_posted_field_setting( $setting, &$value ) { |
| 188 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 188 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 189 | 189 | return; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | if ( strpos( $setting, 'html' ) !== false ) { |
| 193 | 193 | // Strip slashes from HTML but not regex or script tags. |
| 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 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 196 | 196 | // TODO: Remove stripslashes on output, and use on input only. |
| 197 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 197 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 198 | 198 | } else { |
| 199 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 199 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 200 | 200 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 270 | 270 | |
| 271 | 271 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 272 | - $values[ $col ] = $field->{$col}; |
|
| 272 | + $values[$col] = $field->{$col}; |
|
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | ); |
| 310 | 310 | |
| 311 | 311 | $msg = FrmField::get_option( $field, $error ); |
| 312 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 312 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 313 | 313 | $msg = do_shortcode( $msg ); |
| 314 | 314 | |
| 315 | 315 | return $msg; |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | $base_name = 'default_value_' . $field['id']; |
| 422 | - $html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field ); |
|
| 422 | + $html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field ); |
|
| 423 | 423 | |
| 424 | 424 | $default_type = self::get_default_value_type( $field ); |
| 425 | 425 | |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | continue; |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 752 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 753 | 753 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 754 | 754 | |
| 755 | 755 | $atts['entry'] = $entry; |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | if ( $replace_with !== null ) { |
| 760 | 760 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 761 | 761 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 762 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 762 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | unset( $atts, $replace_with ); |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | $supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' ); |
| 778 | 778 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 779 | 779 | foreach ( $included_atts as $included_att ) { |
| 780 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 780 | + if ( '0' === $atts[$included_att] ) { |
|
| 781 | 781 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 782 | 782 | continue; |
| 783 | 783 | } |
@@ -850,8 +850,8 @@ discard block |
||
| 850 | 850 | |
| 851 | 851 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' ); |
| 852 | 852 | |
| 853 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 854 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 853 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 854 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 855 | 855 | } elseif ( in_array( $atts['tag'], $dynamic_default ) ) { |
| 856 | 856 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 857 | 857 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1062,8 +1062,8 @@ discard block |
||
| 1062 | 1062 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1063 | 1063 | } elseif ( in_array( $type, $multiple_input ) ) { |
| 1064 | 1064 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1065 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1066 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1065 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1066 | + $field_types[$type] = $field_selection[$type]; |
|
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | 1069 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | |
| 1097 | 1097 | private static function field_types_for_input( $inputs, $fields, &$field_types ) { |
| 1098 | 1098 | foreach ( $inputs as $input ) { |
| 1099 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1099 | + $field_types[$input] = $fields[$input]; |
|
| 1100 | 1100 | unset( $input ); |
| 1101 | 1101 | } |
| 1102 | 1102 | } |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | 'parent' => false, |
| 1129 | 1129 | 'pointer' => false, |
| 1130 | 1130 | ); |
| 1131 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1131 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1132 | 1132 | |
| 1133 | 1133 | $opt_key = $args['opt_key']; |
| 1134 | 1134 | $field = $args['field']; |
@@ -1144,24 +1144,24 @@ discard block |
||
| 1144 | 1144 | |
| 1145 | 1145 | // Check posted vals before checking saved values |
| 1146 | 1146 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1147 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1147 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1148 | 1148 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1149 | 1149 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1150 | - $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 ] ) ) : ''; |
|
| 1150 | + $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] ) ) : ''; |
|
| 1151 | 1151 | } else { |
| 1152 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1152 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | 1155 | return $other_val; |
| 1156 | 1156 | |
| 1157 | - } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1157 | + } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1158 | 1158 | // For normal fields |
| 1159 | 1159 | |
| 1160 | 1160 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1161 | 1161 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1162 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1162 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1163 | 1163 | } else { |
| 1164 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1164 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | return $other_val; |
@@ -1171,8 +1171,8 @@ discard block |
||
| 1171 | 1171 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1172 | 1172 | // Check if there is an "other" val in saved value and make sure the |
| 1173 | 1173 | // "other" val is not equal to the Other checkbox option |
| 1174 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1175 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1174 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1175 | + $other_val = $field['value'][$opt_key]; |
|
| 1176 | 1176 | } |
| 1177 | 1177 | } else { |
| 1178 | 1178 | /** |
@@ -1184,8 +1184,8 @@ discard block |
||
| 1184 | 1184 | // Multi-select dropdowns - key is not preserved |
| 1185 | 1185 | if ( is_array( $field['value'] ) ) { |
| 1186 | 1186 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1187 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1188 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1187 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1188 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1189 | 1189 | } |
| 1190 | 1190 | } elseif ( $temp_val == $field['value'] ) { |
| 1191 | 1191 | // For radio and regular dropdowns |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | return $other_args; |
| 1228 | 1228 | } |
| 1229 | 1229 | |
| 1230 | - $other_opt = true; |
|
| 1230 | + $other_opt = true; |
|
| 1231 | 1231 | |
| 1232 | 1232 | self::set_other_name( $args, $other_args ); |
| 1233 | 1233 | self::set_other_value( $args, $other_args ); |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | if ( is_array( $val ) ) { |
| 1386 | 1386 | foreach ( $val as $k => $v ) { |
| 1387 | 1387 | if ( is_string( $v ) ) { |
| 1388 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1388 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1389 | 1389 | unset( $k, $v ); |
| 1390 | 1390 | } |
| 1391 | 1391 | } |
@@ -1738,7 +1738,7 @@ discard block |
||
| 1738 | 1738 | $countries['class'] = 'frm-countries-opts'; |
| 1739 | 1739 | } |
| 1740 | 1740 | |
| 1741 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 1741 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 1742 | 1742 | |
| 1743 | 1743 | // State abv. |
| 1744 | 1744 | $states = self::get_us_states(); |
@@ -1748,7 +1748,7 @@ discard block |
||
| 1748 | 1748 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 1749 | 1749 | } |
| 1750 | 1750 | |
| 1751 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 1751 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 1752 | 1752 | |
| 1753 | 1753 | // States. |
| 1754 | 1754 | $states = array_values( $states ); |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | $states['class'] = 'frm-states-opts'; |
| 1758 | 1758 | } |
| 1759 | 1759 | |
| 1760 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 1760 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 1761 | 1761 | unset( $state_abv, $states ); |
| 1762 | 1762 | |
| 1763 | 1763 | // Age. |
@@ -1775,7 +1775,7 @@ discard block |
||
| 1775 | 1775 | $ages['class'] = 'frm-age-opts'; |
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 1778 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 1779 | 1779 | |
| 1780 | 1780 | // Satisfaction. |
| 1781 | 1781 | $satisfaction = array( |
@@ -1790,7 +1790,7 @@ discard block |
||
| 1790 | 1790 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 1791 | 1791 | } |
| 1792 | 1792 | |
| 1793 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 1793 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 1794 | 1794 | |
| 1795 | 1795 | // Importance. |
| 1796 | 1796 | $importance = array( |
@@ -1805,7 +1805,7 @@ discard block |
||
| 1805 | 1805 | $importance['class'] = 'frm-importance-opts'; |
| 1806 | 1806 | } |
| 1807 | 1807 | |
| 1808 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 1808 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 1809 | 1809 | |
| 1810 | 1810 | // Agreement. |
| 1811 | 1811 | $agreement = array( |
@@ -1820,7 +1820,7 @@ discard block |
||
| 1820 | 1820 | $agreement['class'] = 'frm-agreement-opts'; |
| 1821 | 1821 | } |
| 1822 | 1822 | |
| 1823 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 1823 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 1824 | 1824 | |
| 1825 | 1825 | // Likely. |
| 1826 | 1826 | $likely = array( |
@@ -1835,7 +1835,7 @@ discard block |
||
| 1835 | 1835 | $likely['class'] = 'frm-likely-opts'; |
| 1836 | 1836 | } |
| 1837 | 1837 | |
| 1838 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 1838 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 1839 | 1839 | |
| 1840 | 1840 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 1841 | 1841 | } |
@@ -2042,16 +2042,16 @@ discard block |
||
| 2042 | 2042 | */ |
| 2043 | 2043 | private static function fill_image_setting_options( $options, &$args ) { |
| 2044 | 2044 | foreach ( $options as $key => $option ) { |
| 2045 | - $args['options'][ $key ] = $option; |
|
| 2045 | + $args['options'][$key] = $option; |
|
| 2046 | 2046 | |
| 2047 | 2047 | if ( ! empty( $option['addon'] ) ) { |
| 2048 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2048 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2049 | 2049 | } |
| 2050 | 2050 | |
| 2051 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2051 | + unset( $args['options'][$key]['addon'] ); |
|
| 2052 | 2052 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2053 | 2053 | foreach ( $fill as $f ) { |
| 2054 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2054 | + unset( $args['options'][$key][$f], $f ); |
|
| 2055 | 2055 | } |
| 2056 | 2056 | } |
| 2057 | 2057 | } |
@@ -2072,8 +2072,8 @@ discard block |
||
| 2072 | 2072 | |
| 2073 | 2073 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2074 | 2074 | foreach ( $fill as $f ) { |
| 2075 | - if ( isset( $option[ $f ] ) ) { |
|
| 2076 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2075 | + if ( isset( $option[$f] ) ) { |
|
| 2076 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2077 | 2077 | } |
| 2078 | 2078 | } |
| 2079 | 2079 | |
@@ -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'; |
@@ -114,13 +114,16 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public static function value_is_posted( $field, $args ) { |
| 116 | 116 | $value_is_posted = false; |
| 117 | - if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 117 | + if ( $_POST ) { |
|
| 118 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 118 | 119 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 119 | 120 | if ( $repeating ) { |
| 120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 121 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
| 122 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 121 | 123 | $value_is_posted = true; |
| 122 | 124 | } |
| 123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 125 | + } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
| 126 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 124 | 127 | $value_is_posted = true; |
| 125 | 128 | } |
| 126 | 129 | } |
@@ -322,8 +325,10 @@ discard block |
||
| 322 | 325 | * @since 4.01 |
| 323 | 326 | */ |
| 324 | 327 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 325 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 326 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 328 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
| 329 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 330 | + if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
| 331 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 327 | 332 | $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 328 | 333 | } |
| 329 | 334 | } else { |
@@ -395,7 +400,8 @@ discard block |
||
| 395 | 400 | self::set_other_repeating_vals( $field, $value, $args ); |
| 396 | 401 | |
| 397 | 402 | // Check if there are any posted "Other" values. |
| 398 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 403 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
| 404 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 399 | 405 | |
| 400 | 406 | // Save original value. |
| 401 | 407 | $args['temp_value'] = $value; |
@@ -425,7 +431,8 @@ discard block |
||
| 425 | 431 | } |
| 426 | 432 | |
| 427 | 433 | // Check if there are any other posted "other" values for this field. |
| 428 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 434 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
| 435 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 429 | 436 | // Save original value |
| 430 | 437 | $args['temp_value'] = $value; |
| 431 | 438 | $args['other'] = true; |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 138 | 138 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 139 | 139 | if ( $repeating ) { |
| 140 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 140 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 141 | 141 | $value_is_posted = true; |
| 142 | 142 | } |
| 143 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 143 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 144 | 144 | $value_is_posted = true; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
| 173 | 173 | |
| 174 | 174 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 175 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 175 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 176 | 176 | if ( ! empty( $add_atts ) ) { |
| 177 | 177 | $this_atts = array_merge( $atts, $add_atts ); |
| 178 | 178 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
| 183 | 183 | |
| 184 | 184 | // Add the default message. |
| 185 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 185 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $message; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @return string |
| 196 | 196 | */ |
| 197 | 197 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 198 | - $field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
| 198 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
| 199 | 199 | |
| 200 | 200 | if ( FrmAppHelper::pro_is_installed() ) { |
| 201 | 201 | $empty = empty( $field_value ); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
| 221 | 221 | } else { |
| 222 | 222 | // Get all values for this field. |
| 223 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
| 223 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
| 224 | 224 | |
| 225 | 225 | if ( $child_values ) { |
| 226 | 226 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | $value = $args['temp_value']; |
| 339 | 339 | } |
| 340 | 340 | if ( empty( $args['parent_field_id'] ) ) { |
| 341 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 341 | + $_POST['item_meta'][$field->id] = $value; |
|
| 342 | 342 | } else { |
| 343 | 343 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 344 | 344 | } |
@@ -350,17 +350,17 @@ discard block |
||
| 350 | 350 | * @since 4.01 |
| 351 | 351 | */ |
| 352 | 352 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 353 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 354 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 355 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 353 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 354 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 355 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 356 | 356 | } |
| 357 | 357 | } else { |
| 358 | 358 | // All of the section was probably removed. |
| 359 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 360 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 359 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 360 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 363 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -390,9 +390,9 @@ discard block |
||
| 390 | 390 | private static function get_posted_meta( $field_id, $args ) { |
| 391 | 391 | if ( empty( $args['parent_field_id'] ) ) { |
| 392 | 392 | // Sanitizing is done next. |
| 393 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 393 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 394 | 394 | } else { |
| 395 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 395 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 396 | 396 | } |
| 397 | 397 | return $value; |
| 398 | 398 | } |
@@ -423,14 +423,14 @@ discard block |
||
| 423 | 423 | self::set_other_repeating_vals( $field, $value, $args ); |
| 424 | 424 | |
| 425 | 425 | // Check if there are any posted "Other" values. |
| 426 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 426 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 427 | 427 | |
| 428 | 428 | // Save original value. |
| 429 | 429 | $args['temp_value'] = $value; |
| 430 | 430 | $args['other'] = true; |
| 431 | 431 | |
| 432 | 432 | // Sanitizing is done next. |
| 433 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 433 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 434 | 434 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 435 | 435 | |
| 436 | 436 | // Set the validation value now |
@@ -453,12 +453,12 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | // Check if there are any other posted "other" values for this field. |
| 456 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 456 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 457 | 457 | // Save original value |
| 458 | 458 | $args['temp_value'] = $value; |
| 459 | 459 | $args['other'] = true; |
| 460 | 460 | |
| 461 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 461 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 462 | 462 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 463 | 463 | |
| 464 | 464 | // Set the validation value now. |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 486 | 486 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 487 | 487 | foreach ( $other_vals as $k => $v ) { |
| 488 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 488 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 489 | 489 | // If the other box is checked, but doesn't have a value. |
| 490 | 490 | $value = ''; |
| 491 | 491 | break; |
@@ -502,25 +502,25 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | // Multi-select dropdown. |
| 504 | 504 | if ( is_array( $value ) ) { |
| 505 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 505 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 506 | 506 | |
| 507 | 507 | if ( $o_key !== false ) { |
| 508 | 508 | // Modify the original value so other key will be preserved. |
| 509 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 509 | + $value[$other_key] = $value[$o_key]; |
|
| 510 | 510 | |
| 511 | 511 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 512 | 512 | // If going backwards and forwards between pages, the array key will match the other key. |
| 513 | 513 | if ( $o_key !== $other_key ) { |
| 514 | - unset( $value[ $o_key ] ); |
|
| 514 | + unset( $value[$o_key] ); |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | $args['temp_value'] = $value; |
| 518 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 519 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 520 | - unset( $value[ $other_key ] ); |
|
| 518 | + $value[$other_key] = reset( $other_vals ); |
|
| 519 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 520 | + unset( $value[$other_key] ); |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 523 | + } elseif ( $field->options[$other_key] == $value ) { |
|
| 524 | 524 | $value = $other_vals; |
| 525 | 525 | } |
| 526 | 526 | } |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | * @return void |
| 732 | 732 | */ |
| 733 | 733 | public static function maybe_render_captcha_score( $entry_id ) { |
| 734 | - $query = array( |
|
| 734 | + $query = array( |
|
| 735 | 735 | 'item_id' => (int) $entry_id, |
| 736 | 736 | 'field_id' => 0, |
| 737 | 737 | ); |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | public static function get_entry_status_label( $status ) { |
| 785 | 785 | $statuses = self::get_entry_statuses(); |
| 786 | 786 | |
| 787 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
| 787 | + return $statuses[self::get_entry_status( $status )]; |
|
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
| 45 | 45 | $this->cache_key = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) ); |
| 46 | 46 | |
| 47 | - $frm_edd_plugin_data[ $this->slug ] = $this->api_data; |
|
| 47 | + $frm_edd_plugin_data[$this->slug] = $this->api_data; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Fires after the $frm_edd_plugin_data is setup. |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $_transient_data = new stdClass(); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { |
|
| 96 | + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) { |
|
| 97 | 97 | return $_transient_data; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | $version_info->plugin = $this->name; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - $_transient_data->response[ $this->name ] = $version_info; |
|
| 123 | + $_transient_data->response[$this->name] = $version_info; |
|
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $_transient_data->last_checked = time(); |
| 128 | - $_transient_data->checked[ $this->name ] = $this->version; |
|
| 128 | + $_transient_data->checked[$this->name] = $this->version; |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { |
| 190 | 190 | $new_sections = array(); |
| 191 | 191 | foreach ( $_data->sections as $key => $value ) { |
| 192 | - $new_sections[ $key ] = $value; |
|
| 192 | + $new_sections[$key] = $value; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $_data->sections = $new_sections; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { |
| 200 | 200 | $new_banners = array(); |
| 201 | 201 | foreach ( $_data->banners as $key => $value ) { |
| 202 | - $new_banners[ $key ] = $value; |
|
| 202 | + $new_banners[$key] = $value; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $_data->banners = $new_banners; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | $slug = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 319 | - $data = $frm_edd_plugin_data[ $slug ]; |
|
| 319 | + $data = $frm_edd_plugin_data[$slug]; |
|
| 320 | 320 | $beta = ! empty( $data['beta'] ) ? true : false; |
| 321 | 321 | $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 322 | 322 | $version_info = $this->get_cached_version_info( $cache_key ); |
@@ -303,11 +303,13 @@ |
||
| 303 | 303 | |
| 304 | 304 | global $frm_edd_plugin_data; |
| 305 | 305 | |
| 306 | - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 306 | + if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { |
|
| 307 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 307 | 308 | return; |
| 308 | 309 | } |
| 309 | 310 | |
| 310 | - if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 311 | + if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { |
|
| 312 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 311 | 313 | return; |
| 312 | 314 | } |
| 313 | 315 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $info['url'] = $xml; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
| 14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
| 15 | 15 | $url = isset( $info['url'] ) ? $info['url'] : ''; |
| 16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
| 17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | continue; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
| 24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
| 25 | 25 | ?> |
| 26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
| 27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | <?php } ?> |
| 42 | 42 | /> |
| 43 | 43 | <div class="frm_image_option_container frm_label_with_image"> |
| 44 | - <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
|
| 44 | + <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
|
| 45 | 45 | <span class="frm_text_label_for_image"> |
| 46 | 46 | <?php |
| 47 | 47 | if ( ! empty( $disabled ) ) { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ( $importing === 'form' && $disabled ) { |
| 57 | - echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 57 | + echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 58 | 58 | } else { |
| 59 | 59 | echo esc_html( $info['name'] ); |
| 60 | 60 | } |
@@ -749,8 +749,8 @@ discard block |
||
| 749 | 749 | */ |
| 750 | 750 | public static function get_shortcode_tag( $shortcodes, $short_key, $args ) { |
| 751 | 751 | _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' ); |
| 752 | - return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
| 753 | - } |
|
| 752 | + return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
| 753 | + } |
|
| 754 | 754 | |
| 755 | 755 | /** |
| 756 | 756 | * @deprecated 3.01 |
@@ -763,52 +763,52 @@ discard block |
||
| 763 | 763 | /** |
| 764 | 764 | * @deprecated 3.02.03 |
| 765 | 765 | */ |
| 766 | - public static function jquery_themes() { |
|
| 766 | + public static function jquery_themes() { |
|
| 767 | 767 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' ); |
| 768 | 768 | |
| 769 | - $themes = array( |
|
| 770 | - 'ui-lightness' => 'UI Lightness', |
|
| 771 | - 'ui-darkness' => 'UI Darkness', |
|
| 772 | - 'smoothness' => 'Smoothness', |
|
| 773 | - 'start' => 'Start', |
|
| 774 | - 'redmond' => 'Redmond', |
|
| 775 | - 'sunny' => 'Sunny', |
|
| 776 | - 'overcast' => 'Overcast', |
|
| 777 | - 'le-frog' => 'Le Frog', |
|
| 778 | - 'flick' => 'Flick', |
|
| 769 | + $themes = array( |
|
| 770 | + 'ui-lightness' => 'UI Lightness', |
|
| 771 | + 'ui-darkness' => 'UI Darkness', |
|
| 772 | + 'smoothness' => 'Smoothness', |
|
| 773 | + 'start' => 'Start', |
|
| 774 | + 'redmond' => 'Redmond', |
|
| 775 | + 'sunny' => 'Sunny', |
|
| 776 | + 'overcast' => 'Overcast', |
|
| 777 | + 'le-frog' => 'Le Frog', |
|
| 778 | + 'flick' => 'Flick', |
|
| 779 | 779 | 'pepper-grinder' => 'Pepper Grinder', |
| 780 | - 'eggplant' => 'Eggplant', |
|
| 781 | - 'dark-hive' => 'Dark Hive', |
|
| 782 | - 'cupertino' => 'Cupertino', |
|
| 783 | - 'south-street' => 'South Street', |
|
| 784 | - 'blitzer' => 'Blitzer', |
|
| 785 | - 'humanity' => 'Humanity', |
|
| 786 | - 'hot-sneaks' => 'Hot Sneaks', |
|
| 787 | - 'excite-bike' => 'Excite Bike', |
|
| 788 | - 'vader' => 'Vader', |
|
| 789 | - 'dot-luv' => 'Dot Luv', |
|
| 790 | - 'mint-choc' => 'Mint Choc', |
|
| 791 | - 'black-tie' => 'Black Tie', |
|
| 792 | - 'trontastic' => 'Trontastic', |
|
| 793 | - 'swanky-purse' => 'Swanky Purse', |
|
| 794 | - ); |
|
| 780 | + 'eggplant' => 'Eggplant', |
|
| 781 | + 'dark-hive' => 'Dark Hive', |
|
| 782 | + 'cupertino' => 'Cupertino', |
|
| 783 | + 'south-street' => 'South Street', |
|
| 784 | + 'blitzer' => 'Blitzer', |
|
| 785 | + 'humanity' => 'Humanity', |
|
| 786 | + 'hot-sneaks' => 'Hot Sneaks', |
|
| 787 | + 'excite-bike' => 'Excite Bike', |
|
| 788 | + 'vader' => 'Vader', |
|
| 789 | + 'dot-luv' => 'Dot Luv', |
|
| 790 | + 'mint-choc' => 'Mint Choc', |
|
| 791 | + 'black-tie' => 'Black Tie', |
|
| 792 | + 'trontastic' => 'Trontastic', |
|
| 793 | + 'swanky-purse' => 'Swanky Purse', |
|
| 794 | + ); |
|
| 795 | 795 | |
| 796 | 796 | $themes = apply_filters( 'frm_jquery_themes', $themes ); |
| 797 | - return $themes; |
|
| 798 | - } |
|
| 797 | + return $themes; |
|
| 798 | + } |
|
| 799 | 799 | |
| 800 | 800 | /** |
| 801 | 801 | * @deprecated 3.02.03 |
| 802 | 802 | */ |
| 803 | - public static function enqueue_jquery_css() { |
|
| 803 | + public static function enqueue_jquery_css() { |
|
| 804 | 804 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' ); |
| 805 | 805 | |
| 806 | 806 | $form = self::get_form_for_page(); |
| 807 | 807 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
| 808 | - if ( $theme_css != -1 ) { |
|
| 808 | + if ( $theme_css != -1 ) { |
|
| 809 | 809 | wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
| 810 | - } |
|
| 811 | - } |
|
| 810 | + } |
|
| 811 | + } |
|
| 812 | 812 | |
| 813 | 813 | /** |
| 814 | 814 | * @deprecated 3.02.03 |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | return FrmProStylesController::jquery_css_url( $theme_css ); |
| 824 | - } |
|
| 824 | + } |
|
| 825 | 825 | |
| 826 | 826 | /** |
| 827 | 827 | * @deprecated 3.02.03 |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| 28 | 28 | |
| 29 | 29 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
| 30 | - $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ]; |
|
| 30 | + $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action]; |
|
| 31 | 31 | |
| 32 | 32 | if ( $action === 'create' ) { |
| 33 | 33 | FrmFormsController::update( $values ); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $values = FrmFormsHelper::setup_new_vars( $values ); |
| 38 | - $id = FrmForm::create( $values ); |
|
| 38 | + $id = FrmForm::create( $values ); |
|
| 39 | 39 | $values['id'] = $id; |
| 40 | 40 | |
| 41 | 41 | FrmFormsController::edit( $values ); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | 'title' => esc_attr__( 'Toggle Options', 'formidable' ), |
| 17 | 17 | ) |
| 18 | 18 | ); |
| 19 | - $e_args = array( |
|
| 19 | + $e_args = array( |
|
| 20 | 20 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
| 21 | 21 | 'textarea_rows' => 8, |
| 22 | 22 | ); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | $data_keys = array_keys( $data ); |
| 7 | 7 | $params = array(); |
| 8 | 8 | foreach ( $data_keys as $key ) { |
| 9 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
| 9 | + $params['data-' . $key] = $data[$key]; |
|
| 10 | 10 | } |
| 11 | 11 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
| 12 | 12 | $params['href'] = '#'; |