Added function to get post thumbnail url

This commit is contained in:
Pedro Reis 2016-04-19 12:57:14 +01:00
parent ae8c2dd9c0
commit 3d4a374115
1 changed files with 14 additions and 0 deletions

View File

@ -174,3 +174,17 @@ function barebones_tiny_mce_before_init( $settings )
}
add_filter( 'tiny_mce_before_init', 'barebones_tiny_mce_before_init' );
/**
* Get post thumbnail url
*
* @param int $post_id
* @return string
*/
function get_post_thumbnail_url( $post_id )
{
return wp_get_attachment_url( get_post_thumbnail_id( $post_id ) );
}