[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

WordPress Link Template Functions

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

Defines 117 functions

  the_permalink()
  user_trailingslashit()
  permalink_anchor()
  wp_force_plain_post_permalink()
  get_the_permalink()
  get_permalink()
  get_post_permalink()
  get_page_link()
  _get_page_link()
  get_attachment_link()
  get_year_link()
  get_month_link()
  get_day_link()
  the_feed_link()
  get_feed_link()
  get_post_comments_feed_link()
  post_comments_feed_link()
  get_author_feed_link()
  get_category_feed_link()
  get_term_feed_link()
  get_tag_feed_link()
  get_edit_tag_link()
  edit_tag_link()
  get_edit_term_link()
  edit_term_link()
  get_search_link()
  get_search_feed_link()
  get_search_comments_feed_link()
  get_post_type_archive_link()
  get_post_type_archive_feed_link()
  get_preview_post_link()
  get_edit_post_link()
  edit_post_link()
  get_delete_post_link()
  get_edit_comment_link()
  edit_comment_link()
  get_edit_bookmark_link()
  edit_bookmark_link()
  get_edit_user_link()
  get_previous_post()
  get_next_post()
  get_adjacent_post()
  get_adjacent_post_rel_link()
  adjacent_posts_rel_link()
  adjacent_posts_rel_link_wp_head()
  next_post_rel_link()
  prev_post_rel_link()
  get_boundary_post()
  get_previous_post_link()
  previous_post_link()
  get_next_post_link()
  next_post_link()
  get_adjacent_post_link()
  adjacent_post_link()
  get_pagenum_link()
  get_next_posts_page_link()
  next_posts()
  get_next_posts_link()
  next_posts_link()
  get_previous_posts_page_link()
  previous_posts()
  get_previous_posts_link()
  previous_posts_link()
  get_posts_nav_link()
  posts_nav_link()
  get_the_post_navigation()
  the_post_navigation()
  get_the_posts_navigation()
  the_posts_navigation()
  get_the_posts_pagination()
  the_posts_pagination()
  _navigation_markup()
  get_comments_pagenum_link()
  get_next_comments_link()
  next_comments_link()
  get_previous_comments_link()
  previous_comments_link()
  paginate_comments_links()
  get_the_comments_navigation()
  the_comments_navigation()
  get_the_comments_pagination()
  the_comments_pagination()
  home_url()
  get_home_url()
  site_url()
  get_site_url()
  admin_url()
  get_admin_url()
  includes_url()
  content_url()
  plugins_url()
  network_site_url()
  network_home_url()
  network_admin_url()
  user_admin_url()
  self_admin_url()
  set_url_scheme()
  get_dashboard_url()
  get_edit_profile_url()
  wp_get_canonical_url()
  rel_canonical()
  wp_get_shortlink()
  wp_shortlink_wp_head()
  wp_shortlink_header()
  the_shortlink()
  get_avatar_url()
  is_avatar_comment_type()
  get_avatar_data()
  get_theme_file_uri()
  get_parent_theme_file_uri()
  get_theme_file_path()
  get_parent_theme_file_path()
  get_privacy_policy_url()
  the_privacy_policy_link()
  get_the_privacy_policy_link()
  wp_internal_hosts()
  wp_is_internal_link()

Functions
Functions that are not part of a class:

the_permalink( $post = 0 )   X-Ref
Displays the permalink for the current post.

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

user_trailingslashit( $url, $type_of_url = '' )   X-Ref
Retrieves a trailing-slashed string if the site is set for adding trailing slashes.

Conditionally adds a trailing slash if the permalink structure has a trailing
slash, strips the trailing slash if not. The string is passed through the
{@see 'user_trailingslashit'} filter. Will remove trailing slash from string, if
site is not set to have them.

return: string The URL with the trailing slash appended or stripped.
param: string $url         URL with or without a trailing slash.
param: string $type_of_url Optional. The type of URL being considered (e.g. single, category, etc)

permalink_anchor( $mode = 'id' )   X-Ref
Displays the permalink anchor for the current post.

The permalink mode title will use the post title for the 'a' element 'id'
attribute. The id mode uses 'post-' with the post ID for the 'id' attribute.

param: string $mode Optional. Permalink mode. Accepts 'title' or 'id'. Default 'id'.

wp_force_plain_post_permalink( $post = null, $sample = null )   X-Ref
Determine whether post should always use a plain permalink structure.

return: bool Whether to use a plain permalink structure.
param: WP_Post|int|null $post   Optional. Post ID or post object. Defaults to global $post.
param: bool|null        $sample Optional. Whether to force consideration based on sample links.

get_the_permalink( $post = 0, $leavename = false )   X-Ref
Retrieves the full permalink for the current post or post ID.

This function is an alias for get_permalink().

return: string|false The permalink URL. False if the post does not exist.
param: int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.
param: bool        $leavename Optional. Whether to keep post name or page name. Default false.

get_permalink( $post = 0, $leavename = false )   X-Ref
Retrieves the full permalink for the current post or post ID.

return: string|false The permalink URL. False if the post does not exist.
param: int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.
param: bool        $leavename Optional. Whether to keep post name or page name. Default false.

get_post_permalink( $post = 0, $leavename = false, $sample = false )   X-Ref
Retrieves the permalink for a post of a custom post type.

return: string|false The post permalink URL. False if the post does not exist.
param: int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.
param: bool        $leavename Optional. Whether to keep post name. Default false.
param: bool        $sample    Optional. Is it a sample permalink. Default false.

get_page_link( $post = false, $leavename = false, $sample = false )   X-Ref
Retrieves the permalink for the current page or page ID.

Respects page_on_front. Use this one.

return: string The page permalink.
param: int|WP_Post $post      Optional. Post ID or object. Default uses the global `$post`.
param: bool        $leavename Optional. Whether to keep the page name. Default false.
param: bool        $sample    Optional. Whether it should be treated as a sample permalink.

_get_page_link( $post = false, $leavename = false, $sample = false )   X-Ref
Retrieves the page permalink.

Ignores page_on_front. Internal use only.

return: string The page permalink.
param: int|WP_Post $post      Optional. Post ID or object. Default uses the global `$post`.
param: bool        $leavename Optional. Whether to keep the page name. Default false.
param: bool        $sample    Optional. Whether it should be treated as a sample permalink.

get_attachment_link( $post = null, $leavename = false )   X-Ref
Retrieves the permalink for an attachment.

This can be used in the WordPress Loop or outside of it.

return: string The attachment permalink.
param: int|WP_Post $post      Optional. Post ID or object. Default uses the global `$post`.
param: bool        $leavename Optional. Whether to keep the page name. Default false.

get_year_link( $year )   X-Ref
Retrieves the permalink for the year archives.

return: string The permalink for the specified year archive.
param: int|false $year Integer of year. False for current year.

get_month_link( $year, $month )   X-Ref
Retrieves the permalink for the month archives with year.

return: string The permalink for the specified month and year archive.
param: int|false $year  Integer of year. False for current year.
param: int|false $month Integer of month. False for current month.

get_day_link( $year, $month, $day )   X-Ref
Retrieves the permalink for the day archives with year and month.

return: string The permalink for the specified day, month, and year archive.
param: int|false $year  Integer of year. False for current year.
param: int|false $month Integer of month. False for current month.
param: int|false $day   Integer of day. False for current day.

the_feed_link( $anchor, $feed = '' )   X-Ref
Displays the permalink for the feed type.

param: string $anchor The link's anchor text.
param: string $feed   Optional. Feed type. Possible values include 'rss2', 'atom'.

get_feed_link( $feed = '' )   X-Ref
Retrieves the permalink for the feed type.

return: string The feed permalink.
param: string $feed Optional. Feed type. Possible values include 'rss2', 'atom'.

get_post_comments_feed_link( $post_id = 0, $feed = '' )   X-Ref
Retrieves the permalink for the post comments feed.

return: string The permalink for the comments feed for the given post on success, empty string on failure.
param: int    $post_id Optional. Post ID. Default is the ID of the global `$post`.
param: string $feed    Optional. Feed type. Possible values include 'rss2', 'atom'.

post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' )   X-Ref
Displays the comment feed link for a post.

Prints out the comment feed link for a post. Link text is placed in the
anchor. If no link text is specified, default text is used. If no post ID is
specified, the current post is used.

param: string $link_text Optional. Descriptive link text. Default 'Comments Feed'.
param: int    $post_id   Optional. Post ID. Default is the ID of the global `$post`.
param: string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.

get_author_feed_link( $author_id, $feed = '' )   X-Ref
Retrieves the feed link for a given author.

Returns a link to the feed for all posts by a given author. A specific feed
can be requested or left blank to get the default feed.

return: string Link to the feed for the author specified by $author_id.
param: int    $author_id Author ID.
param: string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.

get_category_feed_link( $cat, $feed = '' )   X-Ref
Retrieves the feed link for a category.

Returns a link to the feed for all posts in a given category. A specific feed
can be requested or left blank to get the default feed.

return: string Link to the feed for the category specified by `$cat`.
param: int|WP_Term|object $cat  The ID or category object whose feed link will be retrieved.
param: string             $feed Optional. Feed type. Possible values include 'rss2', 'atom'.

get_term_feed_link( $term, $taxonomy = '', $feed = '' )   X-Ref
Retrieves the feed link for a term.

Returns a link to the feed for all posts in a given term. A specific feed
can be requested or left blank to get the default feed.

return: string|false Link to the feed for the term specified by `$term` and `$taxonomy`.
param: int|WP_Term|object $term     The ID or term object whose feed link will be retrieved.
param: string             $taxonomy Optional. Taxonomy of `$term_id`.
param: string             $feed     Optional. Feed type. Possible values include 'rss2', 'atom'.

get_tag_feed_link( $tag, $feed = '' )   X-Ref
Retrieves the permalink for a tag feed.

return: string                  The feed permalink for the given tag.
param: int|WP_Term|object $tag  The ID or term object whose feed link will be retrieved.
param: string             $feed Optional. Feed type. Possible values include 'rss2', 'atom'.

get_edit_tag_link( $tag, $taxonomy = 'post_tag' )   X-Ref
Retrieves the edit link for a tag.

return: string The edit tag link URL for the given tag.
param: int|WP_Term|object $tag      The ID or term object whose edit link will be retrieved.
param: string             $taxonomy Optional. Taxonomy slug. Default 'post_tag'.

edit_tag_link( $link = '', $before = '', $after = '', $tag = null )   X-Ref
Displays or retrieves the edit link for a tag with formatting.

param: string  $link   Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
param: string  $before Optional. Display before edit link. Default empty.
param: string  $after  Optional. Display after edit link. Default empty.
param: WP_Term $tag    Optional. Term object. If null, the queried object will be inspected.

get_edit_term_link( $term, $taxonomy = '', $object_type = '' )   X-Ref
Retrieves the URL for editing a given term.

return: string|null The edit term link URL for the given term, or null on failure.
param: int|WP_Term|object $term        The ID or term object whose edit link will be retrieved.
param: string             $taxonomy    Optional. Taxonomy. Defaults to the taxonomy of the term identified
param: string             $object_type Optional. The object type. Used to highlight the proper post type

edit_term_link( $link = '', $before = '', $after = '', $term = null, $display = true )   X-Ref
Displays or retrieves the edit term link with formatting.

return: string|void HTML content.
param: string           $link    Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
param: string           $before  Optional. Display before edit link. Default empty.
param: string           $after   Optional. Display after edit link. Default empty.
param: int|WP_Term|null $term    Optional. Term ID or object. If null, the queried object will be inspected. Default null.
param: bool             $display Optional. Whether or not to echo the return. Default true.

get_search_link( $query = '' )   X-Ref
Retrieves the permalink for a search.

return: string The search permalink.
param: string $query Optional. The query string to use. If empty the current query is used. Default empty.

get_search_feed_link( $search_query = '', $feed = '' )   X-Ref
Retrieves the permalink for the search results feed.

return: string The search results feed permalink.
param: string $search_query Optional. Search query. Default empty.
param: string $feed         Optional. Feed type. Possible values include 'rss2', 'atom'.

get_search_comments_feed_link( $search_query = '', $feed = '' )   X-Ref
Retrieves the permalink for the search results comments feed.

return: string The comments feed search results permalink.
param: string $search_query Optional. Search query. Default empty.
param: string $feed         Optional. Feed type. Possible values include 'rss2', 'atom'.

get_post_type_archive_link( $post_type )   X-Ref
Retrieves the permalink for a post type archive.

return: string|false The post type archive permalink. False if the post type
param: string $post_type Post type.

get_post_type_archive_feed_link( $post_type, $feed = '' )   X-Ref
Retrieves the permalink for a post type archive feed.

return: string|false The post type feed permalink. False if the post type
param: string $post_type Post type.
param: string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.

get_preview_post_link( $post = null, $query_args = array()   X-Ref
Retrieves the URL used for the post preview.

Allows additional query args to be appended.

return: string|null URL used for the post preview, or null if the post does not exist.
param: int|WP_Post $post         Optional. Post ID or `WP_Post` object. Defaults to global `$post`.
param: array       $query_args   Optional. Array of additional query args to be appended to the link.
param: string      $preview_link Optional. Base preview link to be used if it should differ from the

get_edit_post_link( $post = 0, $context = 'display' )   X-Ref
Retrieves the edit post link for post.

Can be used within the WordPress loop or outside of it. Can be used with
pages, posts, attachments, revisions, global styles, templates, and template parts.

return: string|null The edit post link for the given post. Null if the post type does not exist
param: int|WP_Post $post    Optional. Post ID or post object. Default is the global `$post`.
param: string      $context Optional. How to output the '&' character. Default '&'.

edit_post_link( $text = null, $before = '', $after = '', $post = 0, $css_class = 'post-edit-link' )   X-Ref
Displays the edit post link for post.

param: string      $text      Optional. Anchor text. If null, default is 'Edit This'. Default null.
param: string      $before    Optional. Display before edit link. Default empty.
param: string      $after     Optional. Display after edit link. Default empty.
param: int|WP_Post $post      Optional. Post ID or post object. Default is the global `$post`.
param: string      $css_class Optional. Add custom class to link. Default 'post-edit-link'.

get_delete_post_link( $post = 0, $deprecated = '', $force_delete = false )   X-Ref
Retrieves the delete posts link for post.

Can be used within the WordPress loop or outside of it, with any post type.

return: string|void The delete post link URL for the given post.
param: int|WP_Post $post         Optional. Post ID or post object. Default is the global `$post`.
param: string      $deprecated   Not used.
param: bool        $force_delete Optional. Whether to bypass Trash and force deletion. Default false.

get_edit_comment_link( $comment_id = 0, $context = 'display' )   X-Ref
Retrieves the edit comment link.

return: string|void The edit comment link URL for the given comment, or void if the comment id does not exist or
param: int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object.
param: string         $context    Optional. Context in which the URL should be used. Either 'display',

edit_comment_link( $text = null, $before = '', $after = '' )   X-Ref
Displays the edit comment link with formatting.

param: string $text   Optional. Anchor text. If null, default is 'Edit This'. Default null.
param: string $before Optional. Display before edit link. Default empty.
param: string $after  Optional. Display after edit link. Default empty.

get_edit_bookmark_link( $link = 0 )   X-Ref
Displays the edit bookmark link.

return: string|void The edit bookmark link URL.
param: int|stdClass $link Optional. Bookmark ID. Default is the ID of the current bookmark.

edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null )   X-Ref
Displays the edit bookmark link anchor content.

param: string $link     Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
param: string $before   Optional. Display before edit link. Default empty.
param: string $after    Optional. Display after edit link. Default empty.
param: int    $bookmark Optional. Bookmark ID. Default is the current bookmark.

get_edit_user_link( $user_id = null )   X-Ref
Retrieves the edit user link.

return: string URL to edit user page or empty string.
param: int $user_id Optional. User ID. Defaults to the current user.

get_previous_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Retrieves the previous post that is adjacent to the current post.

return: WP_Post|null|string Post object if successful. Null if global `$post` is not set.
param: bool         $in_same_term   Optional. Whether post should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Retrieves the next post that is adjacent to the current post.

return: WP_Post|null|string Post object if successful. Null if global `$post` is not set.
param: bool         $in_same_term   Optional. Whether post should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' )   X-Ref
Retrieves the adjacent post.

Can either be next or previous post.

return: WP_Post|null|string Post object if successful. Null if global `$post` is not set.
param: bool         $in_same_term   Optional. Whether post should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: bool         $previous       Optional. Whether to retrieve previous post.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' )   X-Ref
Retrieves the adjacent post relational link.

Can either be next or previous post relational link.

return: string|void The adjacent post relational link URL.
param: string       $title          Optional. Link title format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: bool         $previous       Optional. Whether to display link to previous or next post.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Displays the relational links for the posts adjacent to the current post.

param: string       $title          Optional. Link title format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

adjacent_posts_rel_link_wp_head()   X-Ref
Displays relational links for the posts adjacent to the current post for single post pages.

This is meant to be attached to actions like 'wp_head'. Do not call this directly in plugins
or theme templates.


next_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Displays the relational link for the next post adjacent to the current post.

param: string       $title          Optional. Link title format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

prev_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Displays the relational link for the previous post adjacent to the current post.

param: string       $title          Optional. Link title format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' )   X-Ref
Retrieves the boundary post.

Boundary being either the first or last post by publish date within the constraints specified
by `$in_same_term` or `$excluded_terms`.

return: array|null Array containing the boundary post object if successful, null otherwise.
param: bool         $in_same_term   Optional. Whether returned post should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: bool         $start          Optional. Whether to retrieve first or last post.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Retrieves the previous post link that is adjacent to the current post.

return: string The link URL of the previous post in relation to the current post.
param: string       $format         Optional. Link anchor format. Default '« %link'.
param: string       $link           Optional. Link permalink format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Displays the previous post link that is adjacent to the current post.

param: string       $format         Optional. Link anchor format. Default '« %link'.
param: string       $link           Optional. Link permalink format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Retrieves the next post link that is adjacent to the current post.

return: string The link URL of the next post in relation to the current post.
param: string       $format         Optional. Link anchor format. Default '« %link'.
param: string       $link           Optional. Link permalink format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )   X-Ref
Displays the next post link that is adjacent to the current post.

param: string       $format         Optional. Link anchor format. Default '« %link'.
param: string       $link           Optional. Link permalink format. Default '%title'.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' )   X-Ref
Retrieves the adjacent post link.

Can be either next post link or previous.

return: string The link URL of the previous or next post in relation to the current post.
param: string       $format         Link anchor format.
param: string       $link           Link permalink format.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs.
param: bool         $previous       Optional. Whether to display link to previous or next post.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' )   X-Ref
Displays the adjacent post link.

Can be either next post link or previous.

param: string       $format         Link anchor format.
param: string       $link           Link permalink format.
param: bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
param: int[]|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs.
param: bool         $previous       Optional. Whether to display link to previous or next post.
param: string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.

get_pagenum_link( $pagenum = 1, $escape = true )   X-Ref
Retrieves the link for a page number.

return: string The link URL for the given page number.
param: int  $pagenum Optional. Page number. Default 1.
param: bool $escape  Optional. Whether to escape the URL for display, with esc_url().

get_next_posts_page_link( $max_page = 0 )   X-Ref
Retrieves the next posts page link.

Backported from 2.1.3 to 2.0.10.

return: string|void The link URL for next posts page.
param: int $max_page Optional. Max pages. Default 0.

next_posts( $max_page = 0, $display = true )   X-Ref
Displays or retrieves the next posts page link.

return: string|void The link URL for next posts page if `$display = false`.
param: int  $max_page Optional. Max pages. Default 0.
param: bool $display  Optional. Whether to echo the link. Default true.

get_next_posts_link( $label = null, $max_page = 0 )   X-Ref
Retrieves the next posts page link.

return: string|void HTML-formatted next posts page link.
param: string $label    Content for link text.
param: int    $max_page Optional. Max pages. Default 0.

next_posts_link( $label = null, $max_page = 0 )   X-Ref
Displays the next posts page link.

param: string $label    Content for link text.
param: int    $max_page Optional. Max pages. Default 0.

get_previous_posts_page_link()   X-Ref
Retrieves the previous posts page link.

Will only return string, if not on a single page or post.

Backported to 2.0.10 from 2.1.3.

return: string|void The link for the previous posts page.

previous_posts( $display = true )   X-Ref
Displays or retrieves the previous posts page link.

return: string|void The previous posts page link if `$display = false`.
param: bool $display Optional. Whether to echo the link. Default true.

get_previous_posts_link( $label = null )   X-Ref
Retrieves the previous posts page link.

return: string|void HTML-formatted previous page link.
param: string $label Optional. Previous page link text.

previous_posts_link( $label = null )   X-Ref
Displays the previous posts page link.

param: string $label Optional. Previous page link text.

get_posts_nav_link( $args = array()   X-Ref
Retrieves the post pages link navigation for previous and next pages.

return: string The posts link navigation.
param: string|array $args {

posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' )   X-Ref
Displays the post pages link navigation for previous and next pages.

param: string $sep      Optional. Separator for posts navigation links. Default empty.
param: string $prelabel Optional. Label for previous pages. Default empty.
param: string $nxtlabel Optional Label for next pages. Default empty.

get_the_post_navigation( $args = array()   X-Ref
Retrieves the navigation to next/previous post, when applicable.

return: string Markup for post links.
param: array $args {

the_post_navigation( $args = array()   X-Ref
Displays the navigation to next/previous post, when applicable.

param: array $args Optional. See get_the_post_navigation() for available arguments.

get_the_posts_navigation( $args = array()   X-Ref
Returns the navigation to next/previous set of posts, when applicable.

return: string Markup for posts links.
param: array $args {

the_posts_navigation( $args = array()   X-Ref
Displays the navigation to next/previous set of posts, when applicable.

param: array $args Optional. See get_the_posts_navigation() for available arguments.

get_the_posts_pagination( $args = array()   X-Ref
Retrieves a paginated navigation to next/previous set of posts, when applicable.

return: string Markup for pagination links.
param: array $args {

the_posts_pagination( $args = array()   X-Ref
Displays a paginated navigation to next/previous set of posts, when applicable.

param: array $args Optional. See get_the_posts_pagination() for available arguments.

_navigation_markup( $links, $css_class = 'posts-navigation', $screen_reader_text = '', $aria_label = '' )   X-Ref
Wraps passed links in navigational markup.

return: string Navigation template tag.
param: string $links              Navigational links.
param: string $css_class          Optional. Custom class for the nav element.
param: string $screen_reader_text Optional. Screen reader text for the nav element.
param: string $aria_label         Optional. ARIA label for the nav element.

get_comments_pagenum_link( $pagenum = 1, $max_page = 0 )   X-Ref
Retrieves the comments page number link.

return: string The comments page number link URL.
param: int $pagenum  Optional. Page number. Default 1.
param: int $max_page Optional. The maximum number of comment pages. Default 0.

get_next_comments_link( $label = '', $max_page = 0, $page = null )   X-Ref
Retrieves the link to the next comments page.

return: string|void HTML-formatted link for the next page of comments.
param: string   $label    Optional. Label for link text. Default empty.
param: int      $max_page Optional. Max page. Default 0.
param: int|null $page     Optional. Page number. Default null.

next_comments_link( $label = '', $max_page = 0 )   X-Ref
Displays the link to the next comments page.

param: string $label    Optional. Label for link text. Default empty.
param: int    $max_page Optional. Max page. Default 0.

get_previous_comments_link( $label = '', $page = null )   X-Ref
Retrieves the link to the previous comments page.

return: string|void HTML-formatted link for the previous page of comments.
param: string   $label Optional. Label for comments link text. Default empty.
param: int|null $page  Optional. Page number. Default null.

previous_comments_link( $label = '' )   X-Ref
Displays the link to the previous comments page.

param: string $label Optional. Label for comments link text. Default empty.

paginate_comments_links( $args = array()   X-Ref
Displays or retrieves pagination links for the comments on the current post.

return: void|string|array Void if 'echo' argument is true and 'type' is not an array,
param: string|array $args Optional args. See paginate_links(). Default empty array.

get_the_comments_navigation( $args = array()   X-Ref
Retrieves navigation to next/previous set of comments, when applicable.

return: string Markup for comments links.
param: array $args {

the_comments_navigation( $args = array()   X-Ref
Displays navigation to next/previous set of comments, when applicable.

param: array $args See get_the_comments_navigation() for available arguments. Default empty array.

get_the_comments_pagination( $args = array()   X-Ref
Retrieves a paginated navigation to next/previous set of comments, when applicable.

return: string Markup for pagination links.
param: array $args {

the_comments_pagination( $args = array()   X-Ref
Displays a paginated navigation to next/previous set of comments, when applicable.

param: array $args See get_the_comments_pagination() for available arguments. Default empty array.

home_url( $path = '', $scheme = null )   X-Ref
Retrieves the URL for the current site where the front end is accessible.

Returns the 'home' option with the appropriate protocol. The protocol will be 'https'
if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option.
If `$scheme` is 'http' or 'https', is_ssl() is overridden.

return: string Home URL link with optional path appended.
param: string      $path   Optional. Path relative to the home URL. Default empty.
param: string|null $scheme Optional. Scheme to give the home URL context. Accepts

get_home_url( $blog_id = null, $path = '', $scheme = null )   X-Ref
Retrieves the URL for a given site where the front end is accessible.

Returns the 'home' option with the appropriate protocol. The protocol will be 'https'
if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option.
If `$scheme` is 'http' or 'https', is_ssl() is overridden.

return: string Home URL link with optional path appended.
param: int|null    $blog_id Optional. Site ID. Default null (current site).
param: string      $path    Optional. Path relative to the home URL. Default empty.
param: string|null $scheme  Optional. Scheme to give the home URL context. Accepts

site_url( $path = '', $scheme = null )   X-Ref
Retrieves the URL for the current site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.

Returns the 'site_url' option with the appropriate protocol, 'https' if
is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
overridden.

return: string Site URL link with optional path appended.
param: string      $path   Optional. Path relative to the site URL. Default empty.
param: string|null $scheme Optional. Scheme to give the site URL context. See set_url_scheme().

get_site_url( $blog_id = null, $path = '', $scheme = null )   X-Ref
Retrieves the URL for a given site where WordPress application files
(e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.

Returns the 'site_url' option with the appropriate protocol, 'https' if
is_ssl() and 'http' otherwise. If `$scheme` is 'http' or 'https',
`is_ssl()` is overridden.

return: string Site URL link with optional path appended.
param: int|null    $blog_id Optional. Site ID. Default null (current site).
param: string      $path    Optional. Path relative to the site URL. Default empty.
param: string|null $scheme  Optional. Scheme to give the site URL context. Accepts

admin_url( $path = '', $scheme = 'admin' )   X-Ref
Retrieves the URL to the admin area for the current site.

return: string Admin URL link with optional path appended.
param: string $path   Optional. Path relative to the admin URL. Default empty.
param: string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().

get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' )   X-Ref
Retrieves the URL to the admin area for a given site.

return: string Admin URL link with optional path appended.
param: int|null $blog_id Optional. Site ID. Default null (current site).
param: string   $path    Optional. Path relative to the admin URL. Default empty.
param: string   $scheme  Optional. The scheme to use. Accepts 'http' or 'https',

includes_url( $path = '', $scheme = null )   X-Ref
Retrieves the URL to the includes directory.

return: string Includes URL link with optional path appended.
param: string      $path   Optional. Path relative to the includes URL. Default empty.
param: string|null $scheme Optional. Scheme to give the includes URL context. Accepts

content_url( $path = '' )   X-Ref
Retrieves the URL to the content directory.

return: string Content URL link with optional path appended.
param: string $path Optional. Path relative to the content URL. Default empty.

plugins_url( $path = '', $plugin = '' )   X-Ref
Retrieves a URL within the plugins or mu-plugins directory.

Defaults to the plugins directory URL if no arguments are supplied.

return: string Plugins URL link with optional paths appended.
param: string $path   Optional. Extra path appended to the end of the URL, including
param: string $plugin Optional. A full path to a file inside a plugin or mu-plugin.

network_site_url( $path = '', $scheme = null )   X-Ref
Retrieves the site URL for the current network.

Returns the site URL with the appropriate protocol, 'https' if
is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
overridden.

return: string Site URL link with optional path appended.
param: string      $path   Optional. Path relative to the site URL. Default empty.
param: string|null $scheme Optional. Scheme to give the site URL context. Accepts

network_home_url( $path = '', $scheme = null )   X-Ref
Retrieves the home URL for the current network.

Returns the home URL with the appropriate protocol, 'https' is_ssl()
and 'http' otherwise. If `$scheme` is 'http' or 'https', `is_ssl()` is
overridden.

return: string Home URL link with optional path appended.
param: string      $path   Optional. Path relative to the home URL. Default empty.
param: string|null $scheme Optional. Scheme to give the home URL context. Accepts

network_admin_url( $path = '', $scheme = 'admin' )   X-Ref
Retrieves the URL to the admin area for the network.

return: string Admin URL link with optional path appended.
param: string $path   Optional path relative to the admin URL. Default empty.
param: string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()

user_admin_url( $path = '', $scheme = 'admin' )   X-Ref
Retrieves the URL to the admin area for the current user.

return: string Admin URL link with optional path appended.
param: string $path   Optional. Path relative to the admin URL. Default empty.
param: string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()

self_admin_url( $path = '', $scheme = 'admin' )   X-Ref
Retrieves the URL to the admin area for either the current site or the network depending on context.

return: string Admin URL link with optional path appended.
param: string $path   Optional. Path relative to the admin URL. Default empty.
param: string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()

set_url_scheme( $url, $scheme = null )   X-Ref
Sets the scheme for a URL.

return: string URL with chosen scheme.
param: string      $url    Absolute URL that includes a scheme
param: string|null $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login',

get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' )   X-Ref
Retrieves the URL to the user's dashboard.

If a user does not belong to any site, the global user dashboard is used. If the user
belongs to the current site, the dashboard for the current site is returned. If the user
cannot edit the current site, the dashboard to the user's primary site is returned.

return: string Dashboard URL link with optional path appended.
param: int    $user_id Optional. User ID. Defaults to current user.
param: string $path    Optional path relative to the dashboard. Use only paths known to
param: string $scheme  The scheme to use. Default is 'admin', which obeys force_ssl_admin()

get_edit_profile_url( $user_id = 0, $scheme = 'admin' )   X-Ref
Retrieves the URL to the user's profile editor.

return: string Dashboard URL link with optional path appended.
param: int    $user_id Optional. User ID. Defaults to current user.
param: string $scheme  Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin()

wp_get_canonical_url( $post = null )   X-Ref
Returns the canonical URL for a post.

When the post is the same as the current requested page the function will handle the
pagination arguments too.

return: string|false The canonical URL. False if the post does not exist
param: int|WP_Post $post Optional. Post ID or object. Default is global `$post`.

rel_canonical()   X-Ref
Outputs rel=canonical for singular queries.


wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true )   X-Ref
Returns a shortlink for a post, page, attachment, or site.

This function exists to provide a shortlink tag that all themes and plugins can target.
A plugin must hook in to provide the actual shortlinks. Default shortlink support is
limited to providing ?p= style links for posts. Plugins can short-circuit this function
via the {@see 'pre_get_shortlink'} filter or filter the output via the {@see 'get_shortlink'}
filter.

return: string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks
param: int    $id          Optional. A post or site ID. Default is 0, which means the current post or site.
param: string $context     Optional. Whether the ID is a 'site' ID, 'post' ID, or 'media' ID. If 'post',
param: bool   $allow_slugs Optional. Whether to allow post slugs in the shortlink. It is up to the plugin how

wp_shortlink_wp_head()   X-Ref
Injects rel=shortlink into the head if a shortlink is defined for the current page.

Attached to the {@see 'wp_head'} action.


wp_shortlink_header()   X-Ref
Sends a Link: rel=shortlink header if a shortlink is defined for the current page.

Attached to the {@see 'wp'} action.


the_shortlink( $text = '', $title = '', $before = '', $after = '' )   X-Ref
Displays the shortlink for a post.

Must be called from inside "The Loop"

Call like the_shortlink( __( 'Shortlinkage FTW' ) )

param: string $text   Optional The link text or HTML to be displayed. Defaults to 'This is the short link.'
param: string $title  Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized post title.
param: string $before Optional HTML to display before the link. Default empty.
param: string $after  Optional HTML to display after the link. Default empty.

get_avatar_url( $id_or_email, $args = null )   X-Ref
Retrieves the avatar URL.

return: string|false The URL of the avatar on success, false on failure.
param: mixed $id_or_email The avatar to retrieve a URL for. Accepts a user ID, Gravatar SHA-256 or MD5 hash,
param: array $args {

is_avatar_comment_type( $comment_type )   X-Ref
Check if this comment type allows avatars to be retrieved.

return: bool Whether the comment type is allowed for retrieving avatars.
param: string $comment_type Comment type to check.

get_avatar_data( $id_or_email, $args = null )   X-Ref
Retrieves default data about the avatar.

return: array {
param: mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar SHA-256 or MD5 hash,
param: array $args {

get_theme_file_uri( $file = '' )   X-Ref
Retrieves the URL of a file in the theme.

Searches in the stylesheet directory before the template directory so themes
which inherit from a parent theme can just override one file.

return: string The URL of the file.
param: string $file Optional. File to search for in the stylesheet directory.

get_parent_theme_file_uri( $file = '' )   X-Ref
Retrieves the URL of a file in the parent theme.

return: string The URL of the file.
param: string $file Optional. File to return the URL for in the template directory.

get_theme_file_path( $file = '' )   X-Ref
Retrieves the path of a file in the theme.

Searches in the stylesheet directory before the template directory so themes
which inherit from a parent theme can just override one file.

return: string The path of the file.
param: string $file Optional. File to search for in the stylesheet directory.

get_parent_theme_file_path( $file = '' )   X-Ref
Retrieves the path of a file in the parent theme.

return: string The path of the file.
param: string $file Optional. File to return the path for in the template directory.

get_privacy_policy_url()   X-Ref
Retrieves the URL to the privacy policy page.

return: string The URL to the privacy policy page. Empty string if it doesn't exist.

the_privacy_policy_link( $before = '', $after = '' )   X-Ref
Displays the privacy policy link with formatting, when applicable.

param: string $before Optional. Display before privacy policy link. Default empty.
param: string $after  Optional. Display after privacy policy link. Default empty.

get_the_privacy_policy_link( $before = '', $after = '' )   X-Ref
Returns the privacy policy link with formatting, when applicable.

return: string Markup for the link and surrounding elements. Empty string if it
param: string $before Optional. Display before privacy policy link. Default empty.
param: string $after  Optional. Display after privacy policy link. Default empty.

wp_internal_hosts()   X-Ref
Returns an array of URL hosts which are considered to be internal hosts.

By default the list of internal hosts is comprised of the host name of
the site's home_url() (as parsed by wp_parse_url()).

This list is used when determining if a specified URL is a link to a page on
the site itself or a link offsite (to an external host). This is used, for
example, when determining if the "nofollow" attribute should be applied to a
link.

return: string[] An array of URL hosts.

wp_is_internal_link( $link )   X-Ref
Determines whether or not the specified URL is of a host included in the internal hosts list.

return: bool Returns true for internal URLs and false for all other URLs.
param: string $link The URL to test.



Generated : Sun Dec 22 08:20:01 2024 Cross-referenced by PHPXref