WPSEO_Utils::display_taxonomy_metabox()protected staticYoast 1.0

Determine whether or not the metabox should be displayed for a taxonomy.

Метод класса: WPSEO_Utils{}

Хуков нет.

Возвращает

true|false. Whether or not the metabox should be displayed.

Использование

$result = WPSEO_Utils::display_taxonomy_metabox( $taxonomy );
$taxonomy(строка|null)
The post type to check the visibility of the metabox for.
По умолчанию: null

Код WPSEO_Utils::display_taxonomy_metabox() Yoast 22.4

protected static function display_taxonomy_metabox( $taxonomy = null ) {
	if ( ! isset( $taxonomy ) || ! in_array( $taxonomy, get_taxonomies( [ 'public' => true ], 'names' ), true ) ) {
		return false;
	}

	return WPSEO_Options::get( 'display-metabox-tax-' . $taxonomy );
}