Support tagging feature when publishing #18

Merged
prkirby merged 1 commit from publishing-tag-feature into master 2020-01-28 04:46:55 +01:00
Showing only changes of commit fb8a8f9a08 - Show all commits

View file

@ -9,7 +9,7 @@ class LBRY_Network_Publisher
{ {
/** /**
* Publish the post to the LBRY Network * Publish the post to the LBRY Network
* @param int $post_id The ID of the post we are publishing * @param WP_POST $post_id The ID of the post we are publishing
* @param string $channel The Claim ID of the channel we are posting to * @param string $channel The Claim ID of the channel we are posting to
*/ */
// NOTE: This is currently sitting at about 150ms, mostly the post parsing // NOTE: This is currently sitting at about 150ms, mostly the post parsing
@ -50,6 +50,16 @@ class LBRY_Network_Publisher
$args['thumbnail_url'] = $featured_image[0]; $args['thumbnail_url'] = $featured_image[0];
} }
// Setup Tags
$tags = get_the_terms( $post, 'post_tag' );
if ($tags) {
$tag_names = [];
foreach ($tags as $tag) {
$tag_names[] = $tag->name;
}
$args['tags'] = $tag_names;
}
// Build description using Yoast if installed and its used, excerpt/title otherwise // Build description using Yoast if installed and its used, excerpt/title otherwise
$description = false; $description = false;
if (class_exists('WPSEO_META')) { if (class_exists('WPSEO_META')) {