diff --git src/wp-includes/template.php src/wp-includes/template.php
index 2a03a99..dc615b8 100644
|
|
|
function get_post_type_archive_template() { |
| 144 | 144 | /** |
| 145 | 145 | * Retrieve path of author template in current or parent template. |
| 146 | 146 | * |
| | 147 | * The hierarchy for this template looks like: |
| | 148 | * |
| | 149 | * 1. author-{nicename}.php |
| | 150 | * 2. author-{id}.php |
| | 151 | * 3. author.php |
| | 152 | * |
| | 153 | * An example of this is: |
| | 154 | * |
| | 155 | * 1. author-john.php |
| | 156 | * 2. author-1.php |
| | 157 | * 3. author.php |
| | 158 | * |
| 147 | 159 | * The template hierarchy is filterable via the {@see 'author_template_hierarchy'} hook. |
| 148 | 160 | * The template path is filterable via the {@see 'author_template'} hook. |
| 149 | 161 | * |
| … |
… |
function get_author_template() { |
| 170 | 182 | /** |
| 171 | 183 | * Retrieve path of category template in current or parent template. |
| 172 | 184 | * |
| 173 | | * Works by first retrieving the current slug, for example 'category-default.php', |
| 174 | | * and then trying category ID, for example 'category-1.php', and will finally fall |
| 175 | | * back to category.php template, if those files don't exist. |
| | 185 | * The hierarchy for this template looks like: |
| | 186 | * |
| | 187 | * 1. category-{slug}.php |
| | 188 | * 2. category-{id}.php |
| | 189 | * 3. category.php |
| | 190 | * |
| | 191 | * An example of this is: |
| | 192 | * |
| | 193 | * 1. category-news.php |
| | 194 | * 2. category-2.php |
| | 195 | * 3. category.php |
| 176 | 196 | * |
| 177 | 197 | * The template hierarchy is filterable via the {@see 'category_template_hierarchy'} hook. |
| 178 | 198 | * The template path is filterable via the {@see 'category_template'} hook. |
| 179 | 199 | * |
| 180 | 200 | * @since 1.5.0 |
| | 201 | * @since 4.7.0 The decoded form of `category-{slug}.php` was added to the top of the |
| | 202 | * template hierarchy when the category slug contains multibyte characters. |
| 181 | 203 | * |
| 182 | 204 | * @see get_query_template() |
| 183 | 205 | * |
| … |
… |
function get_category_template() { |
| 206 | 228 | /** |
| 207 | 229 | * Retrieve path of tag template in current or parent template. |
| 208 | 230 | * |
| 209 | | * Works by first retrieving the current tag name, for example 'tag-wordpress.php', |
| 210 | | * and then trying tag ID, for example 'tag-1.php', and will finally fall back to |
| 211 | | * tag.php template, if those files don't exist. |
| | 231 | * The hierarchy for this template looks like: |
| | 232 | * |
| | 233 | * 1. tag-{slug}.php |
| | 234 | * 2. tag-{id}.php |
| | 235 | * 3. tag.php |
| | 236 | * |
| | 237 | * An example of this is: |
| | 238 | * |
| | 239 | * 1. tag-wordpress.php |
| | 240 | * 2. tag-3.php |
| | 241 | * 3. tag.php |
| 212 | 242 | * |
| 213 | 243 | * The template hierarchy is filterable via the {@see 'tag_template_hierarchy'} hook. |
| 214 | 244 | * The template path is filterable via the {@see 'tag_template'} hook. |
| 215 | 245 | * |
| 216 | 246 | * @since 2.3.0 |
| | 247 | * @since 4.7.0 The decoded form of `tag-{slug}.php` was added to the top of the |
| | 248 | * template hierarchy when the tag slug contains multibyte characters. |
| 217 | 249 | * |
| 218 | 250 | * @see get_query_template() |
| 219 | 251 | * |
| … |
… |
function get_tag_template() { |
| 240 | 272 | } |
| 241 | 273 | |
| 242 | 274 | /** |
| 243 | | * Retrieve path of taxonomy template in current or parent template. |
| | 275 | * Retrieve path of custom taxonomy term template in current or parent template. |
| 244 | 276 | * |
| 245 | | * Retrieves the taxonomy and term, if term is available. The template is |
| 246 | | * prepended with 'taxonomy-' and followed by both the taxonomy string and |
| 247 | | * the taxonomy string followed by a dash and then followed by the term. |
| | 277 | * The hierarchy for this template looks like: |
| 248 | 278 | * |
| 249 | | * The taxonomy and term template is checked and used first, if it exists. |
| 250 | | * Second, just the taxonomy template is checked, and then finally, taxonomy.php |
| 251 | | * template is used. If none of the files exist, then it will fall back on to |
| 252 | | * index.php. |
| | 279 | * 1. taxonomy-{taxonomy_slug}-{term_slug}.php |
| | 280 | * 2. taxonomy-{taxonomy_slug}.php |
| | 281 | * 3. taxonomy.php |
| | 282 | * |
| | 283 | * An example of this is: |
| | 284 | * |
| | 285 | * 1. taxonomy-location-texas.php |
| | 286 | * 2. taxonomy-location.php |
| | 287 | * 3. taxonomy.php |
| 253 | 288 | * |
| 254 | 289 | * The template hierarchy is filterable via the {@see 'taxonomy_template_hierarchy'} hook. |
| 255 | 290 | * The template path is filterable via the {@see 'taxonomy_template'} hook. |
| 256 | 291 | * |
| 257 | 292 | * @since 2.5.0 |
| | 293 | * @since 4.7.0 The decoded form of `taxonomy-{taxonomy_slug}-{term_slug}.php` was added to the top of the |
| | 294 | * template hierarchy when the term slug contains multibyte characters. |
| 258 | 295 | * |
| 259 | 296 | * @see get_query_template() |
| 260 | 297 | * |
| 261 | | * @return string Full path to taxonomy template file. |
| | 298 | * @return string Full path to custom taxonomy term template file. |
| 262 | 299 | */ |
| 263 | 300 | function get_taxonomy_template() { |
| 264 | 301 | $term = get_queried_object(); |
| … |
… |
function get_date_template() { |
| 300 | 337 | /** |
| 301 | 338 | * Retrieve path of home template in current or parent template. |
| 302 | 339 | * |
| 303 | | * This is the template used for the page containing the blog posts. |
| 304 | | * Attempts to locate 'home.php' first before falling back to 'index.php'. |
| 305 | | * |
| 306 | 340 | * The template hierarchy is filterable via the {@see 'home_template_hierarchy'} hook. |
| 307 | 341 | * The template path is filterable via the {@see 'home_template'} hook. |
| 308 | 342 | * |
| … |
… |
function get_front_page_template() { |
| 339 | 373 | /** |
| 340 | 374 | * Retrieve path of page template in current or parent template. |
| 341 | 375 | * |
| 342 | | * Will first look for the specifically assigned page template. |
| 343 | | * Then will search for 'page-{slug}.php', followed by 'page-{id}.php', |
| 344 | | * and finally 'page.php'. |
| | 376 | * The hierarchy for this template looks like: |
| | 377 | * |
| | 378 | * 1. {page-template}.php |
| | 379 | * 2. page-{page_name}.php |
| | 380 | * 3. page-{id}.php |
| | 381 | * 4. page.php |
| | 382 | * |
| | 383 | * An example of this is: |
| | 384 | * |
| | 385 | * 1. page-templates/full-width.php |
| | 386 | * 2. page-about.php |
| | 387 | * 3. page-4.php |
| | 388 | * 4. page.php |
| 345 | 389 | * |
| 346 | 390 | * The template hierarchy is filterable via the {@see 'page_template_hierarchy'} hook. |
| 347 | 391 | * The template path is filterable via the {@see 'page_template'} hook. |
| 348 | 392 | * |
| 349 | 393 | * @since 1.5.0 |
| | 394 | * @since 4.7.0 The decoded form of `page-{page_name}.php` was added to the top of the |
| | 395 | * template hierarchy when the page name contains multibyte characters. |
| 350 | 396 | * |
| 351 | 397 | * @see get_query_template() |
| 352 | 398 | * |
| … |
… |
function get_search_template() { |
| 400 | 446 | /** |
| 401 | 447 | * Retrieve path of single template in current or parent template. |
| 402 | 448 | * |
| | 449 | * The hierarchy for this template looks like: |
| | 450 | * |
| | 451 | * 1. single-{post_type}-{post_name}.php |
| | 452 | * 2. single-{post_type}.php |
| | 453 | * 3. single.php |
| | 454 | * |
| | 455 | * An example of this is: |
| | 456 | * |
| | 457 | * 1. single-post-hello-world.php |
| | 458 | * 2. single-post.php |
| | 459 | * 3. single.php |
| | 460 | * |
| 403 | 461 | * The template hierarchy is filterable via the {@see 'single_template_hierarchy'} hook. |
| 404 | 462 | * The template path is filterable via the {@see 'single_template'} hook. |
| 405 | 463 | * |
| 406 | 464 | * @since 1.5.0 |
| 407 | 465 | * @since 4.4.0 `single-{post_type}-{post_name}.php` was added to the top of the template hierarchy. |
| | 466 | * @since 4.7.0 The decoded form of `single-{post_type}-{post_name}.php` was added to the top of the |
| | 467 | * template hierarchy when the post name contains multibyte characters. |
| 408 | 468 | * |
| 409 | 469 | * @see get_query_template() |
| 410 | 470 | * |
| … |
… |
function get_single_template() { |
| 434 | 494 | /** |
| 435 | 495 | * Retrieves an embed template path in the current or parent template. |
| 436 | 496 | * |
| 437 | | * By default the WordPress-template is returned. |
| | 497 | * The hierarchy for this template looks like: |
| | 498 | * |
| | 499 | * 1. embed-{post_type}-{post_format}.php |
| | 500 | * 2. embed-{post_type}.php |
| | 501 | * 3. embed.php |
| | 502 | * |
| | 503 | * An example of this is: |
| | 504 | * |
| | 505 | * 1. embed-post-audio.php |
| | 506 | * 2. embed-post.php |
| | 507 | * 3. embed.php |
| 438 | 508 | * |
| 439 | 509 | * The template hierarchy is filterable via the {@see 'embed_template_hierarchy'} hook. |
| 440 | 510 | * The template path is filterable via the {@see 'embed_template'} hook. |
| … |
… |
function get_singular_template() { |
| 482 | 552 | /** |
| 483 | 553 | * Retrieve path of attachment template in current or parent template. |
| 484 | 554 | * |
| 485 | | * The attachment path first checks if the first part of the mime type exists. |
| 486 | | * The second check is for the second part of the mime type. The last check is |
| 487 | | * for both types separated by an underscore. If neither are found then the file |
| 488 | | * 'attachment.php' is checked and returned. |
| | 555 | * The hierarchy for this template looks like: |
| 489 | 556 | * |
| 490 | | * Some examples for the 'text/plain' mime type are 'text.php', 'plain.php', and |
| 491 | | * finally 'text-plain.php'. |
| | 557 | * 1. {mime_type}-{sub_type}.php |
| | 558 | * 2. {sub_type}.php |
| | 559 | * 3. {mime_type}.php |
| | 560 | * 4. attachment.php |
| | 561 | * |
| | 562 | * An example of this is: |
| | 563 | * |
| | 564 | * 1. image-jpeg.php |
| | 565 | * 2. jpeg.php |
| | 566 | * 3. image.php |
| | 567 | * 4. attachment.php |
| 492 | 568 | * |
| 493 | 569 | * The template hierarchy is filterable via the {@see 'attachment_template_hierarchy'} hook. |
| 494 | 570 | * The template path is filterable via the {@see 'attachment_template'} hook. |
| 495 | 571 | * |
| 496 | 572 | * @since 2.0.0 |
| | 573 | * @since 4.3.0 The order of the mime type logic was reversed so the hierarchy is more logical. |
| 497 | 574 | * |
| 498 | 575 | * @see get_query_template() |
| 499 | 576 | * |
| … |
… |
function load_template( $_template_file, $require_once = true ) { |
| 601 | 678 | require( $_template_file ); |
| 602 | 679 | } |
| 603 | 680 | } |
| 604 | | |