[ 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: 1918 lines (61 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 wp-includes/class-phpass.php

Defines 36 functions

  the_ID()
  get_the_ID()
  the_title()
  the_title_attribute()
  get_the_title()
  the_guid()
  get_the_guid()
  the_content()
  get_the_content()
  _convert_urlencoded_to_entities()
  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.

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.
return: string|void Current post title if $echo is false.

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.

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

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.

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

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.

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

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 )   X-Ref
Retrieve 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.
return: string

_convert_urlencoded_to_entities( $match )   X-Ref
Preview fix for JavaScript bug with foreign languages.

param: array $match Match array from preg_replace_callback.
return: string

the_excerpt()   X-Ref
Display the post excerpt.


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

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

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.

param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
return: bool True if the post has a custom excerpt, false otherwise.

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.

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.
return: string[] Array of class names.

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.

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

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

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

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.

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

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

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

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

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

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).

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

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

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

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.

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

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

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

walk_page_dropdown_tree()   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.

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.
return: string HTML content.

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

param: string $content
return: string

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

param: int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
return: string HTML content for password form for password protected 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.

param: string|array $template The specific template name or array of templates to match.
return: bool True on success, false on failure.

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

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

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

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

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

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

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: Mon Feb 18 08:20:01 2019 Cross-referenced by PHPXref 0.7