• $my_post = array(
    	'ID'  => $postID,
    	 'post_title'    => $post_title, // doesnt work, inserts empty value
    	'post_content'  => "works"
    );
    
    wp_update_post( $my_post, true );

    What am I doing wrong? And yes, there’s something in $post_title.

Viewing 1 replies (of 1 total)
  • Thread Starter Seodev

    (@seodev)

    Solved…. UTF8 problem! Had to utf8_encode it.

    Seems like a WordPress bug to me. Inserting any other then utf8 should not insert and empty value.

Viewing 1 replies (of 1 total)

The topic ‘wp_update_post inserts empty title and content’ is closed to new replies.