Make WordPress Core

Changeset 26906


Ignore:
Timestamp:
01/05/2014 05:54:07 PM (11 years ago)
Author:
DrewAPicture
Message:

Inline documentation improvements for get_*_template() functions in wp-includes/template.php.

  • Adds @see references for get_query_template() or similar
  • Adds complete @return descriptions
  • Clarifies which dynamic hooks can be used to filter specific template types

Props UmeshSingla for the initial patches. Props SergeyBiryukov, DrewAPicture.
Fixes #26742.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/template.php

    r25991 r26906  
    1919 * @param string $type Filename without extension.
    2020 * @param array $templates An optional list of template candidates
    21  * @return string Full path to file.
     21 * @return string Full path to template file.
    2222 */
    2323function get_query_template( $type, $templates = array() ) {
     
    4545 * Retrieve path of index template in current or parent template.
    4646 *
     47 * The template path is filterable via the 'index_template' hook.
     48 *
    4749 * @since 3.0.0
    4850 *
    49  * @return string
     51 * @see get_query_template()
     52 *
     53 * @return string Full path to index template file.
    5054 */
    5155function get_index_template() {
     
    5660 * Retrieve path of 404 template in current or parent template.
    5761 *
    58  * @since 1.5.0
    59  *
    60  * @return string
     62 * The template path is filterable via the '404_template' hook.
     63 *
     64 * @since 1.5.0
     65 *
     66 * @see get_query_template()
     67 *
     68 * @return string Full path to 404 template file.
    6169 */
    6270function get_404_template() {
     
    6775 * Retrieve path of archive template in current or parent template.
    6876 *
    69  * @since 1.5.0
    70  *
    71  * @return string
     77 * The template path is filterable via the 'archive_template' hook.
     78 *
     79 * @since 1.5.0
     80 *
     81 * @see get_query_template()
     82 *
     83 * @return string Full path to archive template file.
    7284 */
    7385function get_archive_template() {
     
    88100 * Retrieve path of post type archive template in current or parent template.
    89101 *
     102 * The template path is filterable via the 'archive_template' hook.
     103 *
    90104 * @since 3.7.0
    91105 *
    92  * @return string
     106 * @see get_archive_template()
     107 *
     108 * @return string Full path to archive template file.
    93109 */
    94110function get_post_type_archive_template() {
     
    107123 * Retrieve path of author template in current or parent template.
    108124 *
    109  * @since 1.5.0
    110  *
    111  * @return string
     125 * The template path is filterable via the 'author_template' hook.
     126 *
     127 * @since 1.5.0
     128 *
     129 * @see get_query_template()
     130 *
     131 * @return string Full path to author template file.
    112132 */
    113133function get_author_template() {
     
    132152 * template, if those files don't exist.
    133153 *
    134  * @since 1.5.0
    135  * @uses apply_filters() Calls 'category_template' on file path of category template.
    136  *
    137  * @return string
     154 * The template path is filterable via the 'category_template' hook.
     155 *
     156 * @since 1.5.0
     157 *
     158 * @see get_query_template()
     159 *
     160 * @return string Full path to category template file.
    138161 */
    139162function get_category_template() {
     
    158181 * template, if those files don't exist.
    159182 *
     183 * The template path is filterable via the 'tag_template' hook.
     184 *
    160185 * @since 2.3.0
    161  * @uses apply_filters() Calls 'tag_template' on file path of tag template.
    162  *
    163  * @return string
     186 *
     187 * @see get_query_template()
     188 *
     189 * @return string Full path to tag template file.
    164190 */
    165191function get_tag_template() {
     
    189215 * index.php.
    190216 *
     217 * The template path is filterable via the 'taxonomy_template' hook.
     218 *
    191219 * @since 2.5.0
    192  * @uses apply_filters() Calls 'taxonomy_template' filter on found path.
    193  *
    194  * @return string
     220 *
     221 * @see get_query_template()
     222 *
     223 * @return string Full path to taxonomy template file.
    195224 */
    196225function get_taxonomy_template() {
     
    212241 * Retrieve path of date template in current or parent template.
    213242 *
    214  * @since 1.5.0
    215  *
    216  * @return string
     243 * The template path is filterable via the 'date_template' hook.
     244 *
     245 * @since 1.5.0
     246 *
     247 * @see get_query_template()
     248 *
     249 * @return string Full path to date template file.
    217250 */
    218251function get_date_template() {
     
    224257 *
    225258 * This is the template used for the page containing the blog posts.
    226  *
    227259 * Attempts to locate 'home.php' first before falling back to 'index.php'.
    228260 *
    229  * @since 1.5.0
    230  * @uses apply_filters() Calls 'home_template' on file path of home template.
    231  *
    232  * @return string
     261 * The template path is filterable via the 'home_template' hook.
     262 *
     263 * @since 1.5.0
     264 *
     265 * @see get_query_template()
     266 *
     267 * @return string Full path to home template file.
    233268 */
    234269function get_home_template() {
     
    241276 * Retrieve path of front-page template in current or parent template.
    242277 *
    243  * Looks for 'front-page.php'.
     278 * Looks for 'front-page.php'. The template path is filterable via the
     279 * 'front_page_template' hook.
    244280 *
    245281 * @since 3.0.0
    246  * @uses apply_filters() Calls 'front_page_template' on file path of template.
    247  *
    248  * @return string
     282 *
     283 * @see get_query_template()
     284 *
     285 * @return string Full path to front page template file.
    249286 */
    250287function get_front_page_template() {
     
    261298 * and finally 'page.php'.
    262299 *
    263  * @since 1.5.0
    264  *
    265  * @return string
     300 * The template path is filterable via the 'page_template' hook.
     301 *
     302 * @since 1.5.0
     303 *
     304 * @see get_query_template()
     305 *
     306 * @return string Full path to page template file.
    266307 */
    267308function get_page_template() {
     
    292333 * Retrieve path of paged template in current or parent template.
    293334 *
    294  * @since 1.5.0
    295  *
    296  * @return string
     335 * The template path is filterable via the 'paged_template' hook.
     336 *
     337 * @since 1.5.0
     338 *
     339 * @see get_query_template()
     340 *
     341 * @return string Full path to paged template file.
    297342 */
    298343function get_paged_template() {
     
    303348 * Retrieve path of search template in current or parent template.
    304349 *
    305  * @since 1.5.0
    306  *
    307  * @return string
     350 * The template path is filterable via the 'search_template' hook.
     351 *
     352 * @since 1.5.0
     353 *
     354 * @see get_query_template()
     355 *
     356 * @return string Full path to search template file.
    308357 */
    309358function get_search_template() {
     
    314363 * Retrieve path of single template in current or parent template.
    315364 *
    316  * @since 1.5.0
    317  *
    318  * @return string
     365 * The template path is filterable via the 'single_template' hook.
     366 *
     367 * @since 1.5.0
     368 *
     369 * @see get_query_template()
     370 *
     371 * @return string Full path to single template file.
    319372 */
    320373function get_single_template() {
     
    341394 * finally 'text_plain.php'.
    342395 *
     396 * The template path is filterable via the 'attachment_template' hook.
     397 *
    343398 * @since 2.0.0
    344399 *
    345  * @return string
     400 * @see get_query_template()
     401 *
     402 * @return string Full path to attachment template file.
    346403 */
    347404function get_attachment_template() {
     
    372429 * parent template.
    373430 *
    374  * @since 1.5.0
    375  * @uses apply_filters() Calls 'comments_popup_template' filter on path.
    376  *
    377  * @return string
     431 * The template path is filterable via the 'comments_popup_template' hook.
     432 *
     433 * @since 1.5.0
     434 *
     435 * @see get_query_template()
     436 *
     437 * @return string Full path to comments popup template file.
    378438 */
    379439function get_comments_popup_template() {
Note: See TracChangeset for help on using the changeset viewer.