예제 #1
0
/**
* Get video download URL
*
* Return a URL for the video so that it can be downloaded
*
* @since	2.0
*
* @uses		aye_generate_download_code	Get the download URL
*
* @param    string		$id				YouTube video ID
* @return	string						Download URL
*/
function get_video_download($id)
{
    return aye_generate_download_code($id);
}
예제 #2
0
/**
* Download shortcode
*
* Generate a short URL for a YouTube video
*
* @since	2.0
*
* @uses		aye_generate_download_code	Generate the download code
*
* @param    string		$paras			Shortcode parameters
* @param	string		$content		Shortcode content
* @return   string						YouTube download link
*/
function aye_video_download($paras = '', $content = '')
{
    extract(shortcode_atts(array('id' => '', 'target' => '', 'nofollow' => ''), $paras));
    // Return the URL
    $link = aye_generate_download_code($id);
    // Now add the HTML to the URL (assuming it's not an error)
    if (substr($link, 0, 2) != '<p') {
        $link = '<a href="' . $link . '"';
        if ($target != '') {
            $link .= ' target="' . $target . '"';
        }
        if (strtolower($nofollow) != 'no') {
            $link .= ' rel="nofollow"';
        }
        $link .= '>' . $content . '</a>';
    }
    return do_shortcode($link);
}