Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.