You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forms: Start using the new feedvack version v3 (#45047)
* Forms: Finally store the feedback in the new format
Replaces manual construction and insertion of feedback posts with a call to the response object's save() method, simplifying the code and improving maintainability. Also updates a test to use unescaped apostrophes in the subject assertion.
* changelog
'post_content' => addslashes( wp_kses( "$comment_content\n<!--more-->\nAUTHOR: {$comment_author}\nAUTHOR EMAIL: {$comment_author_email}\nAUTHOR URL: {$comment_author_url}\nSUBJECT: {$subject}\n{$comment_ip_text}JSON_DATA\n" . @wp_json_encode( $all_values, true ), array() ) ), // so that search will pick up this data
1873
-
'post_name' => $feedback_id,
1874
-
)
1875
-
);
1855
+
$post_id = 0;
1856
+
$feedback_post = $response->save();
1857
+
if ( $feedback_postinstanceof WP_Post ) {
1858
+
$post_id = $feedback_post->ID;
1859
+
}
1876
1860
1877
1861
// once insert has finished we don't need this filter any more
0 commit comments