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
This commit is contained in:
parent
7689cc4a74
commit
2f80a1c72f
|
@ -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 ) )
|
||||
|
|
Loading…
Reference in New Issue