From 1.7.1 onwards the plugin adds a new custom parameter: title.
This parameter sets a “title” HTML attribute on both iframe & object HTML elements. Its value should be a description of the video’s content or several tags related to it.
It’s very useful for SEO and Accessibility (WCAG 1.0+).
The title may not show up when you hover the video with your mouse. If that is the case inspect the iframe tag with Firebug or your browser’s developer tools.
Here’s an example:
Shortcode parameters used:
url=k2vkwy2vdP4 title="Big wave surfing" width=400
In order to make the shortcode work properly when creating a shortcode with a “title” attribute in a template file you must call the function Youtube_shortcode::encode_str(title):
<?php echo do_shortcode('[youtube_sc url=DVwTmClYF3I title='. Youtube_shortcode::encode_str("My description of the video's content") .']'); ?>Wether you are using double or single quotes to wrap the title parameter’s value, you must use that function.
However, if you’re using the TinyMCE button to embed YouTube videos you don’t need to worry about this (the plugin does it for you).