From 2f80a1c72f2a774308204277a043450c6ca45075 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 6 Apr 2014 22:08:15 +0000 Subject: [PATCH] Apply checks in [27964] to wp_write_post(), which is unused and due for dismantling and deprecation. see #27452. Built from https://develop.svn.wordpress.org/trunk@27975 git-svn-id: http://core.svn.wordpress.org/trunk@27805 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 1a9764543c..2a7dfab0b5 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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 ) )