| [ Index ] |
PHP Cross Reference of WordPress (Trunk) |
[Source view] [Print] [Project Stats]
WordPress Link Template Functions
| File Size: | 2274 lines (67 kb) |
| Included or required: | 1 time |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| the_permalink() X-Ref |
| Display the permalink for the current post. |
| user_trailingslashit($string, $type_of_url = '') X-Ref |
| Retrieve trailing slash string, if blog 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 'user_trailingslashit' filter. Will remove trailing slash from string, if blog is not set to have them. param: $string String a URL with or without a trailing slash. param: $type_of_url String the type of URL being considered (e.g. single, category, etc) for use in the filter. return: string |
| permalink_anchor($mode = 'id') X-Ref |
| Display permalink anchor for 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 Permalink mode can be either 'title', 'id', or default, which is 'id'. |
| get_permalink($id = 0, $leavename = false) X-Ref |
| Retrieve full permalink for current post or post ID. param: int $id Optional. Post ID. param: bool $leavename Optional, defaults to false. Whether to keep post name or page name. return: string |
| get_post_permalink( $id = 0, $leavename = false, $sample = false ) X-Ref |
| Retrieve the permalink for a post with a custom post type. param: int $id Optional. Post ID. param: bool $leavename Optional, defaults to false. Whether to keep post name. param: bool $sample Optional, defaults to false. Is it a sample permalink. return: string |
| post_permalink( $post_id = 0, $deprecated = '' ) X-Ref |
| Retrieve permalink from post ID. param: int $post_id Optional. Post ID. param: mixed $deprecated Not used. return: string |
| get_page_link( $id = false, $leavename = false, $sample = false ) X-Ref |
| Retrieve the permalink for current page or page ID. Respects page_on_front. Use this one. param: int $id Optional. Post ID. param: bool $leavename Optional, defaults to false. Whether to keep page name. param: bool $sample Optional, defaults to false. Is it a sample permalink. return: string |
| _get_page_link( $id = false, $leavename = false, $sample = false ) X-Ref |
| Retrieve the page permalink. Ignores page_on_front. Internal use only. param: int $id Optional. Post ID. param: bool $leavename Optional. Leave name. param: bool $sample Optional. Sample permalink. return: string |
| get_attachment_link($id = false) X-Ref |
| Retrieve permalink for attachment. This can be used in the WordPress Loop or outside of it. param: int $id Optional. Post ID. return: string |
| get_year_link($year) X-Ref |
| Retrieve the permalink for the year archives. param: int|bool $year False for current year or year for permalink. return: string |
| get_month_link($year, $month) X-Ref |
| Retrieve the permalink for the month archives with year. param: bool|int $year False for current year. Integer of year. param: bool|int $month False for current month. Integer of month. return: string |
| get_day_link($year, $month, $day) X-Ref |
| Retrieve the permalink for the day archives with year and month. param: bool|int $year False for current year. Integer of year. param: bool|int $month False for current month. Integer of month. param: bool|int $day False for current day. Integer of day. return: string |
| the_feed_link( $anchor, $feed = '' ) X-Ref |
| Display the permalink for the feed type. param: string $anchor The link's anchor text. param: string $feed Optional, defaults to default feed. Feed type. |
| get_feed_link($feed = '') X-Ref |
| Retrieve the permalink for the feed type. param: string $feed Optional, defaults to default feed. Feed type. return: string |
| get_post_comments_feed_link($post_id = '', $feed = '') X-Ref |
| Retrieve the permalink for the post comments feed. param: int $post_id Optional. Post ID. param: string $feed Optional. Feed type. return: string |
| post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) X-Ref |
| Display 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 Descriptive text. param: int $post_id Optional post ID. Default to current post. param: string $feed Optional. Feed format. return: string Link to the comment feed for the current post. |
| get_author_feed_link( $author_id, $feed = '' ) X-Ref |
| Retrieve 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. param: int $author_id ID of an author. param: string $feed Optional. Feed type. return: string Link to the feed for the author specified by $author_id. |
| get_category_feed_link($cat_id, $feed = '') X-Ref |
| Retrieve the feed link for a category. Returns a link to the feed for all post in a given category. A specific feed can be requested or left blank to get the default feed. param: int $cat_id ID of a category. param: string $feed Optional. Feed type. return: string Link to the feed for the category specified by $cat_id. |
| get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) X-Ref |
| Retrieve the feed link for a taxonomy. Returns a link to the feed for all post in a given term. A specific feed can be requested or left blank to get the default feed. param: int $term_id ID of a category. param: string $taxonomy Optional. Taxonomy of $term_id param: string $feed Optional. Feed type. return: string Link to the feed for the taxonomy specified by $term_id and $taxonomy. |
| get_tag_feed_link($tag_id, $feed = '') X-Ref |
| Retrieve permalink for feed of tag. param: int $tag_id Tag ID. param: string $feed Optional. Feed type. return: string |
| get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) X-Ref |
| Retrieve edit tag link. param: int $tag_id Tag ID return: string |
| edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) X-Ref |
| Display or retrieve edit tag link with formatting. param: string $link Optional. Anchor text. param: string $before Optional. Display before edit link. param: string $after Optional. Display after edit link. param: int|object $tag Tag object or ID return: string|null HTML content, if $echo is set to false. |
| get_search_link( $query = '' ) X-Ref |
| Retrieve permalink for search. param: string $query Optional. The query string to use. If empty the current query is used. return: string |
| get_search_feed_link($search_query = '', $feed = '') X-Ref |
| Retrieve the permalink for the feed of the search results. param: string $search_query Optional. Search query. param: string $feed Optional. Feed type. return: string |
| get_search_comments_feed_link($search_query = '', $feed = '') X-Ref |
| Retrieve the permalink for the comments feed of the search results. param: string $search_query Optional. Search query. param: string $feed Optional. Feed type. return: string |
| get_edit_post_link( $id = 0, $context = 'display' ) X-Ref |
| Retrieve edit posts link for post. Can be used within the WordPress loop or outside of it. Can be used with pages, posts, attachments, and revisions. param: int $id Optional. Post ID. param: string $context Optional, default to display. How to write the '&', defaults to '&'. return: string |
| edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) X-Ref |
| Display edit post link for post. param: string $link Optional. Anchor text. param: string $before Optional. Display before edit link. param: string $after Optional. Display after edit link. param: int $id Optional. Post ID. |
| get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) X-Ref |
| Retrieve delete posts link for post. Can be used within the WordPress loop or outside of it, with any post type. param: int $id Optional. Post ID. param: string $deprecated Not used. param: bool $force_delete Whether to bypass trash and force deletion. Default is false. return: string |
| get_edit_comment_link( $comment_id = 0 ) X-Ref |
| Retrieve edit comment link. param: int $comment_id Optional. Comment ID. return: string |
| edit_comment_link( $link = null, $before = '', $after = '' ) X-Ref |
| Display or retrieve edit comment link with formatting. param: string $link Optional. Anchor text. param: string $before Optional. Display before edit link. param: string $after Optional. Display after edit link. return: string|null HTML content, if $echo is set to false. |
| get_edit_bookmark_link( $link = 0 ) X-Ref |
| Display edit bookmark (literally a URL external to blog) link. param: int $link Optional. Bookmark ID. return: string |
| edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) X-Ref |
| Display edit bookmark (literally a URL external to blog) link anchor content. param: string $link Optional. Anchor text. param: string $before Optional. Display before edit link. param: string $after Optional. Display after edit link. param: int $bookmark Optional. Bookmark ID. |
| get_previous_post($in_same_cat = false, $excluded_categories = '') X-Ref |
| Retrieve previous post link that is adjacent to current post. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. return: string |
| get_next_post($in_same_cat = false, $excluded_categories = '') X-Ref |
| Retrieve next post link that is adjacent to current post. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. return: string |
| get_adjacent_post($in_same_cat = false, $excluded_categories = '', $previous = true) X-Ref |
| Retrieve adjacent post link. Can either be next or previous post link. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. param: bool $previous Optional. Whether to retrieve previous post. return: string |
| get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) X-Ref |
| Get adjacent post relational link. Can either be next or previous post relational link. param: string $title Optional. Link title format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. param: bool $previous Optional, default is true. Whether display link to previous post. return: string |
| adjacent_posts_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') X-Ref |
| Display relational links for the posts adjacent to the current post. param: string $title Optional. Link title format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. |
| adjacent_posts_rel_link_wp_head() X-Ref |
| Display 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_cat = false, $excluded_categories = '') X-Ref |
| Display relational link for the next post adjacent to the current post. param: string $title Optional. Link title format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. |
| prev_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') X-Ref |
| Display relational link for the previous post adjacent to the current post. param: string $title Optional. Link title format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. |
| get_boundary_post($in_same_cat = false, $excluded_categories = '', $start = true) X-Ref |
| Retrieve boundary post. Boundary being either the first or last post by publish date within the contraitns specified by in same category or excluded categories. param: bool $in_same_cat Optional. Whether returned post should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. param: bool $previous Optional. Whether to retrieve first post. return: object |
| get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) X-Ref |
| Get boundary post relational link. Can either be start or end post relational link. param: string $title Optional. Link title format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. param: bool $start Optional, default is true. Whether display link to first post. return: string |
| start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') X-Ref |
| Display relational link for the first post. param: string $title Optional. Link title format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. |
| get_index_rel_link() X-Ref |
| Get site index relational link. return: string |
| index_rel_link() X-Ref |
| Display relational link for the site index. |
| get_parent_post_rel_link($title = '%title') X-Ref |
| Get parent post relational link. param: string $title Optional. Link title format. return: string |
| parent_post_rel_link($title = '%title') X-Ref |
| Display relational link for parent item |
| previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') X-Ref |
| Display previous post link that is adjacent to the current post. param: string $format Optional. Link anchor format. param: string $link Optional. Link permalink format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. |
| next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') X-Ref |
| Display next post link that is adjacent to the current post. param: string $format Optional. Link anchor format. param: string $link Optional. Link permalink format. param: bool $in_same_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. |
| adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) X-Ref |
| Display 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_cat Optional. Whether link should be in same category. param: string $excluded_categories Optional. Excluded categories IDs. param: bool $previous Optional, default is true. Whether display link to previous post. |
| get_pagenum_link($pagenum = 1) X-Ref |
| Retrieve get links for page numbers. param: int $pagenum Optional. Page ID. return: string |
| get_next_posts_page_link($max_page = 0) X-Ref |
| Retrieve next posts pages link. Backported from 2.1.3 to 2.0.10. param: int $max_page Optional. Max pages. return: string |
| next_posts( $max_page = 0, $echo = true ) X-Ref |
| Display or return the next posts pages link. param: int $max_page Optional. Max pages. param: boolean $echo Optional. Echo or return; |
| get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) X-Ref |
| Return the next posts pages link. param: string $label Content for link text. param: int $max_page Optional. Max pages. return: string|null |
| next_posts_link( $label = 'Next Page »', $max_page = 0 ) X-Ref |
| Display the next posts pages link. param: string $label Content for link text. param: int $max_page Optional. Max pages. |
| get_previous_posts_page_link() X-Ref |
| Retrieve previous post pages link. Will only return string, if not on a single page or post. Backported to 2.0.10 from 2.1.3. return: string|null |
| previous_posts( $echo = true ) X-Ref |
| Display or return the previous posts pages link. param: boolean $echo Optional. Echo or return; |
| get_previous_posts_link( $label = '« Previous Page' ) X-Ref |
| Return the previous posts pages link. param: string $label Optional. Previous page link text. return: string|null |
| previous_posts_link( $label = '« Previous Page' ) X-Ref |
| Display the previous posts page link. param: string $label Optional. Previous page link text. |
| get_posts_nav_link( $args = array() X-Ref |
| Return post pages link navigation for previous and next pages. param: string|array $args Optional args. return: string The posts link navigation. |
| posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) X-Ref |
| Display post pages link navigation for previous and next pages. param: string $sep Optional. Separator for posts navigation links. param: string $prelabel Optional. Label for previous pages. param: string $nxtlabel Optional Label for next pages. |
| get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) X-Ref |
| Retrieve page numbers links. param: int $pagenum Optional. Page number. return: string |
| get_next_comments_link( $label = '', $max_page = 0 ) X-Ref |
| Return the link to next comments pages. param: string $label Optional. Label for link text. param: int $max_page Optional. Max page. return: string|null |
| next_comments_link( $label = '', $max_page = 0 ) X-Ref |
| Display the link to next comments pages. param: string $label Optional. Label for link text. param: int $max_page Optional. Max page. |
| get_previous_comments_link( $label = '' ) X-Ref |
| Return the previous comments page link. param: string $label Optional. Label for comments link text. return: string|null |
| previous_comments_link( $label = '' ) X-Ref |
| Display the previous comments page link. param: string $label Optional. Label for comments link text. |
| paginate_comments_links($args = array() X-Ref |
| Create pagination links for the comments on the current post. param: string|array $args Optional args. See paginate_links. return: string Markup for pagination links. |
| get_shortcut_link() X-Ref |
| Retrieve shortcut link. Use this in 'a' element 'href' attribute. return: string |
| home_url( $path = '', $scheme = null ) X-Ref |
| Retrieve the home url for the current site. Returns the 'home' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden. param: string $path (optional) Path relative to the home url. param: string $scheme (optional) Scheme to give the home url context. Currently 'http','https' return: string Home url link with optional path appended. |
| get_home_url( $blog_id = null, $path = '', $scheme = null ) X-Ref |
| Retrieve the home url for a given site. Returns the 'home' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden. param: int $blog_id (optional) Blog ID. Defaults to current blog. param: string $path (optional) Path relative to the home url. param: string $scheme (optional) Scheme to give the home url context. Currently 'http','https' return: string Home url link with optional path appended. |
| site_url( $path = '', $scheme = null ) X-Ref |
| Retrieve the site url for the current site. 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. param: string $path Optional. Path relative to the site url. param: string $scheme Optional. Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'. return: string Site url link with optional path appended. |
| get_site_url( $blog_id = null, $path = '', $scheme = null ) X-Ref |
| Retrieve the site url for a given site. 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. param: int $blog_id (optional) Blog ID. Defaults to current blog. param: string $path Optional. Path relative to the site url. param: string $scheme Optional. Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'. return: string Site url link with optional path appended. |
| admin_url( $path = '', $scheme = 'admin' ) X-Ref |
| Retrieve the url to the admin area for the current site. param: string $path Optional path relative to the admin url param: string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. return: string Admin url link with optional path appended |
| get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) X-Ref |
| Retrieve the url to the admin area for a given site. param: int $blog_id (optional) Blog ID. Defaults to current blog. param: string $path Optional path relative to the admin url param: string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. return: string Admin url link with optional path appended |
| includes_url($path = '') X-Ref |
| Retrieve the url to the includes directory. param: string $path Optional. Path relative to the includes url. return: string Includes url link with optional path appended. |
| content_url($path = '') X-Ref |
| Retrieve the url to the content directory. param: string $path Optional. Path relative to the content url. return: string Content url link with optional path appended. |
| plugins_url($path = '', $plugin = '') X-Ref |
| Retrieve the url to the plugins directory or to a specific file within that directory. You can hardcode the plugin slug in $path or pass __FILE__ as a second argument to get the correct folder name. param: string $path Optional. Path relative to the plugins url. param: string $plugin Optional. The plugin file that you want to be relative to - i.e. pass in __FILE__ return: string Plugins url link with optional path appended. |
| network_site_url( $path = '', $scheme = null ) X-Ref |
| Retrieve 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. param: string $path Optional. Path relative to the site url. param: string $scheme Optional. Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'. return: string Site url link with optional path appended. |
| network_home_url( $path = '', $scheme = null ) X-Ref |
| Retrieve the home url for the current network. Returns the home url with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden. param: string $path (optional) Path relative to the home url. param: string $scheme (optional) Scheme to give the home url context. Currently 'http','https' return: string Home url link with optional path appended. |
| network_admin_url( $path = '', $scheme = 'admin' ) X-Ref |
| Retrieve the url to the admin area for the network. param: string $path Optional path relative to the admin url param: string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. return: string Admin url link with optional path appended |
| rel_canonical() X-Ref |
| Output rel=canonical for singular queries |
| wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) X-Ref |
| Return a shortlink for a post, page, attachment, or blog. 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 pre_get_shortlink filter or filter the output via the get_shortlink filter. param: int $id A post or blog id. Default is 0, which means the current post or blog. param: string $contex Whether the id is a 'blog' id, 'post' id, or 'media' id. If 'post', the post_type of the post is consulted. If 'query', the current query is consulted to determine the id and context. Default is 'post'. param: bool $allow_slugs Whether to allow post slugs in the shortlink. It is up to the plugin how and whether to honor this. return: string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks are not enabled. |
| wp_shortlink_wp_head() X-Ref |
| Inject rel=sortlink into head if a shortlink is defined for the current page. Attached to the wp_head action. |
| wp_shortlink_header() X-Ref |
| Send a Link: rel=shortlink header if a shortlink is defined for the current page. Attached to the wp action. |
| the_shortlink( $text = '', $title = '', $before = '', $after = '' ) X-Ref |
| Display the Short Link 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. param: string $before Optional HTML to display after the link. |
| Generated: Fri Jul 30 03:37:10 2010 | Cross-referenced by PHPXref 0.7 |