Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_query_template [ WordPress Function ]

get_query_template ( $type, $templates = array() )
Parameters:
  • (string) $type Filename without extension.
  • (array) $templates An optional list of template candidates
Returns:
  • (string) Full path to file.
Defined at:



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 {@link locate_template()}. Allows for more generic template location without the use of the other get_*_template() functions.

Source


<?php
function get_query_template$type$templates = array() ) {
    
$type preg_replace'|[^a-z0-9-]+|'''$type );

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

    return 
apply_filters"{$type}_template"locate_template$templates ) );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics