A_Z_Listing::get_the_listing()

Return the index list HTML created by a theme template


Description


Return

(string) The index list HTML.


Source

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

	public function get_the_listing() {
		if ( 'taxonomy' === $this->type ) {
			$section = $this->taxonomy;
		} else {
			$section = self::get_section();
			if ( $section instanceof WP_Post ) {
				$section = $section->post_name;
			}
		}

		ob_start();
		$template = locate_template( array( 'a-z-listing-' . $section . '.php', 'a-z-listing.php' ) );
		if ( $template ) {
			$this->do_template( $template );
		} else {
			$this->do_template( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'a-z-listing.php' );
		}
		$r = ob_get_clean();

		wp_reset_postdata();

		return $r;
	}

Changelog

Changelog
VersionDescription
0.7Introduced.

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.