Hello,
something very strange is happening in my oxygen editor, in a codeblock, i have this php code and a metabox relationship, i am on a single archive page that applies to archive -> authors ->all authors (the relationship is between user and CPT book)
<?php
$temp_id = get_the_author_meta('ID');
echo 'Author ID before first query: ' . $temp_id;
$connected = new WP_Query([
'relationship' => [
'id' => 'rs_book_usr',
'to' => $temp_id,
],
'nopaging' => true,
]);
if ($connected->have_posts()) {
while ($connected->have_posts()) : $connected->the_post();
echo '<span>' . get_the_title() . '</span>';
endwhile;
}
wp_reset_postdata();
$temp_id = get_the_author_meta('ID');
echo 'Author ID after first query: ' . $temp_id;
?>
i want to display data from a user that is in relation with the cpt book, the code works, but for some reason the get_the_author_meta('ID'); value changes and the second code snippet gives wrong results. any ideas ?