I'm using this script to get image filename, stored in a custom meta called background:
$background = get_post_meta( '22', 'background', true ); echo $background;
But it is returning the id of the image, not his filename.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
background is not a Core meta field. Since you say that
get_post_meta( '22', 'background', true ); returns an image ID, I can only assume that whatever saved that value saved the image ID and not the filename.