[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

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

WordPress Post Template Functions. Gets content for the current post in the loop.

File Size: 1946 lines (63 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 wp-includes/class-phpass.php

Defines 35 functions

  the_ID()
  get_the_ID()
  the_title()
  the_title_attribute()
  get_the_title()
  the_guid()
  get_the_guid()
  the_content()
  get_the_content()
  the_excerpt()
  get_the_excerpt()
  has_excerpt()
  post_class()
  get_post_class()
  body_class()
  get_body_class()
  post_password_required()
  wp_link_pages()
  _wp_link_page()
  post_custom()
  the_meta()
  wp_dropdown_pages()
  wp_list_pages()
  wp_page_menu()
  walk_page_tree()
  walk_page_dropdown_tree()
  the_attachment_link()
  wp_get_attachment_link()
  prepend_attachment()
  get_the_password_form()
  is_page_template()
  get_page_template_slug()
  wp_post_revision_title()
  wp_post_revision_title_expanded()
  wp_list_post_revisions()

Functions
Functions that are not part of a class:

the_ID()   X-Ref
Display the ID of the current item in the WordPress Loop.


get_the_ID()   X-Ref
Retrieve the ID of the current item in the WordPress Loop.

return: int|false The ID of the current item in the WordPress Loop. False if $post is not set.

the_title( $before = '', $after = '', $echo = true )   X-Ref
Display or retrieve the current post title with optional markup.

return: string|void Current post title if $echo is false.
param: string $before Optional. Markup to prepend to the title. Default empty.
param: string $after  Optional. Markup to append to the title. Default empty.
param: bool   $echo   Optional. Whether to echo or return the title. Default true for echo.

the_title_attribute( $args = '' )   X-Ref
Sanitize the current title when retrieving or displaying.

Works like the_title(), except the parameters can be in a string or
an array. See the function for what can be override in the $args parameter.

The title before it is displayed will have the tags stripped and esc_attr()
before it is passed to the user or displayed. The default as with the_title(),
is to display the title.

return: string|void String when echo is false.
param: string|array $args {

get_the_title( $post = 0 )   X-Ref
Retrieve post title.

If the post is protected and the visitor is not an admin, then "Protected"
will be displayed before the post title. If the post is private, then
"Private" will be located before the post title.

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

the_guid( $post = 0 )   X-Ref
Display the Post Global Unique Identifier (guid).

The guid will appear to be a link, but should not be used as a link to the
post. The reason you should not use it as a link, is because of moving the
blog across domains.

URL is escaped to make it XML-safe.

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

get_the_guid( $post = 0 )   X-Ref
Retrieve the Post Global Unique Identifier (guid).

The guid will appear to be a link, but should not be used as an link to the
post. The reason you should not use it as a link, is because of moving the
blog across domains.

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

the_content( $more_link_text = null, $strip_teaser = false )   X-Ref
Display the post content.

param: string $more_link_text Optional. Content for when there is more text.
param: bool   $strip_teaser   Optional. Strip teaser content before the more text. Default is false.

get_the_content( $more_link_text = null, $strip_teaser = false, $post = null )   X-Ref
Retrieve the post content.

return: string
param: string             $more_link_text Optional. Content for when there is more text.
param: bool               $strip_teaser   Optional. Strip teaser content before the more text. Default is false.
param: WP_Post|object|int $post           Optional. WP_Post instance or Post ID/object. Default is null.

the_excerpt()   X-Ref
Display the post excerpt.


get_the_excerpt( $post = null )   X-Ref
Retrieves the post excerpt.

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

has_excerpt( $post = 0 )   X-Ref
Determines whether the post has a custom excerpt.

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 True if the post has a custom excerpt, false otherwise.
param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.

post_class( $class = '', $post_id = null )   X-Ref
Displays the classes for the post container element.

param: string|array $class   One or more classes to add to the class list.
param: int|WP_Post  $post_id Optional. Post ID or post object. Defaults to the global `$post`.

get_post_class( $class = '', $post_id = null )   X-Ref
Retrieves an array of the class names for the post container element.

The class names are many. If the post is a sticky, then the 'sticky'
class name. The class 'hentry' is always added to each post. If the post has a
post thumbnail, 'has-post-thumbnail' is added as a class. For each taxonomy that
the post belongs to, a class will be added of the format '{$taxonomy}-{$slug}' -
eg 'category-foo' or 'my_custom_taxonomy-bar'.

The 'post_tag' taxonomy is a special
case; the class has the 'tag-' prefix instead of 'post_tag-'. All class names are
passed through the filter, {@see 'post_class'}, with the list of class names, followed by
$class parameter value, with the post ID as the last parameter.

return: string[] Array of class names.
param: string|string[] $class   Space-separated string or array of class names to add to the class list.
param: int|WP_Post     $post_id Optional. Post ID or post object.

body_class( $class = '' )   X-Ref
Displays the class names for the body element.

param: string|string[] $class Space-separated string or array of class names to add to the class list.

get_body_class( $class = '' )   X-Ref
Retrieves an array of the class names for the body element.

return: string[] Array of class names.
param: string|string[] $class Space-separated string or array of class names to add to the class list.

post_password_required( $post = null )   X-Ref
Whether post requires password and correct password has been provided.

return: bool false if a password is not required or the correct password cookie is present, true otherwise.
param: int|WP_Post|null $post An optional post. Global $post used if not provided.

wp_link_pages( $args = '' )   X-Ref
The formatted output of a list of pages.

Displays page links for paginated posts (i.e. including the `<!--nextpage-->`
Quicktag one or more times). This tag must be within The Loop.

return: string Formatted output in HTML.
param: string|array $args {

_wp_link_page( $i )   X-Ref
Helper function for wp_link_pages().

return: string Link.
param: int $i Page number.

post_custom( $key = '' )   X-Ref
Retrieve post custom meta data field.

return: false|string|array Array of values or single value, if only one element exists. False will be returned if key does not exist.
param: string $key Meta data key name.

the_meta()   X-Ref
Display a list of post custom fields.


wp_dropdown_pages( $args = '' )   X-Ref
Retrieve or display a list of pages as a dropdown (select list).

return: string HTML content, if not displaying.
param: array|string $args {

wp_list_pages( $args = '' )   X-Ref
Retrieve or display a list of pages (or hierarchical post type items) in list (li) format.

return: string|void HTML list of pages.
param: array|string $args {

wp_page_menu( $args = array()   X-Ref
Displays or retrieves a list of pages with an optional home link.

The arguments are listed below and part of the arguments are for wp_list_pages() function.
Check that function for more info on those arguments.

return: string|void HTML menu
param: array|string $args {

walk_page_tree( $pages, $depth, $current_page, $r )   X-Ref
Retrieve HTML list content for page list.

return: string
param: array $pages
param: int   $depth
param: int   $current_page
param: array $r

walk_page_dropdown_tree( ...$args )   X-Ref
Retrieve HTML dropdown (select) content for page list.

return: string

the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false )   X-Ref
Display an attachment page link using an image or icon.

param: int|WP_Post $id Optional. Post ID or post object.
param: bool        $fullsize     Optional, default is false. Whether to use full size.
param: bool        $deprecated   Deprecated. Not used.
param: bool        $permalink    Optional, default is false. Whether to include permalink.

wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' )   X-Ref
Retrieve an attachment page link using an image or icon, if possible.

return: string HTML content.
param: int|WP_Post  $id        Optional. Post ID or post object.
param: string|array $size      Optional. Image size. Accepts any valid image size, or an array
param: bool         $permalink Optional, Whether to add permalink to image. Default false.
param: bool         $icon      Optional. Whether the attachment is an icon. Default false.
param: string|false $text      Optional. Link text to use. Activated by passing a string, false otherwise.
param: array|string $attr      Optional. Array or string of attributes. Default empty.

prepend_attachment( $content )   X-Ref
Wrap attachment in paragraph tag before content.

return: string
param: string $content

get_the_password_form( $post = 0 )   X-Ref
Retrieve protected post password form content.

return: string HTML content for password form for password protected post.
param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.

is_page_template( $template = '' )   X-Ref
Determines whether currently in a page template.

This template tag allows you to determine if you are in a page template.
You can optionally provide a template name or array of template names
and then the check will be specific to that template.

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 True on success, false on failure.
param: string|array $template The specific template name or array of templates to match.

get_page_template_slug( $post = null )   X-Ref
Get the specific template name for a given post.

return: string|false Page template filename. Returns an empty string when the default page template
param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.

wp_post_revision_title( $revision, $link = true )   X-Ref
Retrieve formatted date timestamp of a revision (linked to that revisions's page).

return: string|false i18n formatted datetimestamp or localized 'Current Revision'.
param: int|object $revision Revision ID or revision object.
param: bool       $link     Optional, default is true. Link to revisions's page?

wp_post_revision_title_expanded( $revision, $link = true )   X-Ref
Retrieve formatted date timestamp of a revision (linked to that revisions's page).

return: string|false gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'.
param: int|object $revision Revision ID or revision object.
param: bool       $link     Optional, default is true. Link to revisions's page?

wp_list_post_revisions( $post_id = 0, $type = 'all' )   X-Ref
Display a list of a post's revisions.

Can output either a UL with edit links or a TABLE with diff interface, and
restore action links.

param: int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
param: string      $type    'all' (default), 'revision' or 'autosave'



Generated: Fri Oct 25 08:20:01 2019 Cross-referenced by PHPXref 0.7