Add wp_get_attachment_image_url function

This commit is contained in:
Mike Francis 2015-04-10 10:17:05 +01:00
parent a3d6e1aec3
commit a3102e322d
1 changed files with 10 additions and 0 deletions

View File

@ -131,3 +131,13 @@ function barebones_tiny_mce_before_init( $settings ) {
}
add_filter( 'tiny_mce_before_init', 'barebones_tiny_mce_before_init' );
/**
* Get image URL for whatever size.
*/
function wp_get_attachment_image_url( $id, $size = 'full', $attrs = []) {
$image = wp_get_attachment_image_src( $id, $size, $attrs );
return $image[0];
}