Version Description
(20170424) =
* Fix: added all 3 parameters to widget_title
filter (reported by @squarestar)
* (20170301) Add: New shortcode options nolightbox
and target
, to make available opening thumbnail anchors in new tab/window
Download this release
Release Info
Developer | urkekg |
Plugin | YouTube Channel |
Version | 3.0.11 |
Comparing to | |
See all releases |
Code changes from version 3.0.10.5 to 3.0.11
- assets/js/admin.js +0 -27
- assets/js/admin.min.js +0 -1
- feature-request.txt +1 -0
- inc/tinymce/plugin.js +19 -0
- inc/tinymce/plugin.min.js +1 -1
- inc/widget.php +1 -1
- readme.txt +11 -5
- youtube-channel.php +17 -5
assets/js/admin.js
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
-
|
3 |
-
$('input[id*="-showgoto"]').each(function(e, i){
|
4 |
-
ytc_toggle_widget_option_checkbox($(this).attr('id'));
|
5 |
-
});
|
6 |
-
$('input[id*="-showgoto"]').on('change', function(e, i){
|
7 |
-
ytc_toggle_widget_option_checkbox($(this).attr('id'));
|
8 |
-
});
|
9 |
-
|
10 |
-
$(document).ajaxSuccess(function(e, xhr, settings){
|
11 |
-
$('input[id*="-showgoto"]').each(function(e, i){
|
12 |
-
ytc_toggle_widget_option_checkbox($(this).attr('id'));
|
13 |
-
});
|
14 |
-
$('input[id*="-showgoto"]').on('change', function(e, i){
|
15 |
-
ytc_toggle_widget_option_checkbox($(this).attr('id'));
|
16 |
-
});
|
17 |
-
});
|
18 |
-
|
19 |
-
function ytc_toggle_widget_option_checkbox(id) {
|
20 |
-
if ( $('#' + id).attr('checked') === 'checked' ) {
|
21 |
-
$('p.' + id).addClass('visible').removeClass('hidden');
|
22 |
-
} else {
|
23 |
-
$('p.' + id).addClass('hidden').removeClass('visible');
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(t){function i(i){"checked"===t("#"+i).attr("checked")?t("p."+i).addClass("visible").removeClass("hidden"):t("p."+i).addClass("hidden").removeClass("visible")}t('input[id*="-showgoto"]').each(function(){i(t(this).attr("id"))}),t('input[id*="-showgoto"]').on("change",function(){i(t(this).attr("id"))}),t(document).ajaxSuccess(function(){t('input[id*="-showgoto"]').each(function(){i(t(this).attr("id"))}),t('input[id*="-showgoto"]').on("change",function(){i(t(this).attr("id"))})})});
|
|
feature-request.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
Option to select how videos are sorted (by views) https://wordpress.org/support/topic/sort-by-views-1?replies=2
|
2 |
Display number of views below video https://wordpress.org/support/topic/show-views?replies=1
|
|
1 |
Option to select how videos are sorted (by views) https://wordpress.org/support/topic/sort-by-views-1?replies=2
|
2 |
Display number of views below video https://wordpress.org/support/topic/show-views?replies=1
|
3 |
+
Like on desktop I show 10 videos and on mobile I decide to show only 5 because to save space on the screen. by @fantasmo https://wordpress.org/support/topic/pagination-in-dynamic-wall/#post-8897785
|
inc/tinymce/plugin.js
CHANGED
@@ -199,6 +199,23 @@
|
|
199 |
tooltip: 'Set number of columns for gallery display mode (min 1, max 8)'
|
200 |
},
|
201 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
{
|
203 |
type: 'checkbox',
|
204 |
name: 'no_thumb_title',
|
@@ -346,6 +363,8 @@
|
|
346 |
if ( e.data.mute ) shortcode += ' mute=1';
|
347 |
if ( e.data.norel ) shortcode += ' norel=1';
|
348 |
if ( e.data.nobrand ) shortcode += ' nobrand=1';
|
|
|
|
|
349 |
|
350 |
// Content Layout
|
351 |
if ( e.data.showtitle ) shortcode += ' showtitle=' + e.data.showtitle + '';
|
199 |
tooltip: 'Set number of columns for gallery display mode (min 1, max 8)'
|
200 |
},
|
201 |
*/
|
202 |
+
{
|
203 |
+
type: 'checkbox',
|
204 |
+
name: 'nolightbox',
|
205 |
+
label: 'Disable YTC lightbox',
|
206 |
+
tooltip: 'This will work only for Thumbnail',
|
207 |
+
checked: false
|
208 |
+
},
|
209 |
+
{
|
210 |
+
type: 'listbox',
|
211 |
+
name: 'target',
|
212 |
+
label: 'Open thumbnail anchor',
|
213 |
+
tooltip: 'If you select Thumbnail and enable Disable lightbox, you can open thumbnail anchor in new window/tab',
|
214 |
+
values : [
|
215 |
+
{text: 'Default', value: ''},
|
216 |
+
{text: 'New window/tab', value: '_blank'},
|
217 |
+
]
|
218 |
+
},
|
219 |
{
|
220 |
type: 'checkbox',
|
221 |
name: 'no_thumb_title',
|
363 |
if ( e.data.mute ) shortcode += ' mute=1';
|
364 |
if ( e.data.norel ) shortcode += ' norel=1';
|
365 |
if ( e.data.nobrand ) shortcode += ' nobrand=1';
|
366 |
+
if ( e.data.nolightbox ) shortcode += ' nolightbox=1';
|
367 |
+
if ( e.data.target ) shortcode += ' target=' + e.data.target + '';
|
368 |
|
369 |
// Content Layout
|
370 |
if ( e.data.showtitle ) shortcode += ' showtitle=' + e.data.showtitle + '';
|
inc/tinymce/plugin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){tinymce.PluginManager.add("youtube_channel",function(e){e.addButton("youtube_channel_shortcode",{tooltip:"YouTube Channel",icon:"ytc",onclick:function(){e.windowManager.open({title:"YouTube Channel",bodyType:"tabpanel",buttons:[{text:"Insert Shortcode",onclick:"submit",classes:"widget btn primary",minWidth:130},{text:"Cancel",onclick:"close"}],body:[{title:"General Settings",type:"form",items:[{type:"textbox",name:"class",label:"Custom CSS Class",value:"",tooltip:"Enter custom class for YTC block, if you wish to target block styling"},{type:"textbox",name:"vanity",label:"Vanity/Custom ID",value:""},{type:"textbox",name:"channel",label:"YouTube Channel ID",value:""},{type:"textbox",name:"legacy",label:"Legacy Username",value:""},{type:"textbox",name:"playlist",label:"Playlist ID",value:""},{type:"listbox",name:"resource",label:"Resource to use",tooltip:"",values:[{text:"Channel (User Uploads)",value:"0",selected:!0},{text:"Favourited videos",value:"1"},{text:"Liked videos",value:"3"},{text:"Playlist",value:"2"}]},{type:"listbox",name:"cache",label:"Cache feed",tooltip:"",values:[{text:"Do not cache",value:"0"},{text:"1 minute",value:"60"},{text:"5 minutes",value:"300",selected:!0},{text:"15 minutes",value:"900"},{text:"30 minutes",value:"1800"},{text:"1 hour",value:"3600"},{text:"2 hours",value:"7200"},{text:"5 hours",value:"18000"},{text:"10 hours",value:"36000"},{text:"12 hours",value:"43200"},{text:"18 hours",value:"64800"},{text:"1 day",value:"86400"},{text:"2 days",value:"172800"},{text:"3 days",value:"259200"},{text:"4 days",value:"345600"},{text:"5 days",value:"432000"},{text:"6 days",value:"518400"},{text:"1 week",value:"604800"},{text:"2 weeks",value:"1209600"},{text:"3 weeks",value:"1814400"},{text:"1 month",value:"2419200"}]},{type:"textbox",name:"fetch",label:"Fetch",value:"10",tooltip:"Number of videos that will be used for random pick (min 2, max 50, default 25)"},{type:"textbox",name:"num",label:"Show",value:"1",tooltip:"Number of videos to display"},{type:"checkbox",name:"privacy",label:"Use Enhanced Privacy",tooltip:"Enable this option to protect your visitors privacy",checked:!1},{type:"checkbox",name:"random",label:"Random video",tooltip:'Show random video from resource (Have no effect if "Embed as" has been set to "Embedded Playlist")',checked:!1}]},{title:"Video Settings",type:"form",items:[{type:"listbox",name:"ratio",label:"Aspect Ratio",values:[{text:"Widescreen (16:9)",value:"3",selected:!0},{text:"Standard TV (4:3)",value:"1"}]},{type:"checkbox",name:"responsive",label:"Responsive video",tooltip:"Make video responsive (distribute one full width video per row)",checked:!0},{type:"textbox",name:"width",label:"Initial width (px)",value:"306",tooltip:"Set initial width for video or thumbnail (in pixels)"},{type:"listbox",name:"display",label:"Embed as",tooltip:"",values:[{text:"Thumbnail",value:"thumbnail"},{text:"HTML5 (iframe)",value:"iframe"},{text:"HTML5 (iframe) Asynchronous",value:"iframe2"},{text:"Embedded Playlist",value:"playlist"}]},{type:"checkbox",name:"no_thumb_title",label:"Hide thumbnail tooltip",checked:!1},{type:"checkbox",name:"themelight",label:"Use light theme",tooltip:"Default theme is dark",checked:!1},{type:"checkbox",name:"controls",label:"Hide player controls",checked:!1},{type:"checkbox",name:"autoplay",label:"Autoplay video/playlist",checked:!1},{type:"checkbox",name:"mute",label:"Mute video on autoplay",checked:!1},{type:"checkbox",name:"norel",label:"Hide related videos",checked:!0},{type:"checkbox",name:"nobrand",label:"Hide YT Logo",tooltip:"Does not work for all videos",checked:!0}]},{title:"Content Layout",type:"form",items:[{type:"listbox",name:"showtitle",label:"Show video title",tooltip:"",values:[{text:"Hide title",value:"none",selected:!0},{text:"Above video/thumbnail",value:"above"},{text:"Below video/thumbnail",value:"below"}]},{type:"checkbox",name:"showdesc",label:"Show video description",checked:!1},{type:"textbox",name:"desclen",label:"Description length",value:"0",tooltip:"Set number of characters to cut down video description to (0 means full length)"},{type:"checkbox",name:"noanno",label:"Hide annotations",checked:!0},{type:"checkbox",name:"noinfo",label:"Hide video info",checked:!0}]},{title:"Link to Channel",type:"form",items:[{type:"listbox",name:"link_to",label:"Link to",values:[{text:"Hide link",value:"none",selected:!0},{text:"Vanity/Custom URL",value:"vanity"},{text:"Channel page URL",value:"channel"},{text:"Legacy username URL",value:"legacy"}]},{type:"textbox",name:"goto_txt",label:"Title for link",value:"Visit our YouTube channel"}]}],onsubmit:function(t){var a="[youtube_channel";t.data.vanity&&(a+=" vanity="+t.data.vanity),t.data.channel&&(a+=" channel="+t.data.channel),t.data.legacy&&(a+=" legacy="+t.data.legacy),t.data.playlist&&(a+=" playlist="+t.data.playlist),t.data.resource&&(a+=" resource="+t.data.resource),t.data.cache&&(a+=" cache="+t.data.cache),t.data.privacy&&(a+=" privacy=1"),t.data.random&&(a+=" random=1"),t.data.fetch&&(a+=" fetch="+t.data.fetch.replace(/[^0-9.]/g,"")),t.data.num&&(a+=" num="+t.data.num.replace(/[^0-9.]/g,"")),t.data.ratio&&(a+=" ratio="+t.data.ratio),t.data.responsive&&(a+=" responsive=1"),t.data.width&&(a+=" width="+t.data.width.replace(/[^0-9.]/g,"")),t.data.display&&(a+=" display="+t.data.display),t.data.no_thumb_title&&(a+=" no_thumb_title=1"),t.data.themelight&&(a+=" themelight=1"),t.data.controls&&(a+=" controls=1"),t.data.autoplay&&(a+=" autoplay=1"),t.data.mute&&(a+=" mute=1"),t.data.norel&&(a+=" norel=1"),t.data.nobrand&&(a+=" nobrand=1"),t.data.showtitle&&(a+=" showtitle="+t.data.showtitle),t.data.showdesc&&(a+=" showdesc=1"),t.data.desclen&&(a+=" desclen="+t.data.desclen.replace(/[^0-9.]/g,"")),t.data.noanno&&(a+=" noanno=1"),t.data.noinfo&&(a+=" noinfo=1"),t.data.link_to&&(a+=" link_to="+t.data.link_to),t.data.goto_txt&&(a+=' goto_txt="'+t.data.goto_txt+'"'),t.data.class&&(a+=" class="+t.data.class),a+="]",e.insertContent(a)}})}})})}();
|
1 |
+
!function(){tinymce.PluginManager.add("youtube_channel",function(e){e.addButton("youtube_channel_shortcode",{tooltip:"YouTube Channel",icon:"ytc",onclick:function(){e.windowManager.open({title:"YouTube Channel",bodyType:"tabpanel",buttons:[{text:"Insert Shortcode",onclick:"submit",classes:"widget btn primary",minWidth:130},{text:"Cancel",onclick:"close"}],body:[{title:"General Settings",type:"form",items:[{type:"textbox",name:"class",label:"Custom CSS Class",value:"",tooltip:"Enter custom class for YTC block, if you wish to target block styling"},{type:"textbox",name:"vanity",label:"Vanity/Custom ID",value:""},{type:"textbox",name:"channel",label:"YouTube Channel ID",value:""},{type:"textbox",name:"legacy",label:"Legacy Username",value:""},{type:"textbox",name:"playlist",label:"Playlist ID",value:""},{type:"listbox",name:"resource",label:"Resource to use",tooltip:"",values:[{text:"Channel (User Uploads)",value:"0",selected:!0},{text:"Favourited videos",value:"1"},{text:"Liked videos",value:"3"},{text:"Playlist",value:"2"}]},{type:"listbox",name:"cache",label:"Cache feed",tooltip:"",values:[{text:"Do not cache",value:"0"},{text:"1 minute",value:"60"},{text:"5 minutes",value:"300",selected:!0},{text:"15 minutes",value:"900"},{text:"30 minutes",value:"1800"},{text:"1 hour",value:"3600"},{text:"2 hours",value:"7200"},{text:"5 hours",value:"18000"},{text:"10 hours",value:"36000"},{text:"12 hours",value:"43200"},{text:"18 hours",value:"64800"},{text:"1 day",value:"86400"},{text:"2 days",value:"172800"},{text:"3 days",value:"259200"},{text:"4 days",value:"345600"},{text:"5 days",value:"432000"},{text:"6 days",value:"518400"},{text:"1 week",value:"604800"},{text:"2 weeks",value:"1209600"},{text:"3 weeks",value:"1814400"},{text:"1 month",value:"2419200"}]},{type:"textbox",name:"fetch",label:"Fetch",value:"10",tooltip:"Number of videos that will be used for random pick (min 2, max 50, default 25)"},{type:"textbox",name:"num",label:"Show",value:"1",tooltip:"Number of videos to display"},{type:"checkbox",name:"privacy",label:"Use Enhanced Privacy",tooltip:"Enable this option to protect your visitors privacy",checked:!1},{type:"checkbox",name:"random",label:"Random video",tooltip:'Show random video from resource (Have no effect if "Embed as" has been set to "Embedded Playlist")',checked:!1}]},{title:"Video Settings",type:"form",items:[{type:"listbox",name:"ratio",label:"Aspect Ratio",values:[{text:"Widescreen (16:9)",value:"3",selected:!0},{text:"Standard TV (4:3)",value:"1"}]},{type:"checkbox",name:"responsive",label:"Responsive video",tooltip:"Make video responsive (distribute one full width video per row)",checked:!0},{type:"textbox",name:"width",label:"Initial width (px)",value:"306",tooltip:"Set initial width for video or thumbnail (in pixels)"},{type:"listbox",name:"display",label:"Embed as",tooltip:"",values:[{text:"Thumbnail",value:"thumbnail"},{text:"HTML5 (iframe)",value:"iframe"},{text:"HTML5 (iframe) Asynchronous",value:"iframe2"},{text:"Embedded Playlist",value:"playlist"}]},{type:"checkbox",name:"nolightbox",label:"Disable YTC lightbox",tooltip:"This will work only for Thumbnail",checked:!1},{type:"listbox",name:"target",label:"Open thumbnail anchor",tooltip:"If you select Thumbnail and enable Disable lightbox, you can open thumbnail anchor in new window/tab",values:[{text:"Default",value:""},{text:"New window/tab",value:"_blank"}]},{type:"checkbox",name:"no_thumb_title",label:"Hide thumbnail tooltip",checked:!1},{type:"checkbox",name:"themelight",label:"Use light theme",tooltip:"Default theme is dark",checked:!1},{type:"checkbox",name:"controls",label:"Hide player controls",checked:!1},{type:"checkbox",name:"autoplay",label:"Autoplay video/playlist",checked:!1},{type:"checkbox",name:"mute",label:"Mute video on autoplay",checked:!1},{type:"checkbox",name:"norel",label:"Hide related videos",checked:!0},{type:"checkbox",name:"nobrand",label:"Hide YT Logo",tooltip:"Does not work for all videos",checked:!0}]},{title:"Content Layout",type:"form",items:[{type:"listbox",name:"showtitle",label:"Show video title",tooltip:"",values:[{text:"Hide title",value:"none",selected:!0},{text:"Above video/thumbnail",value:"above"},{text:"Below video/thumbnail",value:"below"}]},{type:"checkbox",name:"showdesc",label:"Show video description",checked:!1},{type:"textbox",name:"desclen",label:"Description length",value:"0",tooltip:"Set number of characters to cut down video description to (0 means full length)"},{type:"checkbox",name:"noanno",label:"Hide annotations",checked:!0},{type:"checkbox",name:"noinfo",label:"Hide video info",checked:!0}]},{title:"Link to Channel",type:"form",items:[{type:"listbox",name:"link_to",label:"Link to",values:[{text:"Hide link",value:"none",selected:!0},{text:"Vanity/Custom URL",value:"vanity"},{text:"Channel page URL",value:"channel"},{text:"Legacy username URL",value:"legacy"}]},{type:"textbox",name:"goto_txt",label:"Title for link",value:"Visit our YouTube channel"}]}],onsubmit:function(t){var a="[youtube_channel";t.data.vanity&&(a+=" vanity="+t.data.vanity),t.data.channel&&(a+=" channel="+t.data.channel),t.data.legacy&&(a+=" legacy="+t.data.legacy),t.data.playlist&&(a+=" playlist="+t.data.playlist),t.data.resource&&(a+=" resource="+t.data.resource),t.data.cache&&(a+=" cache="+t.data.cache),t.data.privacy&&(a+=" privacy=1"),t.data.random&&(a+=" random=1"),t.data.fetch&&(a+=" fetch="+t.data.fetch.replace(/[^0-9.]/g,"")),t.data.num&&(a+=" num="+t.data.num.replace(/[^0-9.]/g,"")),t.data.ratio&&(a+=" ratio="+t.data.ratio),t.data.responsive&&(a+=" responsive=1"),t.data.width&&(a+=" width="+t.data.width.replace(/[^0-9.]/g,"")),t.data.display&&(a+=" display="+t.data.display),t.data.no_thumb_title&&(a+=" no_thumb_title=1"),t.data.themelight&&(a+=" themelight=1"),t.data.controls&&(a+=" controls=1"),t.data.autoplay&&(a+=" autoplay=1"),t.data.mute&&(a+=" mute=1"),t.data.norel&&(a+=" norel=1"),t.data.nobrand&&(a+=" nobrand=1"),t.data.nolightbox&&(a+=" nolightbox=1"),t.data.target&&(a+=" target="+t.data.target),t.data.showtitle&&(a+=" showtitle="+t.data.showtitle),t.data.showdesc&&(a+=" showdesc=1"),t.data.desclen&&(a+=" desclen="+t.data.desclen.replace(/[^0-9.]/g,"")),t.data.noanno&&(a+=" noanno=1"),t.data.noinfo&&(a+=" noinfo=1"),t.data.link_to&&(a+=" link_to="+t.data.link_to),t.data.goto_txt&&(a+=' goto_txt="'+t.data.goto_txt+'"'),t.data.class&&(a+=" class="+t.data.class),a+="]",e.insertContent(a)}})}})})}();
|
inc/widget.php
CHANGED
@@ -34,7 +34,7 @@ class WPAU_YOUTUBE_CHANNEL_Widget extends WP_Widget {
|
|
34 |
$output = $args['before_widget'];
|
35 |
if ( ! empty( $instance['title'] ) ) {
|
36 |
$output .= $args['before_title'];
|
37 |
-
$output .= apply_filters( 'widget_title', $instance['title'] );
|
38 |
$output .= $args['after_title'];
|
39 |
}
|
40 |
$output .= $wpau_youtube_channel->output( $instance );
|
34 |
$output = $args['before_widget'];
|
35 |
if ( ! empty( $instance['title'] ) ) {
|
36 |
$output .= $args['before_title'];
|
37 |
+
$output .= apply_filters( 'widget_title', $instance['title'], $instance, $wpau_youtube_channel->plugin_slug );
|
38 |
$output .= $args['after_title'];
|
39 |
}
|
40 |
$output .= $wpau_youtube_channel->output( $instance );
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: urkekg
|
|
3 |
Donate link: https://urosevic.net/wordpress/donate/?donate_for=youtube-channel
|
4 |
Tags: youtube, channel, playlist, single, widget, widgets, youtube player, feed, video, thumbnail, embed, sidebar, iframe, html5, responsive
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.7.
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -32,7 +32,7 @@ For manual set of videos from YouTube check out [Easy YouTube Gallery](https://w
|
|
32 |
* Hide or show video title above/below video wrapped to HTML tag by your choice (h3, h4, h5, span or div)
|
33 |
* Custom feed caching timeout
|
34 |
* Optional video autoplay with optional muted audio
|
35 |
-
* Optional TinyMCE button on post/page edit (can be disabled on General plugin settings page)
|
36 |
* Show customized link to channel/vanity/legacy username below videos
|
37 |
* Final look is highly customizable thanks to predefined classes for each element of YTC block!
|
38 |
|
@@ -120,8 +120,10 @@ Along to Widget, you can add YouTube Channel block inline by using shortcode `[y
|
|
120 |
* `controls` (bool) Set this option to 1 or true to hide playback controls.
|
121 |
* `autoplay` (bool) Enable autoplay of first video in YTC video stack by setting this option to 1 or true
|
122 |
* `mute` (bool) Set this option to 1 or true to mute videos set to autoplay on load
|
123 |
-
* `norel` (bool) Set this option to 1 or true to
|
124 |
-
* `nobrand` (bool) Set this option to 1 or true to
|
|
|
|
|
125 |
|
126 |
**Content Layout**
|
127 |
|
@@ -357,6 +359,10 @@ If you really need that missing feature ASAP, feel free to [contact me](urosevic
|
|
357 |
If you don't wish to pay for enhancements (then you don't care would that be implemented in a week, month, year or so), then send new [Support topic](https://wordpress.org/support/plugin/youtube-channel) with *Topic title* in format **[Feature Request] ...**
|
358 |
|
359 |
== Changelog ==
|
|
|
|
|
|
|
|
|
360 |
= 3.0.10.5 (20170225) =
|
361 |
* Remove: FMVD opt-in because of general plugin guideline violation rule #9
|
362 |
|
3 |
Donate link: https://urosevic.net/wordpress/donate/?donate_for=youtube-channel
|
4 |
Tags: youtube, channel, playlist, single, widget, widgets, youtube player, feed, video, thumbnail, embed, sidebar, iframe, html5, responsive
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.7.4
|
7 |
+
Stable tag: 3.0.11
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
32 |
* Hide or show video title above/below video wrapped to HTML tag by your choice (h3, h4, h5, span or div)
|
33 |
* Custom feed caching timeout
|
34 |
* Optional video autoplay with optional muted audio
|
35 |
+
* (Optional) *TinyMCE button* on post/page edit (can be disabled on General plugin settings page), which open shortcode GUI generator to help you build shortcode
|
36 |
* Show customized link to channel/vanity/legacy username below videos
|
37 |
* Final look is highly customizable thanks to predefined classes for each element of YTC block!
|
38 |
|
120 |
* `controls` (bool) Set this option to 1 or true to hide playback controls.
|
121 |
* `autoplay` (bool) Enable autoplay of first video in YTC video stack by setting this option to 1 or true
|
122 |
* `mute` (bool) Set this option to 1 or true to mute videos set to autoplay on load
|
123 |
+
* `norel` (bool) Set this option to 1 or true to hide related videos after finished playbak
|
124 |
+
* `nobrand` (bool) Set this option to 1 or true to hide YouTube logo from playback control bar
|
125 |
+
* *NEW* `nolightbox` (bool) Set this option to 1 or true to prevent YTC block with thumbnail to open in lightbox. If you have other plugin that trigger youtube links for lightbox, that one will steal links from this YTC block.
|
126 |
+
* *NEW* `target` (string) If you enable nolightbox for specific YTC block, you can force opening of thumbnail links in new tab/window if you set this shortcode option to `_blank` like `target="_blank"`.
|
127 |
|
128 |
**Content Layout**
|
129 |
|
359 |
If you don't wish to pay for enhancements (then you don't care would that be implemented in a week, month, year or so), then send new [Support topic](https://wordpress.org/support/plugin/youtube-channel) with *Topic title* in format **[Feature Request] ...**
|
360 |
|
361 |
== Changelog ==
|
362 |
+
= 3.0.11 (20170424) =
|
363 |
+
* Fix: added all 3 parameters to `widget_title` filter (reported by @squarestar)
|
364 |
+
* (20170301) Add: New shortcode options `nolightbox` and `target`, to make available opening thumbnail anchors in new tab/window
|
365 |
+
|
366 |
= 3.0.10.5 (20170225) =
|
367 |
* Remove: FMVD opt-in because of general plugin guideline violation rule #9
|
368 |
|
youtube-channel.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: YouTube Channel
|
4 |
Plugin URI: https://urosevic.net/wordpress/plugins/youtube-channel/
|
5 |
Description: Quick and easy embed latest or random videos from YouTube channel (user uploads, liked or favourited videos) or playlist. Use <a href="widgets.php">widget</a> for sidebar or shortcode for content. Works with <em>YouTube Data API v3</em>.
|
6 |
-
Version: 3.0.
|
7 |
Author: Aleksandar Urošević
|
8 |
Author URI: https://urosevic.net/
|
9 |
Text Domain: youtube-channel
|
@@ -17,8 +17,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
17 |
if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
|
18 |
class WPAU_YOUTUBE_CHANNEL {
|
19 |
|
20 |
-
const DB_VER =
|
21 |
-
const VER = '3.0.
|
22 |
|
23 |
public $plugin_name = 'YouTube Channel';
|
24 |
public $plugin_slug = 'youtube-channel';
|
@@ -523,6 +523,9 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
|
|
523 |
'link_to' => $instance['link_to'], // none, vanity, channel, legacy
|
524 |
|
525 |
'class' => ! empty( $instance['class'] ) ? $instance['class'] : '',
|
|
|
|
|
|
|
526 |
),
|
527 |
$atts
|
528 |
);
|
@@ -582,6 +585,9 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
|
|
582 |
// Customization
|
583 |
$instance['class'] = $atts['class']; // custom additional class for container
|
584 |
|
|
|
|
|
|
|
585 |
// return implode( array_values( $this->output( $instance ) ) );
|
586 |
return $this->output( $instance );
|
587 |
} // END public function shortcode()
|
@@ -1213,18 +1219,24 @@ if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
|
|
1213 |
$title = sprintf( __( 'Watch video %1$s published on %2$s', 'youtube-channel' ), $yt_title, $yt_date );
|
1214 |
}
|
1215 |
|
1216 |
-
$p = '';
|
1217 |
if ( empty( $instance['nolightbox'] ) ) {
|
1218 |
if ( ! empty( $instance['norel'] ) ) { $p .= '&rel=0'; }
|
1219 |
if ( ! empty( $instance['modestbranding'] ) ) { $p .= '&modestbranding=1'; }
|
1220 |
if ( ! empty( $instance['controls'] ) ) { $p .= '&controls=0'; }
|
1221 |
if ( ! empty( $instance['playsinline'] ) ) { $p .= '&playsinline=1'; }
|
1222 |
if ( ! empty( $instance['privacy'] ) ) { $p .= '&enhanceprivacy=1'; }
|
|
|
|
|
|
|
|
|
|
|
|
|
1223 |
}
|
1224 |
|
1225 |
// Do we need thumbnail w/ or w/o tooltip
|
1226 |
$tag_title = ( empty( $instance['no_thumb_title'] ) ) ? $tag_title = "title=\"{$yt_title}\"" : '';
|
1227 |
-
$output .= "<a href=\"//www.youtube.com/watch?v=${yt_id}${p}\" ${tag_title} class=\"ytc_thumb
|
1228 |
|
1229 |
} // what to show conditions
|
1230 |
|
3 |
Plugin Name: YouTube Channel
|
4 |
Plugin URI: https://urosevic.net/wordpress/plugins/youtube-channel/
|
5 |
Description: Quick and easy embed latest or random videos from YouTube channel (user uploads, liked or favourited videos) or playlist. Use <a href="widgets.php">widget</a> for sidebar or shortcode for content. Works with <em>YouTube Data API v3</em>.
|
6 |
+
Version: 3.0.11
|
7 |
Author: Aleksandar Urošević
|
8 |
Author URI: https://urosevic.net/
|
9 |
Text Domain: youtube-channel
|
17 |
if ( ! class_exists( 'WPAU_YOUTUBE_CHANNEL' ) ) {
|
18 |
class WPAU_YOUTUBE_CHANNEL {
|
19 |
|
20 |
+
const DB_VER = 18;
|
21 |
+
const VER = '3.0.11';
|
22 |
|
23 |
public $plugin_name = 'YouTube Channel';
|
24 |
public $plugin_slug = 'youtube-channel';
|
523 |
'link_to' => $instance['link_to'], // none, vanity, channel, legacy
|
524 |
|
525 |
'class' => ! empty( $instance['class'] ) ? $instance['class'] : '',
|
526 |
+
|
527 |
+
'nolightbox' => $instance['nolightbox'],
|
528 |
+
'target' => '',
|
529 |
),
|
530 |
$atts
|
531 |
);
|
585 |
// Customization
|
586 |
$instance['class'] = $atts['class']; // custom additional class for container
|
587 |
|
588 |
+
$instance['nolightbox'] = $atts['nolightbox']; // custom usage of lightbox
|
589 |
+
$instance['target'] = $atts['target']; // custom target for thumbnails w/o lightbox (empty, _blank or custom)
|
590 |
+
|
591 |
// return implode( array_values( $this->output( $instance ) ) );
|
592 |
return $this->output( $instance );
|
593 |
} // END public function shortcode()
|
1219 |
$title = sprintf( __( 'Watch video %1$s published on %2$s', 'youtube-channel' ), $yt_title, $yt_date );
|
1220 |
}
|
1221 |
|
1222 |
+
$p = $target = '';
|
1223 |
if ( empty( $instance['nolightbox'] ) ) {
|
1224 |
if ( ! empty( $instance['norel'] ) ) { $p .= '&rel=0'; }
|
1225 |
if ( ! empty( $instance['modestbranding'] ) ) { $p .= '&modestbranding=1'; }
|
1226 |
if ( ! empty( $instance['controls'] ) ) { $p .= '&controls=0'; }
|
1227 |
if ( ! empty( $instance['playsinline'] ) ) { $p .= '&playsinline=1'; }
|
1228 |
if ( ! empty( $instance['privacy'] ) ) { $p .= '&enhanceprivacy=1'; }
|
1229 |
+
$lightbox_class = 'ytc-lightbox';
|
1230 |
+
} else {
|
1231 |
+
$lightbox_class = 'ytc-nolightbox';
|
1232 |
+
if ( ! empty( $instance['target'] ) ) {
|
1233 |
+
$target = 'target="' . sanitize_key( $instance['target'] ) . '"';
|
1234 |
+
}
|
1235 |
}
|
1236 |
|
1237 |
// Do we need thumbnail w/ or w/o tooltip
|
1238 |
$tag_title = ( empty( $instance['no_thumb_title'] ) ) ? $tag_title = "title=\"{$yt_title}\"" : '';
|
1239 |
+
$output .= "<a href=\"//www.youtube.com/watch?v=${yt_id}${p}\" ${tag_title} class=\"ytc_thumb ${lightbox_class} ${arclass}\" ${target}><span style=\"background-image: url(${yt_thumb});\" ${tag_title} id=\"ytc_{$yt_id}\"></span></a>";
|
1240 |
|
1241 |
} // what to show conditions
|
1242 |
|