Apply checks in [27964] to wp_write_post(), which is unused and due for dismantling and deprecation.

see #27452.


git-svn-id: https://develop.svn.wordpress.org/trunk@27975 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-04-06 22:07:02 +00:00
parent 5d3e7be690
commit 3fbe1ba7b7
1 changed files with 4 additions and 4 deletions

View File

@ -657,10 +657,6 @@ function wp_write_post() {
if ( isset( $_POST['post_ID'] ) )
return edit_post();
$translated = _wp_translate_postdata( false );
if ( is_wp_error($translated) )
return $translated;
if ( isset($_POST['visibility']) ) {
switch ( $_POST['visibility'] ) {
case 'public' :
@ -677,6 +673,10 @@ function wp_write_post() {
}
}
$translated = _wp_translate_postdata( false );
if ( is_wp_error($translated) )
return $translated;
// Create the post.
$post_ID = wp_insert_post( $_POST );
if ( is_wp_error( $post_ID ) )