is_term_publicly_viewable( int|WP_Term $term ): bool

Determines whether a term is publicly viewable.

Description

A term is considered publicly viewable if its taxonomy is viewable.

Parameters

$termint|WP_Termrequired
Term ID or term object.

Return

bool Whether the term is publicly viewable.

Source

function is_term_publicly_viewable( $term ) {
	$term = get_term( $term );

	if ( ! $term ) {
		return false;
	}

	return is_taxonomy_viewable( $term->taxonomy );
}

Changelog

VersionDescription
6.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.