'Submit Feedback', ]; // Override defaults with user-provided attributes $atts = shortcode_atts($defaults, $atts, 'abcbizrev_feedback_form'); // Form HTML ?>

sanitize_text_field($_POST['abcbizrev_subject']), 'post_content' => sanitize_textarea_field($_POST['abcbizrev_comments']), 'post_status' => $post_status, 'post_type' => 'abcbizrev_reviews', 'meta_input' => [ 'abcbizrev_review_name' => sanitize_text_field($_POST['abcbizrev_name']), 'abcbizrev_review_email' => sanitize_email($_POST['abcbizrev_email']), 'abcbizrev_review_rating' => intval($_POST['abcbizrev_rating']), ], ]; // Insert the post $post_id = wp_insert_post($post_data); if ($post_id) { $redirect_url = get_option('abcbizrev_redirect_url'); // If a redirect URL is set and is a valid URL, redirect to it. Otherwise, redirect to the home page. if (!empty($redirect_url) && filter_var($redirect_url, FILTER_VALIDATE_URL)) { wp_redirect($redirect_url); } else { wp_redirect(home_url('/')); } exit; } else { wp_die('An error occurred while submitting your feedback.'); } } }