The 3rd parameter of has_term()
accepts a WP_Post or Post ID. Docs on has_term()
. In your example code, it would look like this:
<?php $postid = $_GET['post_id'];
if( has_term( 'campaign', 'type', $postid ) ): ?>
//Do something
<?php endif; ?>
Where campaign
would be the term, type
would be the taxonomy, and $postid
is the post that may have the campaign
term.