WordPress-Plugin-Template
WordPress-Plugin-Template copied to clipboard
get_option('wpt_an_image') returns a number not a url string
when i use get_option('wpt_an_image') it returns a number not a url string i can use to referace the image
in my case:
$image = get_option('mkit_an_image','No Image Selected!');
$html = '<img src="' . $image .'">';
Returns <img src="4">
It's the attachment ID. Use wp_get_attachment_url
to get the url.
https://developer.wordpress.org/reference/functions/wp_get_attachment_image/ https://codex.wordpress.org/Function_Reference/wp_get_attachment_url