A_Z_Listing::get_the_item_post_count()

Retrieve the number of posts assigned to the current term


Description


Return

(int) The number of posts


Source

File: classes/class-a-z-listing.php

	function get_the_item_post_count() {
		if ( 'terms' === $this->type ) {
			if ( is_string( $this->current_item['item'] ) ) {
				$item = explode( ':', $this->current_item['item'], 2 );
				$term = get_term( $item[1] );
				return $term->count;
			} elseif ( is_a( $this->current_item['item'], 'WP_Term' ) ) {
				$term = get_term( $this->current_item['item'] );
				return $term->count;
			} else {
				return 0;
			}
		} else {
			return 0;
		}
	}

Changelog

Changelog
Version Description
2.2.0 Introduced.

More Information

You are currently logged out. To view tickets you must first login.

I have read and understood the Terms of Service


User Contributed Notes

Leave a Reply

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