Opened 11 years ago
Closed 9 years ago
#26734 closed defect (bug) (worksforme)
wp_insert_post is stripping target="_blank" in version 3.8te
Reported by: | wpmate | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8 |
Component: | Formatting | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
When using the wp_insert_post function in php code it strips out the 'target="_blank"' tag from the $post_data[\'post_content\']. This is occurring in version 3.8
When manually creating a post the tags are not stripped.
Change History (4)
#2
@
11 years ago
It occurs programmatically ie in a php script. If you compose a post containing target="_blank" and use a script something like below to create the post, the target="_blank" 'disappears'
$post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status', 'tags_input','post_parent','post_type','post_mime_type','guid','tax_input');
$post_data = add_magic_quotes($post_data);
$post_ID = wp_insert_post($post_data);
return $post_ID;
I'm unable to replicate this. In what context are you calling
wp_insert_post()
?