Quantcast
Viewing all articles
Browse latest Browse all 130709

Add meta tag

Replies: 0

Hello,

Big thank you for your plugin it save me. I would like to import the tags of the videos, Is it possible ?

I found a code who use this :


 global $wp_query, $totalPosted, $limit;
		$item = current($data['items'])['snippet'];
		if($totalPosted < $this->limit)
		{
			$post = array(
			  'post_content'   => '<iframe class="yt-iframe" width="560" height="315" src="https://www.youtube.com/embed/'.current($data['items'])['id'].'" frameborder="0" allowfullscreen></iframe>',
			  'post_title'     => $item['title'],
			  'post_status'    => 'publish',
			  'post_type'      => 'post',
        'post_format'    => 'video',
			  'post_author'    => get_current_user_id(),
			  'post_category'  => array($this->category),
	 ---------------> 'tags_input'     => @implode(",", $item['tags']),
			);


-----------------------> query_posts('meta_key=yap_id&meta_value=' . current($data['items'])['id']);
			if(!$wp_query->found_posts)
			{
				wp_reset_query();
				$id = wp_insert_post($post, $wp_error);
				//$this->Generate_Featured_Image($id, $item);

				add_post_meta($id, 'yap_id', current($data['items'])['id'], true);
				echo "Posted => ".$item['title']."<br />";
				$totalPosted++;</blockquote>

			}
		} 

Thank you

  • This topic was modified 3 minutes ago by aidon00.

Viewing all articles
Browse latest Browse all 130709

Trending Articles