@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @param string $type |
111 | 111 | * |
112 | - * @return array |
|
112 | + * @return string |
|
113 | 113 | */ |
114 | 114 | public static function get_default_field_options( $type ) { |
115 | 115 | $field_type = FrmFieldFactory::get_field_type( $type ); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * |
213 | 213 | * @param object $field |
214 | 214 | * |
215 | - * @return array |
|
215 | + * @return stdClass |
|
216 | 216 | */ |
217 | 217 | private static function get_original_field( $field ) { |
218 | 218 | $original_type = FrmField::get_option( $field, 'original_type' ); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * |
241 | 241 | * @param string $type |
242 | 242 | * |
243 | - * @return array |
|
243 | + * @return string |
|
244 | 244 | */ |
245 | 245 | public static function get_default_field( $type ) { |
246 | 246 | $field_type = FrmFieldFactory::get_field_type( $type ); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2.0 |
266 | 266 | * |
267 | 267 | * @param $field |
268 | - * @param $error |
|
268 | + * @param string $error |
|
269 | 269 | * |
270 | 270 | * @return string |
271 | 271 | */ |
@@ -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,20 +180,20 @@ 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 ] ) ) { |
|
183 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { |
|
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 | 189 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
190 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); |
|
190 | + $value = wp_unslash( $_POST['field_options'][$setting] ); |
|
191 | 191 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
192 | 192 | // TODO: Remove stripslashes on output, and use on input only. |
193 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // WPCS: sanitization ok. |
|
193 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // WPCS: sanitization ok. |
|
194 | 194 | } else { |
195 | 195 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
196 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); |
|
196 | + $value = wp_unslash( $_POST['field_options'][$setting] ); |
|
197 | 197 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
198 | 198 | } |
199 | 199 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
267 | 267 | |
268 | 268 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
269 | - $values[ $col ] = $field->{$col}; |
|
269 | + $values[$col] = $field->{$col}; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | ); |
307 | 307 | |
308 | 308 | $msg = FrmField::get_option( $field, $error ); |
309 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
309 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
310 | 310 | $msg = do_shortcode( $msg ); |
311 | 311 | |
312 | 312 | 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 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | continue; |
713 | 713 | } |
714 | 714 | |
715 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
715 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
716 | 716 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
717 | 717 | |
718 | 718 | $atts['entry'] = $entry; |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | |
722 | 722 | if ( $replace_with !== null ) { |
723 | 723 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
724 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
724 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | unset( $atts, $replace_with ); |
@@ -764,8 +764,8 @@ discard block |
||
764 | 764 | |
765 | 765 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' ); |
766 | 766 | |
767 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
768 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
767 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
768 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
769 | 769 | } elseif ( in_array( $atts['tag'], $dynamic_default ) ) { |
770 | 770 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
771 | 771 | } elseif ( $clean_tag == 'user_agent' ) { |
@@ -976,8 +976,8 @@ discard block |
||
976 | 976 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
977 | 977 | } elseif ( in_array( $type, $multiple_input ) ) { |
978 | 978 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
979 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
980 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
979 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
980 | + $field_types[$type] = $field_selection[$type]; |
|
981 | 981 | } |
982 | 982 | |
983 | 983 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type' ) ); |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | |
1011 | 1011 | private static function field_types_for_input( $inputs, $fields, &$field_types ) { |
1012 | 1012 | foreach ( $inputs as $input ) { |
1013 | - $field_types[ $input ] = $fields[ $input ]; |
|
1013 | + $field_types[$input] = $fields[$input]; |
|
1014 | 1014 | unset( $input ); |
1015 | 1015 | } |
1016 | 1016 | } |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | 'parent' => false, |
1043 | 1043 | 'pointer' => false, |
1044 | 1044 | ); |
1045 | - $args = wp_parse_args( $args, $defaults ); |
|
1045 | + $args = wp_parse_args( $args, $defaults ); |
|
1046 | 1046 | |
1047 | 1047 | $opt_key = $args['opt_key']; |
1048 | 1048 | $field = $args['field']; |
@@ -1058,22 +1058,22 @@ discard block |
||
1058 | 1058 | |
1059 | 1059 | // Check posted vals before checking saved values |
1060 | 1060 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
1061 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { |
|
1061 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { |
|
1062 | 1062 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
1063 | - $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 ] ) ) : ''; |
|
1063 | + $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] ) ) : ''; |
|
1064 | 1064 | } else { |
1065 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); |
|
1065 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); |
|
1066 | 1066 | } |
1067 | 1067 | |
1068 | 1068 | return $other_val; |
1069 | 1069 | |
1070 | - } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { |
|
1070 | + } elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { |
|
1071 | 1071 | // For normal fields |
1072 | 1072 | |
1073 | 1073 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
1074 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
1074 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
1075 | 1075 | } else { |
1076 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); |
|
1076 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | return $other_val; |
@@ -1083,8 +1083,8 @@ discard block |
||
1083 | 1083 | if ( $field['type'] == 'checkbox' && is_array( $field['value'] ) ) { |
1084 | 1084 | // Check if there is an "other" val in saved value and make sure the |
1085 | 1085 | // "other" val is not equal to the Other checkbox option |
1086 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
1087 | - $other_val = $field['value'][ $opt_key ]; |
|
1086 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
1087 | + $other_val = $field['value'][$opt_key]; |
|
1088 | 1088 | } |
1089 | 1089 | } else { |
1090 | 1090 | /** |
@@ -1096,8 +1096,8 @@ discard block |
||
1096 | 1096 | // Multi-select dropdowns - key is not preserved |
1097 | 1097 | if ( is_array( $field['value'] ) ) { |
1098 | 1098 | $o_key = array_search( $temp_val, $field['value'] ); |
1099 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
1100 | - unset( $field['value'][ $o_key ], $o_key ); |
|
1099 | + if ( isset( $field['value'][$o_key] ) ) { |
|
1100 | + unset( $field['value'][$o_key], $o_key ); |
|
1101 | 1101 | } |
1102 | 1102 | } elseif ( $temp_val == $field['value'] ) { |
1103 | 1103 | // For radio and regular dropdowns |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | return $other_args; |
1140 | 1140 | } |
1141 | 1141 | |
1142 | - $other_opt = true; |
|
1142 | + $other_opt = true; |
|
1143 | 1143 | |
1144 | 1144 | self::set_other_name( $args, $other_args ); |
1145 | 1145 | self::set_other_value( $args, $other_args ); |
@@ -1289,7 +1289,7 @@ discard block |
||
1289 | 1289 | if ( is_array( $val ) ) { |
1290 | 1290 | foreach ( $val as $k => $v ) { |
1291 | 1291 | if ( is_string( $v ) ) { |
1292 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
1292 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
1293 | 1293 | unset( $k, $v ); |
1294 | 1294 | } |
1295 | 1295 | } |
@@ -1628,19 +1628,19 @@ discard block |
||
1628 | 1628 | } |
1629 | 1629 | |
1630 | 1630 | public static function get_bulk_prefilled_opts( array &$prepop ) { |
1631 | - $prepop[ __( 'Countries', 'formidable' ) ] = self::get_countries(); |
|
1631 | + $prepop[__( 'Countries', 'formidable' )] = self::get_countries(); |
|
1632 | 1632 | |
1633 | 1633 | $states = self::get_us_states(); |
1634 | 1634 | $state_abv = array_keys( $states ); |
1635 | 1635 | sort( $state_abv ); |
1636 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
1636 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
1637 | 1637 | |
1638 | 1638 | $states = array_values( $states ); |
1639 | 1639 | sort( $states ); |
1640 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
1640 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
1641 | 1641 | unset( $state_abv, $states ); |
1642 | 1642 | |
1643 | - $prepop[ __( 'Age', 'formidable' ) ] = array( |
|
1643 | + $prepop[__( 'Age', 'formidable' )] = array( |
|
1644 | 1644 | __( 'Under 18', 'formidable' ), |
1645 | 1645 | __( '18-24', 'formidable' ), |
1646 | 1646 | __( '25-34', 'formidable' ), |
@@ -1651,7 +1651,7 @@ discard block |
||
1651 | 1651 | __( 'Prefer Not to Answer', 'formidable' ), |
1652 | 1652 | ); |
1653 | 1653 | |
1654 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = array( |
|
1654 | + $prepop[__( 'Satisfaction', 'formidable' )] = array( |
|
1655 | 1655 | __( 'Very Satisfied', 'formidable' ), |
1656 | 1656 | __( 'Satisfied', 'formidable' ), |
1657 | 1657 | __( 'Neutral', 'formidable' ), |
@@ -1660,7 +1660,7 @@ discard block |
||
1660 | 1660 | __( 'N/A', 'formidable' ), |
1661 | 1661 | ); |
1662 | 1662 | |
1663 | - $prepop[ __( 'Importance', 'formidable' ) ] = array( |
|
1663 | + $prepop[__( 'Importance', 'formidable' )] = array( |
|
1664 | 1664 | __( 'Very Important', 'formidable' ), |
1665 | 1665 | __( 'Important', 'formidable' ), |
1666 | 1666 | __( 'Neutral', 'formidable' ), |
@@ -1669,7 +1669,7 @@ discard block |
||
1669 | 1669 | __( 'N/A', 'formidable' ), |
1670 | 1670 | ); |
1671 | 1671 | |
1672 | - $prepop[ __( 'Agreement', 'formidable' ) ] = array( |
|
1672 | + $prepop[__( 'Agreement', 'formidable' )] = array( |
|
1673 | 1673 | __( 'Strongly Agree', 'formidable' ), |
1674 | 1674 | __( 'Agree', 'formidable' ), |
1675 | 1675 | __( 'Neutral', 'formidable' ), |
@@ -278,6 +278,9 @@ discard block |
||
278 | 278 | FrmAppHelper::show_search_box( compact( 'text', 'input_id' ) ); |
279 | 279 | } |
280 | 280 | |
281 | + /** |
|
282 | + * @param string $param_name |
|
283 | + */ |
|
281 | 284 | private function hidden_search_inputs( $param_name ) { |
282 | 285 | if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
283 | 286 | $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
@@ -418,6 +421,9 @@ discard block |
||
418 | 421 | return $action; |
419 | 422 | } |
420 | 423 | |
424 | + /** |
|
425 | + * @param string $action_name |
|
426 | + */ |
|
421 | 427 | private static function get_bulk_action( $action_name ) { |
422 | 428 | $action = false; |
423 | 429 | $action_param = self::get_param( |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | return $this->get_pagenum(); |
231 | 231 | } |
232 | 232 | |
233 | - if ( isset( $this->_pagination_args[ $key ] ) ) { |
|
234 | - return $this->_pagination_args[ $key ]; |
|
233 | + if ( isset( $this->_pagination_args[$key] ) ) { |
|
234 | + return $this->_pagination_args[$key]; |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | |
@@ -279,8 +279,8 @@ discard block |
||
279 | 279 | } |
280 | 280 | |
281 | 281 | private function hidden_search_inputs( $param_name ) { |
282 | - if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
|
283 | - $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
|
282 | + if ( ! empty( $_REQUEST[$param_name] ) ) { |
|
283 | + $value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) ); |
|
284 | 284 | echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />'; |
285 | 285 | } |
286 | 286 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | echo "<ul class='subsubsub'>\n"; |
326 | 326 | foreach ( $views as $class => $view ) { |
327 | - $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
327 | + $views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
328 | 328 | } |
329 | 329 | echo implode( " |</li>\n", $views ) . "</li>\n"; // WPCS: XSS ok. |
330 | 330 | echo '</ul>'; |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | 'next' => __( 'Next page', 'formidable' ), |
683 | 683 | ); |
684 | 684 | |
685 | - return $labels[ $link ]; |
|
685 | + return $labels[$link]; |
|
686 | 686 | } |
687 | 687 | |
688 | 688 | private function current_url() { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | |
776 | 776 | // If the primary column doesn't exist fall back to the |
777 | 777 | // first non-checkbox column. |
778 | - if ( ! isset( $columns[ $default ] ) ) { |
|
778 | + if ( ! isset( $columns[$default] ) ) { |
|
779 | 779 | $default = self::get_default_primary_column_name(); |
780 | 780 | } |
781 | 781 | |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | */ |
790 | 790 | $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); |
791 | 791 | |
792 | - if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { |
|
792 | + if ( empty( $column ) || ! isset( $columns[$column] ) ) { |
|
793 | 793 | $column = $default; |
794 | 794 | } |
795 | 795 | |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | // In 4.3, we added a fourth argument for primary column. |
812 | 812 | $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); |
813 | 813 | foreach ( $this->_column_headers as $key => $value ) { |
814 | - $column_headers[ $key ] = $value; |
|
814 | + $column_headers[$key] = $value; |
|
815 | 815 | } |
816 | 816 | |
817 | 817 | return $column_headers; |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $data[1] = false; |
845 | 845 | } |
846 | 846 | |
847 | - $sortable[ $id ] = $data; |
|
847 | + $sortable[$id] = $data; |
|
848 | 848 | } |
849 | 849 | |
850 | 850 | $primary = $this->get_primary_column_name(); |
@@ -921,8 +921,8 @@ discard block |
||
921 | 921 | $class[] = 'column-primary'; |
922 | 922 | } |
923 | 923 | |
924 | - if ( isset( $sortable[ $column_key ] ) ) { |
|
925 | - list( $orderby, $desc_first ) = $sortable[ $column_key ]; |
|
924 | + if ( isset( $sortable[$column_key] ) ) { |
|
925 | + list( $orderby, $desc_first ) = $sortable[$column_key]; |
|
926 | 926 | |
927 | 927 | if ( $current_orderby == $orderby ) { |
928 | 928 | $order = 'asc' == $current_order ? 'desc' : 'asc'; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | /** |
184 | 184 | * @since 2.0 |
185 | - * @return The class for this icon |
|
185 | + * @return string class for this icon |
|
186 | 186 | */ |
187 | 187 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
188 | 188 | if ( 'arrow' == $type && is_numeric( $key ) ) { |
@@ -379,6 +379,7 @@ discard block |
||
379 | 379 | |
380 | 380 | /** |
381 | 381 | * @since 2.3 |
382 | + * @param string $default |
|
382 | 383 | */ |
383 | 384 | private static function get_color_output( $default, &$color ) { |
384 | 385 | $color = trim( $color ); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | '-' => 'down', |
192 | 192 | '+' => 'up', |
193 | 193 | ); |
194 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
194 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
195 | 195 | } else { |
196 | 196 | //frm_minus1_icon |
197 | 197 | $key = str_replace( 'p', '', $key ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | '-' => 'minus', |
200 | 200 | '+' => 'plus', |
201 | 201 | ); |
202 | - $class = 'frm_' . $plus[ $icon ]; |
|
202 | + $class = 'frm_' . $plus[$icon]; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | if ( $key ) { |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | ?> |
220 | 220 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
221 | 221 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
222 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
223 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
222 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
223 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
224 | 224 | <b class="caret"></b> |
225 | 225 | </button> |
226 | 226 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | <li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>> |
229 | 229 | <a href="javascript:void(0);"> |
230 | 230 | <label> |
231 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/> |
|
231 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/> |
|
232 | 232 | <span> |
233 | 233 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?> |
234 | 234 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?> |
@@ -310,15 +310,15 @@ discard block |
||
310 | 310 | $vars = array_diff( $vars, $remove ); |
311 | 311 | |
312 | 312 | foreach ( $vars as $var ) { |
313 | - if ( ! isset( $settings[ $var ] ) ) { |
|
313 | + if ( ! isset( $settings[$var] ) ) { |
|
314 | 314 | continue; |
315 | 315 | } |
316 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
317 | - $defaults[ $var ] = ''; |
|
316 | + if ( ! isset( $defaults[$var] ) ) { |
|
317 | + $defaults[$var] = ''; |
|
318 | 318 | } |
319 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
319 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
320 | 320 | if ( $show ) { |
321 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // WPCS: XSS ok. |
|
321 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // WPCS: XSS ok. |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | } |
@@ -358,14 +358,14 @@ discard block |
||
358 | 358 | $settings['style_class'] = 'frm_style_' . $style->post_name . '.'; |
359 | 359 | } |
360 | 360 | |
361 | - $settings['style_class'] .= 'with_frm_style'; |
|
361 | + $settings['style_class'] .= 'with_frm_style'; |
|
362 | 362 | $settings['font'] = stripslashes( $settings['font'] ); |
363 | 363 | $settings['change_margin'] = self::description_margin_for_screensize( $settings['width'] ); |
364 | 364 | |
365 | 365 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
366 | 366 | foreach ( $checkbox_opts as $opt ) { |
367 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
368 | - $settings[ $opt ] = 0; |
|
367 | + if ( ! isset( $settings[$opt] ) ) { |
|
368 | + $settings[$opt] = 0; |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $css = ''; |
390 | 390 | } |
391 | 391 | foreach ( $opts as $opt ) { |
392 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
392 | + self::get_color_output( $css, $settings[$opt] ); |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 | } |
@@ -166,7 +166,7 @@ |
||
166 | 166 | * @since 2.02.05 |
167 | 167 | * |
168 | 168 | * @param string $key |
169 | - * @param int|string $value |
|
169 | + * @param string $value |
|
170 | 170 | * @param string $where |
171 | 171 | */ |
172 | 172 | private static function add_query_placeholder( $key, $value, &$where ) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | foreach ( $args as $key => $value ) { |
64 | - $where .= empty( $where ) ? $base_where : $condition; |
|
64 | + $where .= empty( $where ) ? $base_where : $condition; |
|
65 | 65 | $array_inc_null = ( ! is_numeric( $key ) && is_array( $value ) && in_array( null, $value ) ); |
66 | 66 | if ( is_numeric( $key ) || $array_inc_null ) { |
67 | 67 | $where .= ' ( '; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | if ( strpos( $key, 'created_at' ) !== false || strpos( $key, 'updated_at' ) !== false ) { |
98 | 98 | $k = explode( ' ', $key ); |
99 | - $where .= ' DATE_FORMAT(' . reset( $k ) . ', %s) ' . str_replace( reset( $k ), '', $key ); |
|
99 | + $where .= ' DATE_FORMAT(' . reset( $k ) . ', %s) ' . str_replace( reset( $k ), '', $key ); |
|
100 | 100 | $values[] = '%Y-%m-%d %H:%i:%s'; |
101 | 101 | } else { |
102 | 102 | $where .= ' ' . $key; |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | $where .= ' OR '; |
117 | 117 | } |
118 | 118 | $start = false; |
119 | - $where .= $key . ' %s'; |
|
119 | + $where .= $key . ' %s'; |
|
120 | 120 | $values[] = '%' . self::esc_like( $v ) . '%'; |
121 | 121 | } |
122 | 122 | $where .= ')'; |
123 | 123 | } elseif ( ! empty( $value ) ) { |
124 | - $where .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')'; |
|
124 | + $where .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')'; |
|
125 | 125 | $values = array_merge( $values, $value ); |
126 | 126 | } |
127 | 127 | } elseif ( strpos( $lowercase_key, 'like' ) !== false ) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $where .= 'like'; |
142 | 142 | } |
143 | 143 | |
144 | - $where .= ' %s'; |
|
144 | + $where .= ' %s'; |
|
145 | 145 | $values[] = $start . self::esc_like( $value ) . $end; |
146 | 146 | |
147 | 147 | } elseif ( $value === null ) { |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | ); |
307 | 307 | |
308 | 308 | $where_is = strtolower( $where_is ); |
309 | - if ( isset( $switch_to[ $where_is ] ) ) { |
|
310 | - return ' ' . $switch_to[ $where_is ]; |
|
309 | + if ( isset( $switch_to[$where_is] ) ) { |
|
310 | + return ' ' . $switch_to[$where_is]; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | // > and < need a little more work since we don't want them switched to >= and <= |
@@ -360,13 +360,13 @@ discard block |
||
360 | 360 | $temp_args = $args; |
361 | 361 | foreach ( $temp_args as $k => $v ) { |
362 | 362 | if ( $v == '' ) { |
363 | - unset( $args[ $k ] ); |
|
363 | + unset( $args[$k] ); |
|
364 | 364 | continue; |
365 | 365 | } |
366 | 366 | |
367 | 367 | $db_name = strtoupper( str_replace( '_', ' ', $k ) ); |
368 | 368 | if ( strpos( $v, $db_name ) === false ) { |
369 | - $args[ $k ] = $db_name . ' ' . $v; |
|
369 | + $args[$k] = $db_name . ' ' . $v; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | |
@@ -440,13 +440,13 @@ discard block |
||
440 | 440 | private static function esc_query_args( &$args ) { |
441 | 441 | foreach ( $args as $param => $value ) { |
442 | 442 | if ( $param == 'order_by' ) { |
443 | - $args[ $param ] = self::esc_order( $value ); |
|
443 | + $args[$param] = self::esc_order( $value ); |
|
444 | 444 | } elseif ( $param == 'limit' ) { |
445 | - $args[ $param ] = self::esc_limit( $value ); |
|
445 | + $args[$param] = self::esc_limit( $value ); |
|
446 | 446 | } |
447 | 447 | |
448 | - if ( $args[ $param ] == '' ) { |
|
449 | - unset( $args[ $param ] ); |
|
448 | + if ( $args[$param] == '' ) { |
|
449 | + unset( $args[$param] ); |
|
450 | 450 | } |
451 | 451 | } |
452 | 452 | } |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | $limit = explode( ',', trim( $limit ) ); |
530 | 530 | foreach ( $limit as $k => $l ) { |
531 | 531 | if ( is_numeric( $l ) ) { |
532 | - $limit[ $k ] = $l; |
|
532 | + $limit[$k] = $l; |
|
533 | 533 | } |
534 | 534 | } |
535 | 535 | |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public static function add_key_to_group_cache( $key, $group ) { |
667 | 667 | $cached = self::get_group_cached_keys( $group ); |
668 | - $cached[ $key ] = $key; |
|
668 | + $cached[$key] = $key; |
|
669 | 669 | wp_cache_set( 'cached_keys', $cached, $group, 300 ); |
670 | 670 | } |
671 | 671 |
@@ -202,6 +202,7 @@ discard block |
||
202 | 202 | * |
203 | 203 | * @param int $id |
204 | 204 | * @param array $values |
205 | + * @param string $update_type |
|
205 | 206 | * |
206 | 207 | * @return boolean|int $query_results |
207 | 208 | */ |
@@ -612,6 +613,9 @@ discard block |
||
612 | 613 | return $new_values; |
613 | 614 | } |
614 | 615 | |
616 | + /** |
|
617 | + * @param string $name |
|
618 | + */ |
|
615 | 619 | private static function get_entry_value( $values, $name, $default ) { |
616 | 620 | return isset( $values[ $name ] ) ? $values[ $name ] : $default; |
617 | 621 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $metas = FrmEntryMeta::get_entry_meta_info( $entry_exist ); |
78 | 78 | $field_metas = array(); |
79 | 79 | foreach ( $metas as $meta ) { |
80 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
80 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | $reduced = array(); |
132 | 132 | foreach ( $filter_vals as $field_id => $value ) { |
133 | 133 | $field = FrmFieldFactory::get_field_object( $field_id ); |
134 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
135 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
136 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
137 | - unset( $reduced[ $field_id ] ); |
|
134 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
135 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
136 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
137 | + unset( $reduced[$field_id] ); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | return $reduced; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it |
328 | 328 | LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE "; |
329 | 329 | |
330 | - $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
330 | + $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
331 | 331 | $query_args = array( $id ); |
332 | 332 | $query = $wpdb->prepare( $query, $query_args ); // WPCS: unprepared SQL ok. |
333 | 333 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | private static function prepare_entries( &$entries ) { |
373 | 373 | foreach ( $entries as $k => $entry ) { |
374 | 374 | self::prepare_entry( $entry ); |
375 | - $entries[ $k ] = $entry; |
|
375 | + $entries[$k] = $entry; |
|
376 | 376 | } |
377 | 377 | } |
378 | 378 | |
@@ -397,20 +397,20 @@ discard block |
||
397 | 397 | foreach ( $metas as $meta_val ) { |
398 | 398 | if ( $meta_val->item_id == $entry->id ) { |
399 | 399 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
400 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
400 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
401 | 401 | if ( $include_key ) { |
402 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
402 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
403 | 403 | } |
404 | 404 | continue; |
405 | 405 | } |
406 | 406 | |
407 | 407 | // include sub entries in an array |
408 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
409 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
408 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
409 | + $entry->metas[$meta_val->field_id] = array(); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
413 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
413 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
414 | 414 | |
415 | 415 | unset( $meta_val ); |
416 | 416 | } |
@@ -457,13 +457,13 @@ discard block |
||
457 | 457 | |
458 | 458 | if ( $inc_form ) { |
459 | 459 | $fields = 'it.*, fr.name as form_name,fr.form_key as form_key'; |
460 | - $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
460 | + $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) { |
464 | 464 | // sort by a requested field |
465 | 465 | $field_id = (int) $order_matches[1]; |
466 | - $fields .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id; |
|
466 | + $fields .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id; |
|
467 | 467 | unset( $order_matches, $field_id ); |
468 | 468 | } |
469 | 469 | |
@@ -503,16 +503,16 @@ discard block |
||
503 | 503 | } |
504 | 504 | |
505 | 505 | foreach ( $metas as $m_key => $meta_val ) { |
506 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
506 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
507 | 507 | continue; |
508 | 508 | } |
509 | 509 | |
510 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
511 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
510 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
511 | + $entries[$meta_val->item_id]->metas = array(); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
515 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
515 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
516 | 516 | unset( $m_key, $meta_val ); |
517 | 517 | } |
518 | 518 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | } |
671 | 671 | |
672 | 672 | private static function get_entry_value( $values, $name, $default ) { |
673 | - return isset( $values[ $name ] ) ? $values[ $name ] : $default; |
|
673 | + return isset( $values[$name] ) ? $values[$name] : $default; |
|
674 | 674 | } |
675 | 675 | |
676 | 676 | /** |
@@ -31,6 +31,10 @@ |
||
31 | 31 | */ |
32 | 32 | protected $option_label = ''; |
33 | 33 | |
34 | + /** |
|
35 | + * @param string $option_key |
|
36 | + * @param string $option |
|
37 | + */ |
|
34 | 38 | public function __construct( $option_key, $option, $args = array() ) { |
35 | 39 | $this->option_key = $option_key; |
36 | 40 | $this->option = $option; |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | public $id = 0; // the id of the post |
6 | 6 | |
7 | 7 | /** |
8 | - * @param int|string $id The id of the stylsheet or 'default' |
|
8 | + * @param integer $id The id of the stylsheet or 'default' |
|
9 | 9 | */ |
10 | 10 | public function __construct( $id = 0 ) { |
11 | 11 | $this->id = $id; |
@@ -150,6 +150,9 @@ discard block |
||
150 | 150 | set_transient( 'frmpro_css', $css, MONTH_IN_SECONDS ); |
151 | 151 | } |
152 | 152 | |
153 | + /** |
|
154 | + * @param string $filename |
|
155 | + */ |
|
153 | 156 | private function get_css_content( $filename ) { |
154 | 157 | $css = '/* ' . __( 'WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable' ) . ' */' . "\n"; |
155 | 158 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $new_instance = (array) $new_instance; |
54 | 54 | $this->id = $new_instance['ID']; |
55 | 55 | if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { |
56 | - $all_instances[ $number ] = $new_instance; |
|
56 | + $all_instances[$number] = $new_instance; |
|
57 | 57 | |
58 | 58 | if ( $new_instance['menu_order'] && $_POST && empty( $_POST['prev_menu_order'] ) && isset( $_POST['frm_style_setting']['menu_order'] ) ) { |
59 | 59 | // this style was set to default, so remove default setting on previous default style |
@@ -81,22 +81,22 @@ discard block |
||
81 | 81 | $default_settings = $this->get_defaults(); |
82 | 82 | |
83 | 83 | foreach ( $default_settings as $setting => $default ) { |
84 | - if ( ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
85 | - $new_instance['post_content'][ $setting ] = $default; |
|
84 | + if ( ! isset( $new_instance['post_content'][$setting] ) ) { |
|
85 | + $new_instance['post_content'][$setting] = $default; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | if ( $this->is_color( $setting ) ) { |
89 | - $new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] ); |
|
89 | + $new_instance['post_content'][$setting] = str_replace( '#', '', $new_instance['post_content'][$setting] ); |
|
90 | 90 | } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) |
91 | - && ! isset( $new_instance['post_content'][ $setting ] ) |
|
91 | + && ! isset( $new_instance['post_content'][$setting] ) |
|
92 | 92 | ) { |
93 | - $new_instance['post_content'][ $setting ] = 0; |
|
93 | + $new_instance['post_content'][$setting] = 0; |
|
94 | 94 | } elseif ( $setting == 'font' ) { |
95 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
95 | + $new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] ); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - $all_instances[ $number ] = $new_instance; |
|
99 | + $all_instances[$number] = $new_instance; |
|
100 | 100 | |
101 | 101 | $action_ids[] = $this->save( $new_instance ); |
102 | 102 | |
@@ -268,13 +268,13 @@ discard block |
||
268 | 268 | $style->post_content = $this->override_defaults( $style->post_content ); |
269 | 269 | $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
270 | 270 | |
271 | - $styles[ $style->ID ] = $style; |
|
271 | + $styles[$style->ID] = $style; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | if ( ! $default_style ) { |
275 | 275 | $default_style = reset( $styles ); |
276 | 276 | |
277 | - $styles[ $default_style->ID ]->menu_order = 1; |
|
277 | + $styles[$default_style->ID]->menu_order = 1; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | return $styles; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function validate( $args ) { |
37 | 37 | $errors = array(); |
38 | 38 | if ( $args['value'] != '' && ! is_email( $args['value'] ) ) { |
39 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
39 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return $errors; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | 'sep' => ', ', |
40 | 40 | 'html' => false, |
41 | 41 | ); |
42 | - $atts = wp_parse_args( $atts, $defaults ); |
|
42 | + $atts = wp_parse_args( $atts, $defaults ); |
|
43 | 43 | |
44 | 44 | if ( $atts['html'] ) { |
45 | 45 | $atts['sep'] = ' '; |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | |
62 | 62 | // validate the url format |
63 | 63 | if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) { |
64 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
64 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
65 | 65 | } elseif ( $this->field->required == '1' && empty( $value ) ) { |
66 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
66 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $errors; |