Support

Account

Home Forums General Issues Get the ID of an image field set to return the URL Reply To: Get the ID of an image field set to return the URL

  • WOW John!!! I had never noticed that 3rd parameter. Indeed that was exactly what I wanted! If only I had your answer yesterday, I wouldn’t have resourced in directly querying the DB…

    $_poster = $wpdb->get_results("SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key = 'movie_poster' AND post_id = {$post->ID};", ARRAY_A)[0]['meta_value'];

    But I’ll update my code as your solution is much more clean! Thanks a lot!