Edit File by line
/home/barbar84/www/wp-inclu...
File: template.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Template loading functions.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Template
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Retrieve path to a template
[9] Fix | Delete
*
[10] Fix | Delete
* Used to quickly retrieve the path of a template without including the file
[11] Fix | Delete
* extension. It will also check the parent theme, if the file exists, with
[12] Fix | Delete
* the use of locate_template(). Allows for more generic template location
[13] Fix | Delete
* without the use of the other get_*_template() functions.
[14] Fix | Delete
*
[15] Fix | Delete
* @since 1.5.0
[16] Fix | Delete
*
[17] Fix | Delete
* @param string $type Filename without extension.
[18] Fix | Delete
* @param array $templates An optional list of template candidates
[19] Fix | Delete
* @return string Full path to template file.
[20] Fix | Delete
*/
[21] Fix | Delete
function get_query_template( $type, $templates = array() ) {
[22] Fix | Delete
$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
[23] Fix | Delete
[24] Fix | Delete
if ( empty( $templates ) ) {
[25] Fix | Delete
$templates = array( "{$type}.php" );
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Filters the list of template filenames that are searched for when retrieving a template to use.
[30] Fix | Delete
*
[31] Fix | Delete
* The last element in the array should always be the fallback template for this query type.
[32] Fix | Delete
*
[33] Fix | Delete
* Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date',
[34] Fix | Delete
* 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'.
[35] Fix | Delete
*
[36] Fix | Delete
* @since 4.7.0
[37] Fix | Delete
*
[38] Fix | Delete
* @param array $templates A list of template candidates, in descending order of priority.
[39] Fix | Delete
*/
[40] Fix | Delete
$templates = apply_filters( "{$type}_template_hierarchy", $templates );
[41] Fix | Delete
[42] Fix | Delete
$template = locate_template( $templates );
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Filters the path of the queried template by type.
[46] Fix | Delete
*
[47] Fix | Delete
* The dynamic portion of the hook name, `$type`, refers to the filename -- minus the file
[48] Fix | Delete
* extension and any non-alphanumeric characters delimiting words -- of the file to load.
[49] Fix | Delete
* This hook also applies to various types of files loaded as part of the Template Hierarchy.
[50] Fix | Delete
*
[51] Fix | Delete
* Possible values for `$type` include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date',
[52] Fix | Delete
* 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'.
[53] Fix | Delete
*
[54] Fix | Delete
* @since 1.5.0
[55] Fix | Delete
* @since 4.8.0 The `$type` and `$templates` parameters were added.
[56] Fix | Delete
*
[57] Fix | Delete
* @param string $template Path to the template. See locate_template().
[58] Fix | Delete
* @param string $type Sanitized filename without extension.
[59] Fix | Delete
* @param array $templates A list of template candidates, in descending order of priority.
[60] Fix | Delete
*/
[61] Fix | Delete
return apply_filters( "{$type}_template", $template, $type, $templates );
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Retrieve path of index template in current or parent template.
[66] Fix | Delete
*
[67] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[68] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'index'.
[69] Fix | Delete
*
[70] Fix | Delete
* @since 3.0.0
[71] Fix | Delete
*
[72] Fix | Delete
* @see get_query_template()
[73] Fix | Delete
*
[74] Fix | Delete
* @return string Full path to index template file.
[75] Fix | Delete
*/
[76] Fix | Delete
function get_index_template() {
[77] Fix | Delete
return get_query_template( 'index' );
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
/**
[81] Fix | Delete
* Retrieve path of 404 template in current or parent template.
[82] Fix | Delete
*
[83] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[84] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is '404'.
[85] Fix | Delete
*
[86] Fix | Delete
* @since 1.5.0
[87] Fix | Delete
*
[88] Fix | Delete
* @see get_query_template()
[89] Fix | Delete
*
[90] Fix | Delete
* @return string Full path to 404 template file.
[91] Fix | Delete
*/
[92] Fix | Delete
function get_404_template() {
[93] Fix | Delete
return get_query_template( '404' );
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
/**
[97] Fix | Delete
* Retrieve path of archive template in current or parent template.
[98] Fix | Delete
*
[99] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[100] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'archive'.
[101] Fix | Delete
*
[102] Fix | Delete
* @since 1.5.0
[103] Fix | Delete
*
[104] Fix | Delete
* @see get_query_template()
[105] Fix | Delete
*
[106] Fix | Delete
* @return string Full path to archive template file.
[107] Fix | Delete
*/
[108] Fix | Delete
function get_archive_template() {
[109] Fix | Delete
$post_types = array_filter( (array) get_query_var( 'post_type' ) );
[110] Fix | Delete
[111] Fix | Delete
$templates = array();
[112] Fix | Delete
[113] Fix | Delete
if ( count( $post_types ) == 1 ) {
[114] Fix | Delete
$post_type = reset( $post_types );
[115] Fix | Delete
$templates[] = "archive-{$post_type}.php";
[116] Fix | Delete
}
[117] Fix | Delete
$templates[] = 'archive.php';
[118] Fix | Delete
[119] Fix | Delete
return get_query_template( 'archive', $templates );
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* Retrieve path of post type archive template in current or parent template.
[124] Fix | Delete
*
[125] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[126] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'archive'.
[127] Fix | Delete
*
[128] Fix | Delete
* @since 3.7.0
[129] Fix | Delete
*
[130] Fix | Delete
* @see get_archive_template()
[131] Fix | Delete
*
[132] Fix | Delete
* @return string Full path to archive template file.
[133] Fix | Delete
*/
[134] Fix | Delete
function get_post_type_archive_template() {
[135] Fix | Delete
$post_type = get_query_var( 'post_type' );
[136] Fix | Delete
if ( is_array( $post_type ) ) {
[137] Fix | Delete
$post_type = reset( $post_type );
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
$obj = get_post_type_object( $post_type );
[141] Fix | Delete
if ( ! ( $obj instanceof WP_Post_Type ) || ! $obj->has_archive ) {
[142] Fix | Delete
return '';
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
return get_archive_template();
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
/**
[149] Fix | Delete
* Retrieve path of author template in current or parent template.
[150] Fix | Delete
*
[151] Fix | Delete
* The hierarchy for this template looks like:
[152] Fix | Delete
*
[153] Fix | Delete
* 1. author-{nicename}.php
[154] Fix | Delete
* 2. author-{id}.php
[155] Fix | Delete
* 3. author.php
[156] Fix | Delete
*
[157] Fix | Delete
* An example of this is:
[158] Fix | Delete
*
[159] Fix | Delete
* 1. author-john.php
[160] Fix | Delete
* 2. author-1.php
[161] Fix | Delete
* 3. author.php
[162] Fix | Delete
*
[163] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[164] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'author'.
[165] Fix | Delete
*
[166] Fix | Delete
* @since 1.5.0
[167] Fix | Delete
*
[168] Fix | Delete
* @see get_query_template()
[169] Fix | Delete
*
[170] Fix | Delete
* @return string Full path to author template file.
[171] Fix | Delete
*/
[172] Fix | Delete
function get_author_template() {
[173] Fix | Delete
$author = get_queried_object();
[174] Fix | Delete
[175] Fix | Delete
$templates = array();
[176] Fix | Delete
[177] Fix | Delete
if ( $author instanceof WP_User ) {
[178] Fix | Delete
$templates[] = "author-{$author->user_nicename}.php";
[179] Fix | Delete
$templates[] = "author-{$author->ID}.php";
[180] Fix | Delete
}
[181] Fix | Delete
$templates[] = 'author.php';
[182] Fix | Delete
[183] Fix | Delete
return get_query_template( 'author', $templates );
[184] Fix | Delete
}
[185] Fix | Delete
[186] Fix | Delete
/**
[187] Fix | Delete
* Retrieve path of category template in current or parent template.
[188] Fix | Delete
*
[189] Fix | Delete
* The hierarchy for this template looks like:
[190] Fix | Delete
*
[191] Fix | Delete
* 1. category-{slug}.php
[192] Fix | Delete
* 2. category-{id}.php
[193] Fix | Delete
* 3. category.php
[194] Fix | Delete
*
[195] Fix | Delete
* An example of this is:
[196] Fix | Delete
*
[197] Fix | Delete
* 1. category-news.php
[198] Fix | Delete
* 2. category-2.php
[199] Fix | Delete
* 3. category.php
[200] Fix | Delete
*
[201] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[202] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'category'.
[203] Fix | Delete
*
[204] Fix | Delete
* @since 1.5.0
[205] Fix | Delete
* @since 4.7.0 The decoded form of `category-{slug}.php` was added to the top of the
[206] Fix | Delete
* template hierarchy when the category slug contains multibyte characters.
[207] Fix | Delete
*
[208] Fix | Delete
* @see get_query_template()
[209] Fix | Delete
*
[210] Fix | Delete
* @return string Full path to category template file.
[211] Fix | Delete
*/
[212] Fix | Delete
function get_category_template() {
[213] Fix | Delete
$category = get_queried_object();
[214] Fix | Delete
[215] Fix | Delete
$templates = array();
[216] Fix | Delete
[217] Fix | Delete
if ( ! empty( $category->slug ) ) {
[218] Fix | Delete
[219] Fix | Delete
$slug_decoded = urldecode( $category->slug );
[220] Fix | Delete
if ( $slug_decoded !== $category->slug ) {
[221] Fix | Delete
$templates[] = "category-{$slug_decoded}.php";
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
$templates[] = "category-{$category->slug}.php";
[225] Fix | Delete
$templates[] = "category-{$category->term_id}.php";
[226] Fix | Delete
}
[227] Fix | Delete
$templates[] = 'category.php';
[228] Fix | Delete
[229] Fix | Delete
return get_query_template( 'category', $templates );
[230] Fix | Delete
}
[231] Fix | Delete
[232] Fix | Delete
/**
[233] Fix | Delete
* Retrieve path of tag template in current or parent template.
[234] Fix | Delete
*
[235] Fix | Delete
* The hierarchy for this template looks like:
[236] Fix | Delete
*
[237] Fix | Delete
* 1. tag-{slug}.php
[238] Fix | Delete
* 2. tag-{id}.php
[239] Fix | Delete
* 3. tag.php
[240] Fix | Delete
*
[241] Fix | Delete
* An example of this is:
[242] Fix | Delete
*
[243] Fix | Delete
* 1. tag-wordpress.php
[244] Fix | Delete
* 2. tag-3.php
[245] Fix | Delete
* 3. tag.php
[246] Fix | Delete
*
[247] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[248] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'tag'.
[249] Fix | Delete
*
[250] Fix | Delete
* @since 2.3.0
[251] Fix | Delete
* @since 4.7.0 The decoded form of `tag-{slug}.php` was added to the top of the
[252] Fix | Delete
* template hierarchy when the tag slug contains multibyte characters.
[253] Fix | Delete
*
[254] Fix | Delete
* @see get_query_template()
[255] Fix | Delete
*
[256] Fix | Delete
* @return string Full path to tag template file.
[257] Fix | Delete
*/
[258] Fix | Delete
function get_tag_template() {
[259] Fix | Delete
$tag = get_queried_object();
[260] Fix | Delete
[261] Fix | Delete
$templates = array();
[262] Fix | Delete
[263] Fix | Delete
if ( ! empty( $tag->slug ) ) {
[264] Fix | Delete
[265] Fix | Delete
$slug_decoded = urldecode( $tag->slug );
[266] Fix | Delete
if ( $slug_decoded !== $tag->slug ) {
[267] Fix | Delete
$templates[] = "tag-{$slug_decoded}.php";
[268] Fix | Delete
}
[269] Fix | Delete
[270] Fix | Delete
$templates[] = "tag-{$tag->slug}.php";
[271] Fix | Delete
$templates[] = "tag-{$tag->term_id}.php";
[272] Fix | Delete
}
[273] Fix | Delete
$templates[] = 'tag.php';
[274] Fix | Delete
[275] Fix | Delete
return get_query_template( 'tag', $templates );
[276] Fix | Delete
}
[277] Fix | Delete
[278] Fix | Delete
/**
[279] Fix | Delete
* Retrieve path of custom taxonomy term template in current or parent template.
[280] Fix | Delete
*
[281] Fix | Delete
* The hierarchy for this template looks like:
[282] Fix | Delete
*
[283] Fix | Delete
* 1. taxonomy-{taxonomy_slug}-{term_slug}.php
[284] Fix | Delete
* 2. taxonomy-{taxonomy_slug}.php
[285] Fix | Delete
* 3. taxonomy.php
[286] Fix | Delete
*
[287] Fix | Delete
* An example of this is:
[288] Fix | Delete
*
[289] Fix | Delete
* 1. taxonomy-location-texas.php
[290] Fix | Delete
* 2. taxonomy-location.php
[291] Fix | Delete
* 3. taxonomy.php
[292] Fix | Delete
*
[293] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[294] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'taxonomy'.
[295] Fix | Delete
*
[296] Fix | Delete
* @since 2.5.0
[297] Fix | Delete
* @since 4.7.0 The decoded form of `taxonomy-{taxonomy_slug}-{term_slug}.php` was added to the top of the
[298] Fix | Delete
* template hierarchy when the term slug contains multibyte characters.
[299] Fix | Delete
*
[300] Fix | Delete
* @see get_query_template()
[301] Fix | Delete
*
[302] Fix | Delete
* @return string Full path to custom taxonomy term template file.
[303] Fix | Delete
*/
[304] Fix | Delete
function get_taxonomy_template() {
[305] Fix | Delete
$term = get_queried_object();
[306] Fix | Delete
[307] Fix | Delete
$templates = array();
[308] Fix | Delete
[309] Fix | Delete
if ( ! empty( $term->slug ) ) {
[310] Fix | Delete
$taxonomy = $term->taxonomy;
[311] Fix | Delete
[312] Fix | Delete
$slug_decoded = urldecode( $term->slug );
[313] Fix | Delete
if ( $slug_decoded !== $term->slug ) {
[314] Fix | Delete
$templates[] = "taxonomy-$taxonomy-{$slug_decoded}.php";
[315] Fix | Delete
}
[316] Fix | Delete
[317] Fix | Delete
$templates[] = "taxonomy-$taxonomy-{$term->slug}.php";
[318] Fix | Delete
$templates[] = "taxonomy-$taxonomy.php";
[319] Fix | Delete
}
[320] Fix | Delete
$templates[] = 'taxonomy.php';
[321] Fix | Delete
[322] Fix | Delete
return get_query_template( 'taxonomy', $templates );
[323] Fix | Delete
}
[324] Fix | Delete
[325] Fix | Delete
/**
[326] Fix | Delete
* Retrieve path of date template in current or parent template.
[327] Fix | Delete
*
[328] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[329] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'date'.
[330] Fix | Delete
*
[331] Fix | Delete
* @since 1.5.0
[332] Fix | Delete
*
[333] Fix | Delete
* @see get_query_template()
[334] Fix | Delete
*
[335] Fix | Delete
* @return string Full path to date template file.
[336] Fix | Delete
*/
[337] Fix | Delete
function get_date_template() {
[338] Fix | Delete
return get_query_template( 'date' );
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
/**
[342] Fix | Delete
* Retrieve path of home template in current or parent template.
[343] Fix | Delete
*
[344] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[345] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'home'.
[346] Fix | Delete
*
[347] Fix | Delete
* @since 1.5.0
[348] Fix | Delete
*
[349] Fix | Delete
* @see get_query_template()
[350] Fix | Delete
*
[351] Fix | Delete
* @return string Full path to home template file.
[352] Fix | Delete
*/
[353] Fix | Delete
function get_home_template() {
[354] Fix | Delete
$templates = array( 'home.php', 'index.php' );
[355] Fix | Delete
[356] Fix | Delete
return get_query_template( 'home', $templates );
[357] Fix | Delete
}
[358] Fix | Delete
[359] Fix | Delete
/**
[360] Fix | Delete
* Retrieve path of front page template in current or parent template.
[361] Fix | Delete
*
[362] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[363] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'frontpage'.
[364] Fix | Delete
*
[365] Fix | Delete
* @since 3.0.0
[366] Fix | Delete
*
[367] Fix | Delete
* @see get_query_template()
[368] Fix | Delete
*
[369] Fix | Delete
* @return string Full path to front page template file.
[370] Fix | Delete
*/
[371] Fix | Delete
function get_front_page_template() {
[372] Fix | Delete
$templates = array( 'front-page.php' );
[373] Fix | Delete
[374] Fix | Delete
return get_query_template( 'frontpage', $templates );
[375] Fix | Delete
}
[376] Fix | Delete
[377] Fix | Delete
/**
[378] Fix | Delete
* Retrieve path of Privacy Policy page template in current or parent template.
[379] Fix | Delete
*
[380] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[381] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'privacypolicy'.
[382] Fix | Delete
*
[383] Fix | Delete
* @since 5.2.0
[384] Fix | Delete
*
[385] Fix | Delete
* @see get_query_template()
[386] Fix | Delete
*
[387] Fix | Delete
* @return string Full path to privacy policy template file.
[388] Fix | Delete
*/
[389] Fix | Delete
function get_privacy_policy_template() {
[390] Fix | Delete
$templates = array( 'privacy-policy.php' );
[391] Fix | Delete
[392] Fix | Delete
return get_query_template( 'privacypolicy', $templates );
[393] Fix | Delete
}
[394] Fix | Delete
[395] Fix | Delete
/**
[396] Fix | Delete
* Retrieve path of page template in current or parent template.
[397] Fix | Delete
*
[398] Fix | Delete
* The hierarchy for this template looks like:
[399] Fix | Delete
*
[400] Fix | Delete
* 1. {Page Template}.php
[401] Fix | Delete
* 2. page-{page_name}.php
[402] Fix | Delete
* 3. page-{id}.php
[403] Fix | Delete
* 4. page.php
[404] Fix | Delete
*
[405] Fix | Delete
* An example of this is:
[406] Fix | Delete
*
[407] Fix | Delete
* 1. page-templates/full-width.php
[408] Fix | Delete
* 2. page-about.php
[409] Fix | Delete
* 3. page-4.php
[410] Fix | Delete
* 4. page.php
[411] Fix | Delete
*
[412] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[413] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'page'.
[414] Fix | Delete
*
[415] Fix | Delete
* @since 1.5.0
[416] Fix | Delete
* @since 4.7.0 The decoded form of `page-{page_name}.php` was added to the top of the
[417] Fix | Delete
* template hierarchy when the page name contains multibyte characters.
[418] Fix | Delete
*
[419] Fix | Delete
* @see get_query_template()
[420] Fix | Delete
*
[421] Fix | Delete
* @return string Full path to page template file.
[422] Fix | Delete
*/
[423] Fix | Delete
function get_page_template() {
[424] Fix | Delete
$id = get_queried_object_id();
[425] Fix | Delete
$template = get_page_template_slug();
[426] Fix | Delete
$pagename = get_query_var( 'pagename' );
[427] Fix | Delete
[428] Fix | Delete
if ( ! $pagename && $id ) {
[429] Fix | Delete
// If a static page is set as the front page, $pagename will not be set.
[430] Fix | Delete
// Retrieve it from the queried object.
[431] Fix | Delete
$post = get_queried_object();
[432] Fix | Delete
if ( $post ) {
[433] Fix | Delete
$pagename = $post->post_name;
[434] Fix | Delete
}
[435] Fix | Delete
}
[436] Fix | Delete
[437] Fix | Delete
$templates = array();
[438] Fix | Delete
if ( $template && 0 === validate_file( $template ) ) {
[439] Fix | Delete
$templates[] = $template;
[440] Fix | Delete
}
[441] Fix | Delete
if ( $pagename ) {
[442] Fix | Delete
$pagename_decoded = urldecode( $pagename );
[443] Fix | Delete
if ( $pagename_decoded !== $pagename ) {
[444] Fix | Delete
$templates[] = "page-{$pagename_decoded}.php";
[445] Fix | Delete
}
[446] Fix | Delete
$templates[] = "page-{$pagename}.php";
[447] Fix | Delete
}
[448] Fix | Delete
if ( $id ) {
[449] Fix | Delete
$templates[] = "page-{$id}.php";
[450] Fix | Delete
}
[451] Fix | Delete
$templates[] = 'page.php';
[452] Fix | Delete
[453] Fix | Delete
return get_query_template( 'page', $templates );
[454] Fix | Delete
}
[455] Fix | Delete
[456] Fix | Delete
/**
[457] Fix | Delete
* Retrieve path of search template in current or parent template.
[458] Fix | Delete
*
[459] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[460] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'search'.
[461] Fix | Delete
*
[462] Fix | Delete
* @since 1.5.0
[463] Fix | Delete
*
[464] Fix | Delete
* @see get_query_template()
[465] Fix | Delete
*
[466] Fix | Delete
* @return string Full path to search template file.
[467] Fix | Delete
*/
[468] Fix | Delete
function get_search_template() {
[469] Fix | Delete
return get_query_template( 'search' );
[470] Fix | Delete
}
[471] Fix | Delete
[472] Fix | Delete
/**
[473] Fix | Delete
* Retrieve path of single template in current or parent template. Applies to single Posts,
[474] Fix | Delete
* single Attachments, and single custom post types.
[475] Fix | Delete
*
[476] Fix | Delete
* The hierarchy for this template looks like:
[477] Fix | Delete
*
[478] Fix | Delete
* 1. {Post Type Template}.php
[479] Fix | Delete
* 2. single-{post_type}-{post_name}.php
[480] Fix | Delete
* 3. single-{post_type}.php
[481] Fix | Delete
* 4. single.php
[482] Fix | Delete
*
[483] Fix | Delete
* An example of this is:
[484] Fix | Delete
*
[485] Fix | Delete
* 1. templates/full-width.php
[486] Fix | Delete
* 2. single-post-hello-world.php
[487] Fix | Delete
* 3. single-post.php
[488] Fix | Delete
* 4. single.php
[489] Fix | Delete
*
[490] Fix | Delete
* The template hierarchy and template path are filterable via the {@see '$type_template_hierarchy'}
[491] Fix | Delete
* and {@see '$type_template'} dynamic hooks, where `$type` is 'single'.
[492] Fix | Delete
*
[493] Fix | Delete
* @since 1.5.0
[494] Fix | Delete
* @since 4.4.0 `single-{post_type}-{post_name}.php` was added to the top of the template hierarchy.
[495] Fix | Delete
* @since 4.7.0 The decoded form of `single-{post_type}-{post_name}.php` was added to the top of the
[496] Fix | Delete
* template hierarchy when the post name contains multibyte characters.
[497] Fix | Delete
* @since 4.7.0 `{Post Type Template}.php` was added to the top of the template hierarchy.
[498] Fix | Delete
*
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function