Only publish on published posts, not drafts

This commit is contained in:
Paul Kirby 2018-11-14 15:01:44 -06:00
parent 51309c6876
commit b07c9d23e3
2 changed files with 2 additions and 1 deletions

View file

@ -149,6 +149,7 @@ class LBRY_Daemon
'publish',
$args
);
$this->logger->log('publish success!', 'Successfully published post with result: ' . print_r($result->result, true));
return $result->result;
} catch (LBRYDaemonException $e) {
$this->logger->log('publish error', $e->getMessage() . ' | Code: ' . $e->getCode());

View file

@ -93,7 +93,7 @@ class LBRY_Network
update_post_meta($post_id, LBRY_POST_CHANNEL, $new_channel);
}
if ($will_publish) {
if ($will_publish && $post->post_status == 'publish') {
// Publish the post on the LBRY Network
$this->publisher->publish($post, get_post_meta($post_id, LBRY_POST_CHANNEL, true));
}