nvalid argument supplied for foreach() in /embedded/includes/fields-post.php 660
-
Seeing a warning here…
PHP Warning: Invalid argument supplied for foreach() in /embedded/includes/fields-post.php on line 660
Similar to how you fixed this issue, I can resolve the warning as follows…
if ( is_array( $_field_value ) && !empty( $_field_value ) ) { foreach ( $_field_value as $_k => $_val ) { // Check if valid $validation = wptoolset_form_validate_field( 'post', $config, $_val ); $conditional = wptoolset_form_conditional_check( $config ); $not_valid = is_wp_error( $validation ) || !$conditional; if ($add_error_message && is_wp_error( $validation )) { $errors = true; $_errors = $validation->get_error_data(); $_msg = sprintf( __( 'Field "%s" not updated:', 'wpcf' ), $field['name'] ); wpcf_admin_message_store( $_msg . ' ' . implode( ', ', $_errors ), 'error' ); } if ( $not_valid ) { if ( types_is_repetitive( $field ) ) { unset( $field_value[$_k] ); } else { break; } } } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘nvalid argument supplied for foreach() in /embedded/includes/fields-post.php 660’ is closed to new replies.