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/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index af17e67..a62fbba 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -267,61 +267,7 @@ class LBRY_Admin */ public function available_channels_callback() { - $channel_list = LBRY()->daemon->channel_list(); - if ( $channel_list ) { ?> - - - - - - - - - - - - - claim_id; - $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 ); - } - $timestamp = $results->items[0]->meta->creation_timestamp; - $created_date = date( 'm-d-y', $timestamp ); - $support_amount = $results->items[0]->meta->support_amount; - $claims_published = $results->items[0]->meta->claims_in_channel; - if ( ( $support_amount < 0.001 ) ) { - ( $support_amount = '0' ); - } elseif ( ( $support_amount < 0.01 ) && ( $support_amount >= 0.001 ) ) { - ( $support_amount = '<0.01' ); - } elseif ( ( $support_amount <= 0.099 ) && ( $support_amount >= 0.01) ) { - ( $support_amount = number_format( floatval( $support_amount ), 2, '.', '' ) ); - } elseif ( ( $support_amount <= 0.999 ) && ( $support_amount >= 0.1 ) ) { - ( $support_amount = number_format( floatval( $support_amount ), 1, '.', '' ) ); - } else { - ( $support_amount = number_format( intval( $support_amount ) ) ); - } - $init_bid = $results->items[0]->amount; ?> - - - - - - - - - - - - - - -
ChannelLBRY URLClaim ID~ Date CreatedPostsSupports
name, 'lbrypress' ); ?>Add
LBRYPress
- -

Looks like you haven't added any channels yet, feel free to do so below:

-

- admin->available_channels_callback(); ?> - admin->available_channels_callback(); ?> + daemon->channel_list(); + if ( $channel_list ) { ?> + + + + + + + + + + + + + claim_id; + $results = LBRY()->daemon->claim_search( $claim_id ); + $lbry_url = $results->items[0]->canonical_url; + if ( $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 ); + $support_amount = $results->items[0]->meta->support_amount; + $claims_published = $results->items[0]->meta->claims_in_channel; + if ( ( $support_amount < 0.001 ) ) { + ( $support_amount = '0' ); + } elseif ( ( $support_amount < 0.01 ) && ( $support_amount >= 0.001 ) ) { + ( $support_amount = '<0.01' ); + } elseif ( ( $support_amount <= 0.099 ) && ( $support_amount >= 0.01) ) { + ( $support_amount = number_format( floatval( $support_amount ), 2, '.', '' ) ); + } elseif ( ( $support_amount <= 0.999 ) && ( $support_amount >= 0.1 ) ) { + ( $support_amount = number_format( floatval( $support_amount ), 1, '.', '' ) ); + } else { + ( $support_amount = number_format( intval( $support_amount ) ) ); + } + $init_bid = $results->items[0]->amount; ?> + + + + + + + + + + + + + + +
ChannelLBRY URLClaim ID~ Date CreatedPostsSupports
name, 'lbrypress' ); ?>Add
LBRYPress
+ +

Looks like you haven't added any channels yet, feel free to do so below:

+
@@ -66,6 +123,6 @@ if ( current_user_can( 'manage_options' ) ) { -

plugin_name ) ?>

+