wp query: wp_query does not show posts when the user logs in (not administrator)

I created a related publishing function that I am calling in a sidebar:

get_all_related_posts () function {
$ global post;
$ postid = $ post-> ID;



$ tag_ids = wp_get_post_tags ($ postid, array (& # 39; fields & # 39; => & # 39; ids & # 39;));

$ args = array (
& # 39; post_type & # 39; => & # 39; any & # 39 ;,
& # 39; tag__in & # 39; => $ tag_ids,


& # 39; post__not_in & # 39; => array ($ postid),

& # 39; orderby & # 39; => & # 39; date & # 39 ;,
& # 39; order & # 39; => & # 39; DESC & # 39 ;,
& # 39; posts_per_page & # 39; => 5,
);
$ the_query = new WP_Query ($ args);


// The loop
if ($ the_query-> have_posts ()) {?>
        
    
    
    
    <? php} more {
// No publications found
}
/ * Restore original publication data * /
wp_reset_postdata ();
}   

When the user logs off, it works. When I am logged in as an administrator, it works. When the user logs into any other function, it does not work.

A print_r of $ the_query when you log in as administrator:

WP_Query Object ( (query) => Array ( (post_type) => Array ( (0) => post (1) => podcasts (2) => noir_narratives (3) => music (4) => movies (5) => tv_shows (6) => books (7) => video_games ) (tag__in) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (post_status) => publish (post__not_in) => Array ( (0) => 404 ) (orderby) => date (order) => DESC (posts_per_page) => 5 ) (query_vars) => Array ( (post_type) => Array ( (0) => post (1) => podcasts (2) => noir_narratives (3) => music (4) => movies (5) => tv_shows (6) => books (7) => video_games ) (tag__in) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (post_status) => publish (post__not_in) => Array ( (0) => 404 ) (orderby) => date (order) => DESC (posts_per_page) => 5 (error) => (m) => (p) => 0 (post_parent) => (subpost) => (subpost_id) => (attachment) => (attachment_id) => 0 (name) => (pagename) => (page_id) => 0 (second) => (minute) => (hour) => (day) => 0 (monthnum) => 0 (year) => 0 (w) => 0 (category_name) => (tag) => (cat) => (tag_id) => 57 (author) => (author_name) => (feed) => (tb) => (paged) => 0 (meta_key) => (meta_value) => (preview) => (s) => (sentence) => (title) => (fields) => (menu_order) => (embed) => (category__in) => Array ( ) (category__not_in) => Array ( ) (category__and) => Array ( ) (post__in) => Array ( ) (post_name__in) => Array ( ) (tag__not_in) => Array ( ) (tag__and) => Array ( ) (tag_slug__in) => Array ( ) (tag_slug__and) => Array ( ) (post_parent__in) => Array ( ) (post_parent__not_in) => Array ( ) (author__in) => Array ( ) (author__not_in) => Array ( ) (facetwp) => 1 (ignore_sticky_posts) => (suppress_filters) => (cache_results) => 1 (update_post_term_cache) => 1 (lazy_load_term_meta) => 1 (update_post_meta_cache) => 1 (nopaging) => (comments_per_page) => 50 (no_found_rows) => ) (tax_query) => WP_Tax_Query Object ( (queries) => Array ( (0) => Array ( (taxonomy) => post_tag (terms) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (field) => term_id (operator) => IN (include_children) => 1 ) ) (relation) => AND (table_aliases:protected) => Array ( (0) => wp_term_relationships ) (queried_terms) => Array ( (post_tag) => Array ( (terms) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (field) => term_id ) ) (primary_table) => wp_posts (primary_id_column) => ID ) (meta_query) => WP_Meta_Query Object ( (queries) => Array ( ) (relation) => (meta_table) => (meta_id_column) => (primary_table) => (primary_id_column) => (table_aliases:protected) => Array ( ) (clauses:protected) => Array ( ) (has_or_relation:protected) => ) (date_query) => (request) => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND wp_posts.ID NOT IN (404) AND ( wp_term_relationships.term_taxonomy_id IN (3,4,40,43,57) ) AND wp_posts.post_type IN ('post', 'podcasts', 'noir_narratives', 'music', 'movies', 'tv_shows', 'books', 'video_games') AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 5 (posts) => Array ( (0) => WP_Post Object ( (ID) => 380 (post_author) => 1 (post_date) => 2020-02-06 04:06:59 (post_date_gmt) => 2020-02-06 04:06:59 (post_content) => (post_title) => 4:44-JAY-Z (post_excerpt) => (post_status) => publish (comment_status) => open (ping_status) => closed (post_password) => (post_name) => 444-jay-z (to_ping) => (pinged) => (post_modified) => 2020-02-06 18:43:19 (post_modified_gmt) => 2020-02-06 18:43:19 (post_content_filtered) => (post_parent) => 0 (guid) => http://theblackco-op.local/music/444-jay-z/ (menu_order) => 0 (post_type) => music (post_mime_type) => (comment_count) => 0 (filter) => raw ) (1) => WP_Post Object ( (ID) => 356 (post_author) => 1 (post_date) => 2020-02-04 20:20:55 (post_date_gmt) => 2020-02-04 20:20:55 (post_content) => The survivors of a plane crash are forced to work together in order to survive on a seemingly deserted tropical island. (post_title) => Lost (post_excerpt) => (post_status) => publish (comment_status) => open (ping_status) => open (post_password) => (post_name) => lost (to_ping) => (pinged) => (post_modified) => 2020-02-04 20:20:56 (post_modified_gmt) => 2020-02-04 20:20:56 (post_content_filtered) => (post_parent) => 0 (guid) => http://theblackco-op.local/tv_shows/lost/ (menu_order) => 0 (post_type) => tv_shows (post_mime_type) => (comment_count) => 0 (filter) => raw ) (2) => WP_Post Object ( (ID) => 358 (post_author) => 1 (post_date) => 2020-02-04 20:19:43 (post_date_gmt) => 2020-02-04 20:19:43 (post_content) =>
Geralt of Rivia, a solitary monster hunter, struggles to find his place in a world where people often prove more wicked than beasts.

(post_title) => The Witcher (post_excerpt) => (post_status) => publish (comment_status) => open (ping_status) => open (post_password) => (post_name) => the-witcher (to_ping) => (pinged) => (post_modified) => 2020-02-04 20:19:44 (post_modified_gmt) => 2020-02-04 20:19:44 (post_content_filtered) => (post_parent) => 0 (guid) => http://theblackco-op.local/tv_shows/the-witcher/ (menu_order) => 0 (post_type) => tv_shows (post_mime_type) => (comment_count) => 0 (filter) => raw ) (3) => WP_Post Object ( (ID) => 353 (post_author) => 1 (post_date) => 2020-02-04 20:00:52 (post_date_gmt) => 2020-02-04 20:00:52 (post_content) => The Guardians struggle to keep together as a team while dealing with their personal family issues, notably Star-Lord's encounter with his father the ambitious celestial being Ego. (post_title) => Guardians of the Galaxy Vol. 2 (post_excerpt) => (post_status) => publish (comment_status) => open (ping_status) => open (post_password) => (post_name) => guardians-of-the-galaxy-vol-2 (to_ping) => (pinged) => (post_modified) => 2020-02-04 20:00:52 (post_modified_gmt) => 2020-02-04 20:00:52 (post_content_filtered) => (post_parent) => 0 (guid) => http://theblackco-op.local/movies/guardians-of-the-galaxy-vol-2/ (menu_order) => 0 (post_type) => movies (post_mime_type) => (comment_count) => 0 (filter) => raw ) ) (post_count) => 4 (current_post) => -1 (in_the_loop) => (post) => WP_Post Object ( (ID) => 380 (post_author) => 1 (post_date) => 2020-02-06 04:06:59 (post_date_gmt) => 2020-02-06 04:06:59 (post_content) => (post_title) => 4:44-JAY-Z (post_excerpt) => (post_status) => publish (comment_status) => open (ping_status) => closed (post_password) => (post_name) => 444-jay-z (to_ping) => (pinged) => (post_modified) => 2020-02-06 18:43:19 (post_modified_gmt) => 2020-02-06 18:43:19 (post_content_filtered) => (post_parent) => 0 (guid) => http://theblackco-op.local/music/444-jay-z/ (menu_order) => 0 (post_type) => music (post_mime_type) => (comment_count) => 0 (filter) => raw ) (comment_count) => 0 (current_comment) => -1 (found_posts) => 4 (max_num_pages) => 1 (max_num_comment_pages) => 0 (is_single) => (is_preview) => (is_page) => (is_archive) => 1 (is_date) => (is_year) => (is_month) => (is_day) => (is_time) => (is_author) => (is_category) => (is_tag) => 1 (is_tax) => (is_search) => (is_feed) => (is_comment_feed) => (is_trackback) => (is_home) => (is_privacy_policy) => (is_404) => (is_embed) => (is_paged) => (is_admin) => (is_attachment) => (is_singular) => (is_robots) => (is_posts_page) => (is_post_type_archive) => (query_vars_hash:WP_Query:private) => 43055e35b5b986cb5937be98872e8d44 (query_vars_changed:WP_Query:private) => 1 (thumbnails_cached) => (stopwords:WP_Query:private) => (compat_fields:WP_Query:private) => Array ( (0) => query_vars_hash (1) => query_vars_changed ) (compat_methods:WP_Query:private) => Array ( (0) => init_query_flags (1) => parse_tax_query ) )

A print_r of $ the_query when logged in as a non-administrative role:

WP_Query Object ( (query) => Array ( (post_type) => Array ( (0) => post (1) => podcasts (2) => noir_narratives (3) => music (4) => movies (5) => tv_shows (6) => books (7) => video_games ) (tag__in) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (post_status) => publish (perm) => readable (post__not_in) => Array ( (0) => 404 ) (orderby) => date (order) => DESC (posts_per_page) => 5 ) (query_vars) => Array ( (post_type) => Array ( (0) => post (1) => podcasts (2) => noir_narratives (3) => music (4) => movies (5) => tv_shows (6) => books (7) => video_games ) (tag__in) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (post_status) => publish (perm) => readable (post__not_in) => Array ( (0) => 404 ) (orderby) => date (order) => DESC (posts_per_page) => 5 (error) => (m) => (p) => 0 (post_parent) => (subpost) => (subpost_id) => (attachment) => (attachment_id) => 0 (name) => (pagename) => (page_id) => 0 (second) => (minute) => (hour) => (day) => 0 (monthnum) => 0 (year) => 0 (w) => 0 (category_name) => (tag) => (cat) => (tag_id) => 57 (author) => (author_name) => (feed) => (tb) => (paged) => 0 (meta_key) => (meta_value) => (preview) => (s) => (sentence) => (title) => (fields) => (menu_order) => (embed) => (category__in) => Array ( ) (category__not_in) => Array ( ) (category__and) => Array ( ) (post__in) => Array ( ) (post_name__in) => Array ( ) (tag__not_in) => Array ( ) (tag__and) => Array ( ) (tag_slug__in) => Array ( ) (tag_slug__and) => Array ( ) (post_parent__in) => Array ( ) (post_parent__not_in) => Array ( ) (author__in) => Array ( ) (author__not_in) => Array ( ) (facetwp) => 1 (ignore_sticky_posts) => (suppress_filters) => (cache_results) => 1 (update_post_term_cache) => 1 (lazy_load_term_meta) => 1 (update_post_meta_cache) => 1 (nopaging) => (comments_per_page) => 50 (no_found_rows) => ) (tax_query) => WP_Tax_Query Object ( (queries) => Array ( (0) => Array ( (taxonomy) => post_tag (terms) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (field) => term_id (operator) => IN (include_children) => 1 ) ) (relation) => AND (table_aliases:protected) => Array ( (0) => wp_term_relationships ) (queried_terms) => Array ( (post_tag) => Array ( (terms) => Array ( (0) => 57 (1) => 3 (2) => 4 (3) => 43 (4) => 40 ) (field) => term_id ) ) (primary_table) => wp_posts (primary_id_column) => ID ) (meta_query) => WP_Meta_Query Object ( (queries) => Array ( ) (relation) => (meta_table) => (meta_id_column) => (primary_table) => (primary_id_column) => (table_aliases:protected) => Array ( ) (clauses:protected) => Array ( ) (has_or_relation:protected) => ) (date_query) => (request) => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( ( wp_posts.post_type = 'post' AND ( 1=1 AND ( ( wp_posts.post_status IN ('publish','acf-disabled') ) OR ( ( wp_posts.post_author = 2 ) AND wp_posts.post_status IN ('private','member','premium','staff') ) ) ) ) OR ( wp_posts.post_type = 'podcasts' AND ( 1=1 AND ( ( wp_posts.post_status IN ('publish','acf-disabled') ) OR ( ( wp_posts.post_author = 2 ) AND wp_posts.post_status IN ('private','member','premium','staff','future') ) ) ) ) OR ( wp_posts.post_type = 'noir_narratives' AND ( 1=1 AND ( ( wp_posts.post_status IN ('publish','acf-disabled') ) OR ( ( wp_posts.post_author = 2 ) AND wp_posts.post_status IN ('private','member','premium','staff','future') ) ) ) ) ) AND wp_posts.ID NOT IN (404) AND ( wp_term_relationships.term_taxonomy_id IN (3,4,40,43,57) ) AND wp_posts.post_type IN ('post', 'podcasts', 'noir_narratives', 'music', 'movies', 'tv_shows', 'books', 'video_games') AND ((wp_posts.post_status IN ('publish','acf-disabled','private','member','premium','staff','future'))) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 5 (posts) => Array ( ) (post_count) => 0 (current_post) => -1 (in_the_loop) => (comment_count) => 0 (current_comment) => -1 (found_posts) => 0 (max_num_pages) => 0 (max_num_comment_pages) => 0 (is_single) => (is_preview) => (is_page) => (is_archive) => 1 (is_date) => (is_year) => (is_month) => (is_day) => (is_time) => (is_author) => (is_category) => (is_tag) => 1 (is_tax) => (is_search) => (is_feed) => (is_comment_feed) => (is_trackback) => (is_home) => (is_privacy_policy) => (is_404) => (is_embed) => (is_paged) => (is_admin) => (is_attachment) => (is_singular) => (is_robots) => (is_posts_page) => (is_post_type_archive) => (query_vars_hash:WP_Query:private) => 84bca5ed2124f0feed338d2b4b82523f (query_vars_changed:WP_Query:private) => 1 (thumbnails_cached) => (stopwords:WP_Query:private) => (compat_fields:WP_Query:private) => Array ( (0) => query_vars_hash (1) => query_vars_changed ) (compat_methods:WP_Query:private) => Array ( (0) => init_query_flags (1) => parse_tax_query ) )