diff --git a/classes/LBRYPress.php b/classes/LBRYPress.php index 3924077..be2804f 100644 --- a/classes/LBRYPress.php +++ b/classes/LBRYPress.php @@ -164,6 +164,7 @@ class LBRYPress { register_activation_hook( LBRY_PLUGIN_FILE, array( $this, 'activate' ) ); register_deactivation_hook( LBRY_PLUGIN_FILE, array( $this, 'deactivate' ) ); + add_filter( 'kses_allowed_protocols' , array( $this, 'lbry_add_additional_protocols' ) ); // Banner output for published posts // NOTE: move this to its own class to reduce clutter? @@ -227,6 +228,19 @@ class LBRYPress error_log( 'Deactivated LBRYPress' ); } + /** + * Allowing additional URL protocols to list of allowed protocols. + * + * @param array $protocols List of protocols allowed by (default WordPress.) + * + * @return array $protocols Updated list including additional protocols. + */ + public function lbry_add_additional_protocols( $protocols ) + { + $protocols[] = 'lbry'; + return $protocols; + } + public function published_on_lbry_banner($content) { if ( ! is_single() || ! in_the_loop() || ! is_main_query() ) { diff --git a/templates/channels-page.php b/templates/channels-page.php index 6c56b48..1bdf11c 100644 --- a/templates/channels-page.php +++ b/templates/channels-page.php @@ -49,7 +49,7 @@ if ( current_user_can( 'manage_options' ) ) { $results = LBRY()->daemon->claim_search( $claim_id ); $lbry_url = $results->items[0]->canonical_url; if ( $lbry_url ) { - $open_url = str_replace( 'lbry://', 'open.lbry.com/', $lbry_url ); + $open_url = str_replace( 'lbry://', 'https://open.lbry.com/', $lbry_url ); } $timestamp = $results->items[0]->meta->creation_timestamp; $created_date = date( 'm-d-y', $timestamp ); @@ -69,12 +69,12 @@ if ( current_user_can( 'manage_options' ) ) { $init_bid = $results->items[0]->amount; ?> name, 'lbrypress' ); ?> - + - Add + Add