Make WordPress Core


Ignore:
Timestamp:
03/20/2015 07:56:16 PM (9 years ago)
Author:
DrewAPicture
Message:

Adjust DocBlocks for get_|the_post_thumbnail() to clarify the difference between the 'thumbnail' and 'post-thumbnail' image sizes.

Also fleshes out parameter documentation for the two functions.

Props magicroundabout for the initial patch.
Fixes #31351.

File:
1 edited

Legend:

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

    r31048 r31853  
    3636
    3737/**
    38  * Display Post Thumbnail.
     38 * Display the post thumbnail.
     39 *
     40 * When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size
     41 * is registered, which differs from the 'thumbnail' image size managed via the
     42 * Settings > Media screen.
     43 *
     44 * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image
     45 * size is used by default, though a different size can be specified instead as needed.
    3946 *
    4047 * @since 2.9.0
    4148 *
    42  * @param string|array $size Optional. Image size. Defaults to 'post-thumbnail', which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );.
    43  * @param string|array $attr Optional. Query string or array of attributes.
     49 * @see get_the_post_thumbnail()
     50 *
     51 * @param string|array $size Optional. Registered image size to use, or flat array of height
     52 *                           and width values. Default 'post-thumbnail'.
     53 * @param string|array $attr Optional. Query string or array of attributes. Default empty.
    4454 */
    4555function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
     
    7585
    7686/**
    77  * Retrieve Post Thumbnail.
     87 * Retrieve the post thumbnail.
     88 *
     89 * When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size
     90 * is registered, which differs from the 'thumbnail' image size managed via the
     91 * Settings > Media screen.
     92 *
     93 * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image
     94 * size is used by default, though a different size can be specified instead as needed.
    7895 *
    7996 * @since 2.9.0
    8097 *
    81  * @param int $post_id Optional. Post ID.
    82  * @param string $size Optional. Image size. Defaults to 'post-thumbnail'.
    83  * @param string|array $attr Optional. Query string or array of attributes.
     98 * @param int $post_id       Post ID. Default is the ID of the `$post` global.
     99 * @param string|array $size Optional. Registered image size to use, or flat array of height
     100 *                           and width values. Default 'post-thumbnail'.
     101 * @param string|array $attr Optional. Query string or array of attributes. Default empty.
    84102 */
    85103function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) {
Note: See TracChangeset for help on using the changeset viewer.