Support tagging feature when publishing #18
1 changed files with 11 additions and 1 deletions
|
@ -9,7 +9,7 @@ class LBRY_Network_Publisher
|
|||
{
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
// 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];
|
||||
}
|
||||
|
||||
// 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
|
||||
$description = false;
|
||||
if (class_exists('WPSEO_META')) {
|
||||
|
|
Loading…
Reference in a new issue