• So I’m taking info from a database and trying to autopost it using wp_insert_post($info) and I find that it’s stripping out HTML (specifically, youtube embedded videos HTML).

    The data is passed using this block of code hwere

    $info = array(
    	'_wpnonce' => 'b7f471455d',
        '_wp_http_referer' => '',
        'user_ID' => $user_ID,
        'action' => 'post',
        'originalaction' => 'post',
        'post_author' => $user_ID,
        'post_type' => 'post',
        'temp_ID' => '-1185132394',
        'newcat' => '',
        'post_category' => $categories,
        'advanced_view' => '1',
        'comment_status' => 'open',
        'ping_status' => 'open',
        'post_password' => '',
        'post_name' => '',
        'post_status' => 'publish',
    	'edit_date' => '1',
        'mm' => $month,
        'jj' => $day,
        'aa' => $year,
        'hh' => $hour,
        'mn' => $minute,
        'ss' => $second,
        'post_title' => $title,
        'content' => $content,
        'post_pingback' => '0',
        'prev_status' => 'draft',
        'publish' => 'Publish',
        'referredby' => 'redo',
        'excerpt' => '',
        'trackback_url' => '',
        'metakeyinput' => '',
        'metavalue' => '',
        'post_content' => $content,
        'post_excerpt' => '',
        'post_parent' => '',
        'to_ping' => '',
    	'post_date' => $post_date,
    	'post_date_gmt' => $post_date_gmt,
    	'no_filter' => ''
    	);

    and using print_r($info) reveals that it’s being passed through fine.

    Is there any way for it to prevent the filtering of the youtube html?

    For reference, the string in $content looks a little like this:

    <object width="425" height="350">
    <param name="movie" value="http://www.youtube.com/v/JHUuqsSCn5g"></param>
    <param name="wmode" value="transparent"></param>
    <embed src="http://www.youtube.com/v/JHUuqsSCn5g" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
    </object>

    ANy help would be appreciated.

    Thanks!

  • The topic ‘Problems with wp_insert_post($info) stripping out HTML’ is closed to new replies.