WordPress: Does get_post_meta() query the database while in the loop?

Does get_post_meta() query the database while in the loop?

During search results (in the loop) I have a series of values I grab post meta for.

Read More

example:

<?php
$post_meta_array = array(
    'this',
    'that',
    'more',
    'stuff'
);

foreach ($post_meta_array as $get_meta) {

    $stuff_just_got = get_post_meta($get_meta, '');

}
?>

I was under the impress that get_post_meta() does not need to query the database while in the loop. I’m double checking to see if that is the case. If its not the case…ouch.

Related posts

Leave a Reply

2 comments