get_query_template

Definition:
function get_query_template( $type, $templates = array() {}

Retrieve path to a template
Used to quickly retrieve the path of a template without including the file extension. It will also check the parent theme, if the file exists, with the use of locate_template(). Allows for more generic template location without the use of the other get_*_template() functions.

Parameters

  • string $type: Filename without extension.
  • array $templates: An optional list of template candidates

Return values

returns:Full path to file.

Source code

function get_query_template( $type, $templates = array() ) {

	$type = preg_replace( '|[^a-z0-9-]+|', '', $type );



	if ( empty( $templates ) )

		$templates = array("{$type}.php");

1653

No comments yet... Be the first to leave a reply!

Leave a comment