From 9149310a61ad871094203ad62e65c6427b1a58db Mon Sep 17 00:00:00 2001 From: Lem Smyth Date: Mon, 14 Feb 2022 08:39:02 -0600 Subject: [PATCH] license as arg, check lbry_post_pub_channel first --- classes/LBRY_Network_Publisher.php | 7 ++++--- templates/published_on_lbry_banner.php | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/classes/LBRY_Network_Publisher.php b/classes/LBRY_Network_Publisher.php index d4725b3..0007b03 100644 --- a/classes/LBRY_Network_Publisher.php +++ b/classes/LBRY_Network_Publisher.php @@ -14,8 +14,9 @@ class LBRY_Network_Publisher * @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 - public function publish($post, $channel = null) - { + public function publish( $post, $channel = null, $license ) { + + $post_id = $post->ID; // Get converted markdown into a file $filepath = LBRY_ABSPATH . 'tmp/' . $post->post_name . time() . '.md'; $file = fopen( $filepath, 'w' ); @@ -35,7 +36,7 @@ class LBRY_Network_Publisher 'file_path' => $filepath, 'title' => $post->post_title, 'languages' => array( substr( get_locale(), 0, 2 ) ), - 'license' => get_option(LBRY_SETTINGS)[LBRY_LICENSE] + 'license' => $license, ); // Setup channel diff --git a/templates/published_on_lbry_banner.php b/templates/published_on_lbry_banner.php index 1b00399..8873b63 100644 --- a/templates/published_on_lbry_banner.php +++ b/templates/published_on_lbry_banner.php @@ -1,8 +1,10 @@ daemon->canonical_url($channel_id); }