[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> post-thumbnail-template.php (summary)

WordPress Post Thumbnail Template Functions. Support for post thumbnails. Theme's functions.php must call add_theme_support( 'post-thumbnails' ) to use these.

File Size: 276 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  has_post_thumbnail()
  get_post_thumbnail_id()
  the_post_thumbnail()
  update_post_thumbnail_cache()
  get_the_post_thumbnail()
  get_the_post_thumbnail_url()
  the_post_thumbnail_url()
  get_the_post_thumbnail_caption()
  the_post_thumbnail_caption()

Functions
Functions that are not part of a class:

has_post_thumbnail( $post = null )   X-Ref
Determines whether a post has an image attached.

For more information on this and similar theme functions, check out
the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
Conditional Tags} article in the Theme Developer Handbook.

return: bool Whether the post has an image attached.
param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.

get_post_thumbnail_id( $post = null )   X-Ref
Retrieve post thumbnail ID.

return: string|int Post thumbnail ID or empty string.
param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.

the_post_thumbnail( $size = 'post-thumbnail', $attr = '' )   X-Ref
Display the post thumbnail.

When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size
is registered, which differs from the 'thumbnail' image size managed via the
Settings > Media screen.

When using the_post_thumbnail() or related functions, the 'post-thumbnail' image
size is used by default, though a different size can be specified instead as needed.

param: string|array $size Optional. Image size to use. Accepts any valid image size, or
param: string|array $attr Optional. Query string or array of attributes. Default empty.

update_post_thumbnail_cache( $wp_query = null )   X-Ref
Update cache for thumbnails in the current loop.

param: WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.

get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' )   X-Ref
Retrieve the post thumbnail.

When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size
is registered, which differs from the 'thumbnail' image size managed via the
Settings > Media screen.

When using the_post_thumbnail() or related functions, the 'post-thumbnail' image
size is used by default, though a different size can be specified instead as needed.

return: string The post thumbnail image tag.
param: int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.
param: string|array $size Optional. Image size to use. Accepts any valid image size, or
param: string|array $attr Optional. Query string or array of attributes. Default empty.

get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' )   X-Ref
Return the post thumbnail URL.

return: string|false Post thumbnail URL or false if no URL is available.
param: int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.
param: string|array $size Optional. Registered image size to retrieve the source for or a flat

the_post_thumbnail_url( $size = 'post-thumbnail' )   X-Ref
Display the post thumbnail URL.

param: string|array $size Optional. Image size to use. Accepts any valid image size,

get_the_post_thumbnail_caption( $post = null )   X-Ref
Returns the post thumbnail caption.

return: string Post thumbnail caption.
param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.

the_post_thumbnail_caption( $post = null )   X-Ref
Displays the post thumbnail caption.

param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.



Generated: Tue Jul 23 08:20:01 2019 Cross-referenced by PHPXref 0.7