ap_post_have_terms( boolean|integer $post_id = false, string $taxonomy = 'question_category' )
Description #
Check if post have terms of a taxonomy.
Parameters #
- $post_idboolean | integer (Optional) Post ID. Default value: false
- $taxonomystring (Optional) Taxonomy name. Default value: 'question_category'
Source #
File: includes/qaquery.php
function ap_post_have_terms( $post_id = false, $taxonomy = 'question_category' ) { if ( ! $post_id ) { $post_id = get_the_ID(); } $terms = get_the_terms( $post_id, $taxonomy ); if ( ! empty( $terms ) ) { return true; } return false; }
Expand full source code Collapse full source code View on GitHub: includes/qaquery.php:636
Add your comment