(MB) YouTube Widget free WordPress plugin
Description
The YouTube videos widget lets you quickly and easily display your most recent YouTube videos in your blog’s sidebar. Features The YouTube videos widget is fully-based on the WordPress Plugin API. Uses hooks and filters to allow for maximum hackability by theme designers and developers. Organized straightforwardly so that it’s easy to modify and style. Usage The YouTube videos widget is ready to use as-is, although you can easily customize it to your liking with a bit of code. You can also insert a plain list of your recent videos into posts and pages with the shortcode mechabyte_youtube. For example, to load 5 videos from freddiew that open in new tabs, you’d use [mechabyte_youtube username=”freddiew” videos=”5″ tab=”true”]. Custom Styles The YouTube videos widget loads it styles by hooking into WordPress’ wp_enqueue_scripts action. To remove the default styling you need to remove the our enqueue_scripts function from the hook. remove_action( ‘wp_enqueue_scripts’, array( ‘mechabyteYouTube’, ‘enqueue_scripts’ ) ); Custom Output The end user has two options of displaying their YouTube videos: in plain or decorated lists. When modifying the output of the plugin you must use one of two filters that this plugin uses: mbYT_construct_plain and mbYT_construct_decorated. Before you add your own functions to either filter, you must remove the default ones that are used automatically: mbYT_construct_plain_default and mbYT_construct_decorated_default. remove_filter( ‘mbYT_construct_plain’, array( ‘mechabyteYouTube’, ‘mbYT_construct_plain_default’), 10, 3 ); remove_filter( ‘mbYT_construct_decorated’, array( ‘mechabyteYouTube’, ‘mbYT_construct_decorated_default’), 10, 3 ); Now it’s time to get creative. When creating a function that will loop through the videos you have complete control over how you want to display the content. Just keep in mind that in the end, you should be outputting elements. When filters are being applied to the YouTube content, there are three arguments that are being passed through: $youtube_videos (array, the array of videos), $number (integer, the
Features
Cost:
Free
Provider:
Mechabyte - Matthew Smith
Popularity:
Low
WPMarket

