ap_question_have_category( false|int $post_id = false )

Description #

Check if question have category.

Parameters #

  • $post_id
    false | int (Optional) Question id. Default value: false

Source #

File: includes/taxo.php

function ap_question_have_category( $post_id = false ) {
	if ( ! $post_id ) {
		$post_id = get_the_ID();
	}

	$categories = get_the_terms( $post_id, 'question_category' );
	if ( ! empty( $categories ) ) {
		return true;
	}

	return false;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment