Site icon Hip-Hop Website Design and Development

WP_Query outputs wrong post in custom post type

So I’m working directly in the Admin Dashboard of my website, below I will explain what I’m attempting to achieve and what issues I’m getting.

Here is the code:

add_action('admin_head', 'set_scheduled_today_tag', 99);
function set_scheduled_today_tag() {
    $query = new WP_Query([
        'post_type' => 'wp_events',
        'post_status' => ['schedule'],
        'posts_per_page' => -1
    ]);
    if ($query->have_posts()):
        while ($query->have_posts()):
            $query->the_post();
            $post_date = get_the_date('Y/m/d', get_the_ID());
            $current_date = date('Y/m/d');
            if ($post_date === $current_date) {
                wp_set_post_terms(get_the_ID(), 'Today', 'event_tag', true);
            }
        endwhile;
    endif;
    wp_reset_postdata();

    echo '<style>
            .event_tag-checked {
                background-color: lightblue!important;
            }
            .event_tag-today {
                background-color: #90EE90!important;
            }
          </style>';
}

Here is what I’ve completed:

Here is the issue:

Before this implementation, I had no problems, but now when I click into a specific post, I get a different post that displays.

Questions:

All help will be appreciated!