Last active
August 29, 2015 13:56
-
-
Save suth/9341300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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