Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // hercules begin
- $myembed = htmlentities( (string)$feed_item->embed );
- $feed_item->desc = "ID:<h2>{$feed_item->title}</h2><br>\n{$myembed}<br>\n{$feed_item->desc}";
- /* hercules closer */
- $post = array(
- 'post_author' => '1',
- 'post_status' => $_POST['status'],
- 'post_type' => $cpt,
- 'post_title' => (string) $feed_item->title,
- 'post_content' => (string) $feed_item->desc
- );
- $post_id = wp_insert_post( $post );
- update_post_meta($post_id, 'sponsor', (string)$_POST['source']);
- update_post_meta($post_id, 'videoID', (string)$feed_item->id);
- //hercules begin
- $myembeddirty = array('ID:','<','"','&','>'
- );
- $myembedcleaner = array('','<','"','&','>'
- );
- $prev = get_post( $post_id );
- $post->post_content = str_replace($myembeddirty, $myembedcleaner, $post->post_content);
- $prev->post_content = $post->post_content;
- wp_insert_post( $prev );
- $post = array(
- 'post_content' => $post->post_content,
- );
- wp_insert_post($post_id);
- // hercules closed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement