WP_Widget_Tag_Cloud::_get_current_taxonomy()publicWP 4.4.0

Retrieves the taxonomy for the current Tag cloud widget instance.

Method of the class: WP_Widget_Tag_Cloud{}

No Hooks.

Return

String. Name of the current taxonomy if set, otherwise 'post_tag'.

Usage

$WP_Widget_Tag_Cloud = new WP_Widget_Tag_Cloud();
$WP_Widget_Tag_Cloud->_get_current_taxonomy( $instance );
$instance(array) (required)
Current settings.

Changelog

Since 4.4.0 Introduced.

WP_Widget_Tag_Cloud::_get_current_taxonomy() code WP 6.1.1

public function _get_current_taxonomy( $instance ) {
	if ( ! empty( $instance['taxonomy'] ) && taxonomy_exists( $instance['taxonomy'] ) ) {
		return $instance['taxonomy'];
	}

	return 'post_tag';
}