• hi i want to put something like this in the “post_content” using wp_insert post,

    $postcontent = '<div id="xxxx">some text here</div><!--more--><div id="xxxx">some text here</div>';
    
    //using wp_insert_post
    ...
    $my_post['post_content'] = $postcontent;
    ...

    but it truns out wp_inser_post, strip all the html tags

    any solution for this? please….

Viewing 15 replies - 16 through 30 (of 33 total)
  • Thread Starter 123extra

    (@123extra)

    ‘post_content_filtered’ => ”
    maybe this can discover a right way to resolve our problem?

    i have try it but still no luck

    can you please be more specific?

    Thread Starter 123extra

    (@123extra)

    any one can offer other solution?

    Thread Starter 123extra

    (@123extra)

    please some body help us

    Thread Starter 123extra

    (@123extra)

    i have try
    $wpdb->escape and also post_content_filtered, but still not working

    please someone help us

    Thread Starter 123extra

    (@123extra)

    please, somebody… needed badly πŸ™

    You need to escape the “‘s if you do it like this \” it works just fine. I just used it.

    this is what I ended up with in my xhtml in my wordpress post

    <div id=”xxxx”>some text here</div>
    <!–more–>
    <div id=”xxxx”>some text here</div>

    do it like this.

    // Create post object
    $my_post = array();
    $my_post[‘post_title’] = ‘My post’;
    $my_post[‘post_content’] = ‘<div id=\”xxxx\”>some text here</div><!–more–><div id=\”xxxx\”>some text here</div>’; //This is my post.’;
    $my_post[‘post_status’] = ‘publish’;
    $my_post[‘post_author’] = 1;
    $my_post[‘post_category’] = array(0);

    // Insert the post into the database
    $idid=wp_insert_post( $my_post );
    echo $idid;
    echo get_permalink($idid);

    Thread Starter 123extra

    (@123extra)

    still no luck. any other solution. please….

    Thread Starter 123extra

    (@123extra)

    please some body, help me

    Thread Starter 123extra

    (@123extra)

    please help us…

    Thread Starter 123extra

    (@123extra)

    please someone here whoe kind enough to help us!!!

    Thread Starter 123extra

    (@123extra)

    well, can some one help me. pliis….

    Thread Starter 123extra

    (@123extra)

    does anyone here, really can help us?

    Thread Starter 123extra

    (@123extra)

    please some one…

    I’m sorrow. I gave up..

    Thread Starter 123extra

    (@123extra)

    please anyone can help me

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘wp_insert_post remove the html tag’ is closed to new replies.