diff --git a/fediembedi-mastodon-widget.php b/fediembedi-mastodon-widget.php index 92ca0d0..151ad38 100644 --- a/fediembedi-mastodon-widget.php +++ b/fediembedi-mastodon-widget.php @@ -17,13 +17,13 @@ class FediEmbedi_Mastodon extends WP_Widget { } /** - * Outputs the content for the current Search widget instance. + * Outputs the content for the current Mastodon widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. - * @param array $instance Settings for the current Search widget instance. + * @param array $instance Settings for the current Mastodon widget instance. */ public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; @@ -40,7 +40,7 @@ class FediEmbedi_Mastodon extends WP_Widget { $pinned = (!empty($instance['pinned'])) ? $instance['pinned'] : ''; $exclude_replies = (!empty($instance['exclude_replies'])) ? $instance['exclude_replies'] : ''; $exclude_reblogs = (!empty($instance['exclude_reblogs'])) ? $instance['exclude_reblogs'] : ''; - $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; + $limit = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; $height = isset( $instance['height'] ) ? esc_attr( $instance['height'] ) : '100%'; echo $args['before_widget']; @@ -49,7 +49,7 @@ class FediEmbedi_Mastodon extends WP_Widget { }; //getStatus from remote instance - $status = $client->getStatus($only_media, $pinned, $exclude_replies, null, null, null, $number, $exclude_reblogs); + $status = $client->getStatus($only_media, $pinned, $exclude_replies, null, null, null, $limit, $exclude_reblogs); //if(WP_DEBUG_DISPLAY === true): echo '
Mastodon
'; var_dump($status); echo '
'; endif; $account = $status[0]->account; include(plugin_dir_path(__FILE__) . 'templates/mastodon.tpl.php' ); @@ -58,7 +58,7 @@ class FediEmbedi_Mastodon extends WP_Widget { } /** - * Outputs the settings form for the Search widget. + * Outputs the settings form for the Mastodon widget. * * @since 2.8.0 * @@ -72,7 +72,7 @@ class FediEmbedi_Mastodon extends WP_Widget { $pinned = (!empty($instance['pinned'])) ? $instance['pinned'] : NULL; $exclude_replies = (!empty($instance['exclude_replies'])) ? $instance['exclude_replies'] : NULL; $exclude_reblogs = (!empty($instance['exclude_reblogs'])) ? $instance['exclude_reblogs'] : NULL; - $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; + $limit = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; $height = isset( $instance['height'] ) ? esc_attr( $instance['height'] ) : ''; ?> @@ -138,7 +138,7 @@ class FediEmbedi_Mastodon extends WP_Widget {

@@ -152,7 +152,7 @@ class FediEmbedi_Mastodon extends WP_Widget { } /** - * Handles updating settings for the current Search widget instance. + * Handles updating settings for the current Mastodon widget instance. * * @since 2.8.0 * @@ -174,5 +174,4 @@ class FediEmbedi_Mastodon extends WP_Widget { $instance['height'] = sanitize_text_field( $new_instance['height'] ); return $instance; } - } diff --git a/fediembedi-peertube-widget.php b/fediembedi-peertube-widget.php index 2ee3dac..08e20a7 100644 --- a/fediembedi-peertube-widget.php +++ b/fediembedi-peertube-widget.php @@ -17,13 +17,13 @@ class FediEmbedi_PeerTube extends WP_Widget { } /** - * Outputs the content for the current Search widget instance. + * Outputs the content for the current PeerTube widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. - * @param array $instance Settings for the current Search widget instance. + * @param array $instance Settings for the current PeerTube widget instance. */ public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; @@ -48,7 +48,7 @@ class FediEmbedi_PeerTube extends WP_Widget { //getVideos from remote instance $status = $client->getVideos($actor, $is_channel, $count, $nsfw); - if(WP_DEBUG_DISPLAY === true): echo '
PeerTube
'; var_dump($status); echo '
'; endif; + //if(WP_DEBUG_DISPLAY === true): echo '
PeerTube
'; var_dump($status); echo '
'; endif; if(!is_null($is_channel)){ $account = $status->data[0]->channel; } else { @@ -61,7 +61,7 @@ class FediEmbedi_PeerTube extends WP_Widget { } /** - * Outputs the settings form for the Search widget. + * Outputs the settings form for the PeerTube widget. * * @since 2.8.0 * @@ -149,7 +149,7 @@ class FediEmbedi_PeerTube extends WP_Widget { } /** - * Handles updating settings for the current Search widget instance. + * Handles updating settings for the current PeerTube widget instance. * * @since 2.8.0 * @@ -175,5 +175,4 @@ class FediEmbedi_PeerTube extends WP_Widget { $instance['height'] = sanitize_text_field( $new_instance['height'] ); return $instance; } - } diff --git a/fediembedi-pixelfed-widget.php b/fediembedi-pixelfed-widget.php index be88df9..6243f22 100644 --- a/fediembedi-pixelfed-widget.php +++ b/fediembedi-pixelfed-widget.php @@ -17,13 +17,13 @@ class FediEmbedi_Pixelfed extends WP_Widget { } /** - * Outputs the content for the current Search widget instance. + * Outputs the content for the current Pixelfed widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. - * @param array $instance Settings for the current Search widget instance. + * @param array $instance Settings for the current Pixelfed widget instance. */ public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; @@ -61,7 +61,7 @@ class FediEmbedi_Pixelfed extends WP_Widget { } /** - * Outputs the settings form for the Search widget. + * Outputs the settings form for the Pixelfed widget. * * @since 2.8.0 * @@ -155,7 +155,7 @@ class FediEmbedi_Pixelfed extends WP_Widget { } /** - * Handles updating settings for the current Search widget instance. + * Handles updating settings for the current Pixelfed widget instance. * * @since 2.8.0 * @@ -177,5 +177,4 @@ class FediEmbedi_Pixelfed extends WP_Widget { $instance['height'] = sanitize_text_field( $new_instance['height'] ); return $instance; } - } diff --git a/fediembedi-widget.php b/fediembedi-widget.php index 50f5fc1..e979eaa 100644 --- a/fediembedi-widget.php +++ b/fediembedi-widget.php @@ -68,7 +68,7 @@ class WP_Widget_fediembedi extends WP_Widget { case 'PeerTube': //getVideos from remote instance $status = $client->getVideos(); - if(WP_DEBUG_DISPLAY === true): echo '
'. $instance_type .'
'; var_dump($status); echo '
'; endif; + //if(WP_DEBUG_DISPLAY === true): echo '
'. $instance_type .'
'; var_dump($status); echo '
'; endif; include(plugin_dir_path(__FILE__) . 'templates/peertube.tpl.php' ); break; default: diff --git a/fediembedi.php b/fediembedi.php index ed02d4e..2cde8a0 100644 --- a/fediembedi.php +++ b/fediembedi.php @@ -4,7 +4,7 @@ * Plugin URI: https://git.feneas.org/mediaformat/fediembedi * GitLab Plugin URI: https://git.feneas.org/mediaformat/fediembedi * Description: Widgets and shortcodes to show your Fediverse profile timeline - * Version: 0.11.0 + * Version: 0.11.1 * Author: mediaformat * Author URI: https://mediaformat.org * License: GPLv3 @@ -170,6 +170,7 @@ class FediConfig 'limit' => 5, 'exclude_reblogs' => false, 'show_header' => true, + 'height' => '100%', ), $atts, 'mastodon' ); //getStatus from remote instance @@ -199,11 +200,12 @@ class FediConfig 'limit' => 9, 'exclude_reblogs' => false, 'show_header' => true, + 'height' => '100%', ), $atts, 'pixelfed' ); //getStatus from remote instance $status = $client->getStatus($atts['only_media'], $atts['pinned'], $atts['exclude_replies'], null, null, null, $atts['limit'], $atts['exclude_reblogs']); - //if(WP_DEBUG_DISPLAY === true): echo '
Mastodon
'; var_dump($client->getStatus($atts)); echo '
'; endif; + //if(WP_DEBUG_DISPLAY === true): echo '
Pixelfed
'; var_dump($client->getStatus($atts)); echo '
'; endif; $show_header = $atts['show_header']; if($account = $status[0]->account){ ob_start(); @@ -221,9 +223,14 @@ class FediConfig 'actor' => null, 'is_channel' => null, 'limit' => 9, + 'nsfw' => null, 'show_header' => true, + 'height' => '100%', ), $atts, 'peertube' ); + + $atts['instance'] = \esc_attr( $atts['instance'], 'https' ); + $client = new \FediClient($atts['instance']); //getVideos from remote instance @@ -234,11 +241,13 @@ class FediConfig $account = $status->data[0]->account; } - //if(WP_DEBUG_DISPLAY === true): echo '
PeerTube
'; var_dump($status); echo '
'; endif; + if(WP_DEBUG_DISPLAY === true): echo '
PeerTube
'; var_dump($status); echo '
'; endif; $show_header = $atts['show_header']; + $height = $atts['height']; ob_start(); include(plugin_dir_path(__FILE__) . 'templates/peertube.tpl.php' ); return ob_get_clean(); + echo 'yoohoo'; } /* diff --git a/readme.md b/readme.md index 1b8779f..5c8ccf4 100644 --- a/readme.md +++ b/readme.md @@ -53,6 +53,10 @@ and redirected to your site with a secure token. Similar to how you would connec ## Changelog +### 0.11.1 +* Bug fix: Shortcode limit attribute. +* Document: Shortcodes on options page. + ### 0.11.0 * Feature: PeerTube widget NSFW option. * Fix: PeerTube number of posts to display. diff --git a/readme.txt b/readme.txt index ae07c43..bb9a978 100644 --- a/readme.txt +++ b/readme.txt @@ -64,6 +64,10 @@ and redirected to your site with a secure token. Similar to how you would connec == Changelog == += 0.11.1 = +* Bug fix: Shortcode limit attribute. +* Document: Shortcodes on options page. + = 0.11.0 = * Feature: PeerTube widget NSFW option. * Fix: PeerTube number of posts to display. diff --git a/templates/mastodon.tpl.php b/templates/mastodon.tpl.php index 5d1410d..0f71af7 100644 --- a/templates/mastodon.tpl.php +++ b/templates/mastodon.tpl.php @@ -1,5 +1,5 @@ -
> +
>
- -
> +
>
diff --git a/templates/pixelfed.tpl.php b/templates/pixelfed.tpl.php index b05edf0..94dcb77 100644 --- a/templates/pixelfed.tpl.php +++ b/templates/pixelfed.tpl.php @@ -1,5 +1,5 @@ -
> +
>