Skip to content

Instantly share code, notes, and snippets.

@jeremyfelt
Created May 13, 2012 00:18
Show Gist options
  • Save jeremyfelt/2669822 to your computer and use it in GitHub Desktop.
Save jeremyfelt/2669822 to your computer and use it in GitHub Desktop.
Filters enabled in Youtube Favorite Video Posts
<?php
/* A brief overview of filters that are now available in Youtube Favorite Video Posts.
*
* These allow easy overriding of the default post title and content before the
* new post is created.
*/
add_filter( 'yfvp_new_video_embed_code', 'myprefix_change_yfvp_post_content', 10, 1 );
/* Adds a little nonsense introduction to the video before embedding the
* iframe that was provided by default */
function myprefix_change_yfvp_post_content( $video_embed_code, $video_token ) {
$new_content = 'My video post includes the token - ' . $video_token . ' - before embedding!';
$new_content .= $video_embed_code;
return $new_content;
}
add_filter( 'yfvp_new_video_item_title' 'myprefix_change_yfvp_post_title', 10, 1 );
/* Changes the default title from Youtube */
function myprefix_change_yfvp_post_title( $current_title ) {
return 'This is a video: ' . $current_title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment