Opened 13 years ago
Closed 11 years ago
#26734 closed defect (bug) (worksforme)
wp_insert_post is stripping target="_blank" in version 3.8te
| Reported by: | wpmate | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Formatting | Version: | 3.8 |
| Severity: | normal | Keywords: | reporter-feedback |
| Cc: | Focuses: |
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
@
13 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;
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I'm unable to replicate this. In what context are you calling
wp_insert_post()?