Skip to content

Instantly share code, notes, and snippets.

@suth
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suth/9341300 to your computer and use it in GitHub Desktop.
Save suth/9341300 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Find Video Thumbnails in Post and Custom Field
Plugin URI: http://refactored.co
Description: Mod for Video Thumbnails to also scan the post content when a custom field is entered in the settings.
Author: Refactored Co.
Author URI: http://refactored.co
Version: 0.1
License: GPL2
*/
function add_post_content_to_video_thumbnail_markup( $markup, $post_id ) {
$post_array = get_post( $post_id );
$post_content = $post_array->post_content;
$post_content = apply_filters( 'the_content', $post_content );
return $post_content . ' ' . $markup;
}
add_filter( 'video_thumbnail_markup', 'add_post_content_to_video_thumbnail_markup', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment