{"id":222876,"date":"2011-03-29T08:00:00","date_gmt":"2011-03-29T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/youtube-channel\/"},"modified":"2025-02-08T17:35:00","modified_gmt":"2025-02-08T17:35:00","slug":"youtube-channel","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/youtube-channel\/","title":{"rendered":"My YouTube Channel"},"content":{"rendered":"<p>Add <strong>My YouTube Channel<\/strong> widget to the widget area or shortcode to post\/page content, set <strong>Channel ID<\/strong> or <strong>Playlist ID<\/strong>, chose resource to use and keep defaults for all other options. And voila! You will get the latest video from chosen YouTube channel or playlist.<\/p>\n<p><strong>IMPORTANT<\/strong> My YouTube Channel does not support <strong>Live Streams<\/strong> and does not have Gutenberg Block. Use <strong>Shortcode Block<\/strong> or <strong>Classic Block<\/strong> to insert shortcode to page\/post content.<\/p>\n<p>If you like our plugin and find it useful, please <a href=\"https:\/\/wordpress.org\/support\/view\/plugin-reviews\/youtube-channel\" rel=\"ugc\">write a review and rate it<\/a>.<\/p>\n<p>For a manually picked set of videos from YouTube, check out <a href=\"https:\/\/wordpress.org\/plugins\/easy-youtube-gallery\/\" rel=\"ugc\">Easy YouTube Gallery<\/a>.<\/p>\n<h4>Features<\/h4>\n<ul>\n<li>Show latest videos from My YouTube Channel (ordered in reverse chronological order related to the creation date), or from Playlist<\/li>\n<li>Option to get a random video from any of two resources<\/li>\n<li>Responsive (one full-width video per row) or non-responsive<\/li>\n<li>Preferred aspect ratio relative to width (16:9 and 4:3)<\/li>\n<li>Custom width for video embeded object (default is 306px)<\/li>\n<li>Four modes to display video: <strong>thumbnail<\/strong> (<code>default<\/code>), <strong>HTML5<\/strong> (<code>iframe<\/code>), <strong>HTML5 Asynchronous<\/strong> (<code>iframe2<\/code>) abd <strong>Playlist Embed<\/strong> (<code>playlist<\/code>)<\/li>\n<li>Thumbnail mode opens the video in lightbox<\/li>\n<li>[NEW] Optionally store thumbnail images locally for improved speed performance and cache policy<\/li>\n<li>Enhanced Privacy \u2013 please note that display mode <strong>HTML5 (IFRAME) Asynchronous<\/strong> (shortcode parameter <code>iframe2<\/code>) does not support Enhanced Privacy due to YouTube API limitations<\/li>\n<li>Hide or show video title above\/below\/inside video wrapped to HTML tag by your choice (h3, h4, h5, span or div)<\/li>\n<li>Custom feed caching timeout<\/li>\n<li>Optional video autoplay with optional muted audio<\/li>\n<li>(Optional) <em>TinyMCE button<\/em> on post\/page edit (can be disabled on General plugin settings page), which open a shortcode GUI generator to help you build a shortcode<\/li>\n<li>Show link to channel\/handle below videos (vanity and legacy username are deprecated since v3.23.0)<\/li>\n<li>Final look is highly customisable thanks to classes for each element of YTC block!<\/li>\n<\/ul>\n<h4>Requirements<\/h4>\n<p>For a fully functional plugin, PHP 7.4 or newer has required! If you use older PHP, we highly recommend you request from your developer, server support or hosting company to update PHP to a secure version.<\/p>\n<h4>Styling<\/h4>\n<p>Use Customizer, <code>style.css<\/code> from the child theme or <a href=\"https:\/\/wordpress.org\/plugins\/head-footer-code\/\" rel=\"ugc\">Head & Footer Code<\/a> plugin to custom style and tweak the look and feel of the My YouTube Channel blocks. You can utilise the following classes:<\/p>\n<ul>\n<li><code>.widget_youtube-channel<\/code> \u2013 class of whole widget (parent for widget title and YTC block)<\/li>\n<li><code>.youtube_channel<\/code> \u2013 YTC block wrapper class. Additional classes are available:\n<ul>\n<li><code>.default<\/code> \u2013 for non-responsive block<\/li>\n<li><code>.responsive<\/code> \u2013 when you have enabled responsive option<\/li>\n<\/ul>\n<\/li>\n<li><code>.ytc_title<\/code> \u2013 class for video title container above thumbnail\/video object\n<ul>\n<li><code>.ytc_title_above<\/code> \u2013 additional class for video title above video\/thumbnail<\/li>\n<li><code>.ytc_title_below<\/code> \u2013 additional class for video title below video\/thumbnail<\/li>\n<li><code>.ytc_title_inside<\/code> \u2013 additional class for video title printed inside of the thumbnail<\/li>\n<li><code>.ytc_title_inside_bottom<\/code> \u2013 additional class for bottom aligned video title printed inside of the thumbnail<\/li>\n<\/ul>\n<\/li>\n<li><code>.ytc_video_container<\/code> \u2013 class of container for single item, plus:\n<ul>\n<li><code>.ytc_video_1<\/code>, <code>.ytc_video_2<\/code>, \u2026 \u2013 class of container for single item with ordering number of item in widget<\/li>\n<li><code>.ytc_video_first<\/code> \u2013 class of first container for single item<\/li>\n<li><code>.ytc_video_mid<\/code> \u2013 class of all other containers for single item<\/li>\n<li><code>.ytc_video_last<\/code> \u2013 class of last container for single item<\/li>\n<li><code>.ar16_9<\/code> \u2013 class for Aspect Ratio 16:9<\/li>\n<li><code>.ar4_3<\/code> \u2013 class for Aspect Ration 4:3<\/li>\n<\/ul>\n<\/li>\n<li><code>.ytc_thumb<\/code> \u2013 class of anchor for Thumbnail mode<\/li>\n<li><code>.fluid-width-video-wrapper<\/code> \u2013 class for parent element of IFRAME for enabled responsive<\/li>\n<li><code>.ytc_description<\/code> \u2013 class for video description text below thumbnail\/video object<\/li>\n<li><code>.ytc_link<\/code> \u2013 class of container for link to channel<\/li>\n<\/ul>\n<h4>Known Issues<\/h4>\n<ul>\n<li>Video title and description for embedded playlist mode do not work.<\/li>\n<li>Removing the YouTube logo from the playback control bar does not work for all videos.<\/li>\n<li>Autoplay does not work always<\/li>\n<\/ul>\n<p>If WordFence or other malware scan tool detect My YouTube Channel file <code>youtube-channel.php<\/code> as a potential risk because <code>base64_encode()<\/code> and <code>base64_decode()<\/code> functions, remember that we use this two functions to store and restore JSON feeds to transient cache, so potential detection is false positive.<\/p>\n<h4>Credits<\/h4>\n<ul>\n<li>For playing videos in lightbox we use <a href=\"https:\/\/github.com\/henrygd\/bigger-picture\" rel=\"nofollow ugc\">Bigger Picture<\/a>.<\/li>\n<\/ul>\n<h4>Shortcode<\/h4>\n<p>Along with Widget, you can add My YouTube Channel block inline by using shortcode <code>[youtube_channel]<\/code>. Default plugin parameters will be used for shortcode, but you can customize all parameters per shortcode.<\/p>\n<p><strong>General Settings<\/strong><\/p>\n<ul>\n<li><code>class<\/code> (string) Set custom class if you wish to target special styling for specific YTC block<\/li>\n<li><code>channel<\/code> (string) ID of preferred YouTube channel. Do not set full URL to channel, but just last part from URL \u2013 ID (name)<\/li>\n<li><code>handle<\/code> (string) defined custom handle from <a href=\"https:\/\/www.youtube.com\/handle\" rel=\"nofollow ugc\">YouTube handle<\/a><\/li>\n<li><code>vanity<\/code> (string) <strong>DEPRECATED<\/strong> part after www.youtube.com\/c\/ from <a href=\"https:\/\/support.google.com\/youtube\/answer\/2657968?hl=en\" rel=\"nofollow ugc\">Custom URL<\/a><\/li>\n<li><code>username<\/code> (string) <strong>DEPRECATED<\/strong> Optional legacy YouTube username.<\/li>\n<li><code>playlist<\/code> (string) ID of preferred YouTube playlist.<\/li>\n<li><code>resource<\/code> (int) Resource to use for feed:\n<ul>\n<li><code>0<\/code> Channel (User uploads)<\/li>\n<li><code>1<\/code> <strong>DEPRECATED<\/strong> Favorites (for defined channel)<\/li>\n<li><code>2<\/code> Playlist<\/li>\n<li><code>3<\/code> <strong>DEPRECATED<\/strong> Liked Videos<\/li>\n<\/ul>\n<\/li>\n<li><code>cache<\/code> (int) Period in seconds for caching feed. You can disable caching by setting this option to 0, but if you have a lot of visits, consider at least short caching (couple minutes).<\/li>\n<li><code>fetch<\/code> (int) Number of videos that will be used as stack for random pick (min 2, max 50)<\/li>\n<li><code>num<\/code> (int) Number of videos to display per YTC block.<\/li>\n<li><code>random<\/code> (bool) Option to randomize videos on every page load.<\/li>\n<\/ul>\n<p><strong>Video Settings<\/strong><\/p>\n<ul>\n<li><code>ratio<\/code> (int) Set preferred aspect ratio for thumbnail and video. You can use:\n<ul>\n<li><code>3<\/code> 16:9 (widescreen)<\/li>\n<li><code>1<\/code> 4:3<\/li>\n<\/ul>\n<\/li>\n<li><code>responsive<\/code> (bool) Distribute one full width video per row.<\/li>\n<li><code>width<\/code> (int) Width of thumbnail and video in pixels.<\/li>\n<li><code>display<\/code> (string) Object that will be used to represent video. We have couple predefined options:\n<ul>\n<li><code>thumbnail<\/code> Thumbnail will be used and video will be loaded in lightbox. (default)<\/li>\n<li><code>iframe<\/code> HTML5 (iframe)<\/li>\n<li><code>iframe2<\/code> HTML5 (iframe) with asynchronous loading \u2013 recommended<\/li>\n<li><code>playlist<\/code> Embedded playlist (same behaviour as old function <code>only_pl<\/code>)<\/li>\n<\/ul>\n<\/li>\n<li><code>thumb_quality<\/code> (string) Define image quality for thumbnail display mode. Default is <code>hqdefault<\/code>, available:\n<ul>\n<li><code>default<\/code> Default Quality (120x90px)<\/li>\n<li><code>mqdefault<\/code> Medium Quality (320x180px)<\/li>\n<li><code>hqdefault<\/code> High Quality (480x360px)<\/li>\n<li><code>sddefault<\/code> Standard Definition (640x480px)<\/li>\n<li><code>maxresdefault<\/code> Maximum Resolution (1280x720px)<\/li>\n<\/ul>\n<\/li>\n<li><code>no_thumb_title<\/code> (bool) By default YouTube thumbnail will have tooltip with info about video title and date of publishing. By setting this option to 1 or true you can hide tooltip<\/li>\n<li><code>themelight<\/code> (bool) By default YouTube have dark play controls theme. By setting this option to 1 or true you can get light theme in player (HTML5 and Flash)<\/li>\n<li><code>controls<\/code> (bool) Set this option to 1 or true to hide playback controls.<\/li>\n<li><code>autoplay<\/code> (bool) Enable autoplay of first video in YTC video stack by setting this option to 1 or true<\/li>\n<li><code>mute<\/code> (bool) Set this option to 1 or true to mute videos set to autoplay on load<\/li>\n<li><code>norel<\/code> (bool) Set this option to 1 or true to hide related videos after finished playbak<\/li>\n<li><code>nobrand<\/code> (bool) Set this option to 1 or true to hide YouTube logo from playback control bar<\/li>\n<li><code>nolightbox<\/code> (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.<\/li>\n<li><code>target<\/code> (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 <code>_blank<\/code> like <code>target=\"_blank\"<\/code>.<\/li>\n<\/ul>\n<p><strong>Content Layout<\/strong><\/p>\n<ul>\n<li><code>showtitle<\/code> (string):\n<ul>\n<li><code>none<\/code> \u2013 Hide title<\/li>\n<li><code>above<\/code> \u2013 Display title above video\/thumbnail<\/li>\n<li><code>below<\/code> \u2013 Display title below video\/thumbnail<\/li>\n<li><code>inside<\/code> \u2013 Display top aligned title inside thumbnail; if <code>display<\/code> is not <code>thumbnail<\/code> then treat as <code>above<\/code><\/li>\n<li><code>inside_b<\/code> \u2013 Display bottom aligned title inside thumbnail; if <code>display<\/code> is not <code>thumbnail<\/code> then treat as <code>below<\/code><\/li>\n<\/ul>\n<\/li>\n<li><code>titletag<\/code> \u2013 Video title HTML tag to wrap title (H3, H4, H5, div, span, strong, etc)<\/li>\n<li><code>showdesc<\/code> (bool) Set to 1 or true to show video description.<\/li>\n<li><code>desclen<\/code> (int) Set number of characters to cut down length of video description. Set to 0 to use full length description.<\/li>\n<li><code>noinfo<\/code> (bool) Set to 1 or true to hide overlay video infos (from embedded player)<\/li>\n<li><code>noanno<\/code> (bool) Set to 1 or true to hide overlay video annotations (from embedded player)<\/li>\n<\/ul>\n<p><strong>Link to Channel<\/strong><\/p>\n<ul>\n<li><code>goto_txt<\/code> (string)<\/li>\n<li><code>popup<\/code> (int) Control where link to channel will be opened:\n<ul>\n<li><code>0<\/code> open link in same window<\/li>\n<li><code>1<\/code> <strong>DEPRECATED<\/strong> open link in new window with JavaScript<\/li>\n<li><code>2<\/code> open link in new window with target=\u201d_blank\u201d anchor attribute<\/li>\n<\/ul>\n<\/li>\n<li><code>link_to<\/code> (string) URL to link:\n<ul>\n<li><code>none<\/code> Hide link (defult)<\/li>\n<li><code>handle<\/code> YouTube handle URL<\/li>\n<li><code>channel<\/code> Channel page<\/li>\n<li><code>vanity<\/code> <strong>DEPRECATED<\/strong> Vanity custom URL<\/li>\n<li><code>legacy<\/code> <strong>DEPRECATED<\/strong> Legacy username page<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><em>Please note, to enhance plugin functionality, we can change or deprecate some shortcode parameters in future.<\/em><\/p>\n<h3>Filter hooks<\/h3>\n<p>You can modify final output of video block by hooking to filter <code>ytc_print_video<\/code>.<\/p>\n<p>Four parameters are provided:<\/p>\n<ul>\n<li><code>video_content<\/code> \u2013 HTML of original video block<\/li>\n<li><code>item<\/code> \u2013 YouTube video object which contains:\n<ul>\n<li><code>snippet->publishedAt<\/code> \u2013 date of publishing YouTube video<\/li>\n<li><code>shippet->title<\/code> \u2013 YouTube video title<\/li>\n<li><code>shippet->description<\/code> \u2013 YouTube video description<\/li>\n<li><code>snippet->resourceId->videoId<\/code> \u2013 YouTube video ID<\/li>\n<\/ul>\n<\/li>\n<li><code>instance<\/code> \u2013 Current My YouTube Channel Block parameters, including global settings:\n<ul>\n<li><code>handle<\/code><\/li>\n<li><code>channel<\/code><\/li>\n<li><code>vanity<\/code> <strong>DEPRECATED<\/strong><\/li>\n<li><code>username<\/code> <strong>DEPRECATED<\/strong><\/li>\n<li><code>playlist<\/code><\/li>\n<li><code>resource<\/code><\/li>\n<li><code>cache<\/code><\/li>\n<li><code>fetch<\/code><\/li>\n<li><code>num<\/code><\/li>\n<li><code>skip<\/code><\/li>\n<li><code>privacy<\/code><\/li>\n<li><code>ratio<\/code><\/li>\n<li><code>width<\/code><\/li>\n<li><code>responsive<\/code><\/li>\n<li><code>display<\/code><\/li>\n<li><code>fullscreen<\/code><\/li>\n<li><code>controls<\/code><\/li>\n<li><code>autoplay<\/code><\/li>\n<li><code>autoplay_mute<\/code><\/li>\n<li><code>norel<\/code><\/li>\n<li><code>playsinline<\/code><\/li>\n<li><code>showtitle<\/code><\/li>\n<li><code>titletag<\/code><\/li>\n<li><code>showdesc<\/code><\/li>\n<li><code>desclen<\/code><\/li>\n<li><code>modestbranding<\/code><\/li>\n<li><code>hideanno<\/code><\/li>\n<li><code>goto_txt<\/code><\/li>\n<li><code>popup_goto<\/code><\/li>\n<li><code>link_to<\/code><\/li>\n<li><code>tinymce<\/code><\/li>\n<li><code>nolightbox<\/code><\/li>\n<li><code>apikey<\/code><\/li>\n<li><code>thumb_quality<\/code><\/li>\n<li><code>timeout<\/code><\/li>\n<li><code>random<\/code><\/li>\n<li><code>no_thumb_title<\/code><\/li>\n<li><code>class<\/code><\/li>\n<li><code>target<\/code><\/li>\n<\/ul>\n<\/li>\n<li><code>y<\/code> \u2013 order number of video (<code>1<\/code> for first, <code>2<\/code> for second, etc)<\/li>\n<\/ul>\n<p>Example:<\/p>\n<pre><code>add_filter( 'ytc_print_video', 'customized_ytc_print_video', 10, 4 );\nfunction customized_ytc_print_video( $video_block, $item, $instance, $y ) {\n    \/\/ Do whatever you wish to do\n    \/\/ ...\n    return $video_block;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Show video thumbnails or playable video block of recent YouTube Playlist, Channel (User Uploads) videos.<\/p>\n","protected":false},"author":65,"featured_media":393340,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"My YouTube Channel - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Show video thumbnails or playable video block of recent YouTube Playlist, Channel (User Uploads) videos."},"footnotes":""},"categories":[1],"tags":[467,1462,98,120,189],"class_list":["post-222876","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-channel","tag-playlist","tag-video","tag-widget","tag-youtube"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/222876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=222876"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/222876\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/393340"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=222876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=222876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=222876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}