WordPress.org

Ready to get started?Download WordPress

Forums

wp_insert_post remove the html tag (34 posts)

  1. 123extra
    Member
    Posted 5 years ago #

    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....

  2. 123extra
    Member
    Posted 5 years ago #

    i thing what causing it the kses.php.

    please can some one help me.

    is there any to avoid kses function?

  3. 123extra
    Member
    Posted 5 years ago #

    well, can some one help me. pliis....

  4. 123extra
    Member
    Posted 5 years ago #

    if i loggin to WP and run the script. it work. but if i log-out from WP, its stop working.

    please can some one give me a solution here

  5. 123extra
    Member
    Posted 5 years ago #

    pleaseee, some one help me...

  6. 123extra
    Member
    Posted 5 years ago #

    please some one...

  7. 123extra
    Member
    Posted 5 years ago #

    anyone can help?

  8. faps
    Member
    Posted 5 years ago #

    I encountered the same problem...

  9. 123extra
    Member
    Posted 5 years ago #

    yes please, can someone help us

  10. 123extra
    Member
    Posted 5 years ago #

    does anyone here, really can help us?

  11. 123extra
    Member
    Posted 5 years ago #

    please need help here

  12. 123extra
    Member
    Posted 5 years ago #

    please somebody, here.... i really need the solution for this

  13. faps
    Member
    Posted 5 years ago #

    This problem has troubled me for two weeks, and still is not resolved
    I tried to use custom meta, but it is not a good idea
    Please help us

  14. 123extra
    Member
    Posted 5 years ago #

    please, someone.... need help here...

  15. derianth
    Member
    Posted 5 years ago #

    Well, i have the same problem. Can anybody help us?

  16. derianth
    Member
    Posted 5 years ago #

    'post_content_filtered' => ''
    maybe this can discover a right way to resolve our problem?

  17. 123extra
    Member
    Posted 5 years ago #

    '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?

  18. 123extra
    Member
    Posted 5 years ago #

    any one can offer other solution?

  19. 123extra
    Member
    Posted 5 years ago #

    please some body help us

  20. 123extra
    Member
    Posted 5 years ago #

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

    please someone help us

  21. 123extra
    Member
    Posted 5 years ago #

    please, somebody... needed badly :(

  22. wtfmejt
    Member
    Posted 5 years ago #

    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);

  23. 123extra
    Member
    Posted 5 years ago #

    still no luck. any other solution. please....

  24. 123extra
    Member
    Posted 5 years ago #

    please some body, help me

  25. 123extra
    Member
    Posted 5 years ago #

    please help us...

  26. 123extra
    Member
    Posted 5 years ago #

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

  27. 123extra
    Member
    Posted 5 years ago #

    well, can some one help me. pliis....

  28. 123extra
    Member
    Posted 5 years ago #

    does anyone here, really can help us?

  29. 123extra
    Member
    Posted 5 years ago #

    please some one...

  30. faps
    Member
    Posted 5 years ago #

    I'm sorrow. I gave up..

Topic Closed

This topic has been closed to new replies.

About this Topic