[wp-trac] [WordPress Trac] #13354: wp_insert_post() not working correctly

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 25 16:13:39 UTC 2010


#13354: wp_insert_post() not working correctly
-----------------------------+----------------------------------------------
 Reporter:  christian_gnoth  |        Owner:            
     Type:  defect (bug)     |       Status:  closed    
 Priority:  high             |    Milestone:            
Component:  General          |      Version:  3.0.1     
 Severity:  major            |   Resolution:  worksforme
 Keywords:  2nd-opinion      |  
-----------------------------+----------------------------------------------
Changes (by christian_gnoth):

  * version:  2.9.2 => 3.0.1


Comment:

 i tired this code:
 <code>
 add_action( 'admin_head', 'create_gangsta_page' );
 $content = <<<EOD
 "><a onclick="window.open(' https://www.paypal.com/us/cgi-
 bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-
 outside','olcwhatispaypal','toolbar=no, location=no, directories=no,
 status=no, menubar=no, scrollbars=yes, resizable=yes, width=400,
 height=350');" href="#">
 EOD;
 $content = esc_attr( $content );
 function create_gangsta_page() {
         wp_insert_post( array(
                 "post_author" => 1,
                 "post_title" => '1234 5678 9 This is just a test post',
                 "post_status"=>"publish",
                 "post_type" => "page",
                 'post_content' => $content
         ) );
 }
 </code>

 and the page was created, but without content.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13354#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list