Title: wp-includes/link-template.php | Page 7 of 7 | Developer.WordPress.org

---

# File: wp-includes/link-template.php

 * hook[attachment_link](https://developer.wordpress.org/reference/hooks/attachment_link/)
 * Filters the permalink for an attachment.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/attachment_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/attachment_link/#uses)
   | Source: [wp-includes/link-template.php:534](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L534-L534)
 * hook[pre_post_link](https://developer.wordpress.org/reference/hooks/pre_post_link/)
 * Filters the permalink structure for a post before token replacement occurs.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pre_post_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_post_link/#uses)
   | Source: [wp-includes/link-template.php:217](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L217-L217)
 * function[get_year_link()](https://developer.wordpress.org/reference/functions/get_year_link/)
 * Retrieves the permalink for the year archives.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/get_year_link/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/functions/get_year_link/#uses)
   | Source: [wp-includes/link-template.php:547](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L547-L569)
 * hook[post_link_category](https://developer.wordpress.org/reference/hooks/post_link_category/)
 * Filters the category that gets used in the %category% permalink token.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/post_link_category/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/post_link_category/#uses)
   | Source: [wp-includes/link-template.php:244](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L244-L244)
 * hook[year_link](https://developer.wordpress.org/reference/hooks/year_link/)
 * Filters the year archive permalink.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/year_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/year_link/#uses)
   | Source: [wp-includes/link-template.php:568](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L568-L568)
 * hook[post_link](https://developer.wordpress.org/reference/hooks/post_link/)
 * Filters the permalink for a post.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/post_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/post_link/#uses)
   | Source: [wp-includes/link-template.php:308](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L308-L308)
 * function[get_post_permalink()](https://developer.wordpress.org/reference/functions/get_post_permalink/)
 * Retrieves the permalink for a post of a custom post type.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/get_post_permalink/#used-by)
   | Uses [9 functions](https://developer.wordpress.org/reference/functions/get_post_permalink/#uses)
   | Source: [wp-includes/link-template.php:324](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L324-L376)
 * hook[post_type_link](https://developer.wordpress.org/reference/hooks/post_type_link/)
 * Filters the permalink for a post of a custom post type.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/post_type_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/post_type_link/#uses)
   | Source: [wp-includes/link-template.php:375](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L375-L375)
 * function[get_page_link()](https://developer.wordpress.org/reference/functions/get_page_link/)
 * Retrieves the permalink for the current page or page ID.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/get_page_link/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/functions/get_page_link/#uses)
   | Source: [wp-includes/link-template.php:391](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L391-L410)
 * hook[page_link](https://developer.wordpress.org/reference/hooks/page_link/)
 * Filters the permalink for a page.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/page_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/page_link/#uses)
   | Source: [wp-includes/link-template.php:409](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L409-L409)
 * hook[user_trailingslashit](https://developer.wordpress.org/reference/hooks/user_trailingslashit/)
 * Filters the trailing-slashed string, depending on whether the site is set to 
   use trailing slashes.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/user_trailingslashit/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/user_trailingslashit/#uses)
   | Source: [wp-includes/link-template.php:65](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L65-L65)
 * function[_get_page_link()](https://developer.wordpress.org/reference/functions/_get_page_link/)
 * Retrieves the page permalink.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/_get_page_link/#used-by)
   | Uses [7 functions](https://developer.wordpress.org/reference/functions/_get_page_link/#uses)
   | Source: [wp-includes/link-template.php:428](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L428-L457)
 * function[permalink_anchor()](https://developer.wordpress.org/reference/functions/permalink_anchor/)
 * Displays the permalink anchor for the current post.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/permalink_anchor/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/permalink_anchor/#uses)
   | Source: [wp-includes/link-template.php:78](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L78-L90)
 * hook[_get_page_link](https://developer.wordpress.org/reference/hooks/_get_page_link/)
 * Filters the permalink for a non-page_on_front page.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/_get_page_link/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/_get_page_link/#uses)
   | Source: [wp-includes/link-template.php:456](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L456-L456)
 * function[the_permalink()](https://developer.wordpress.org/reference/functions/the_permalink/)
 * Displays the permalink for the current post.
 * Used by [4 functions](https://developer.wordpress.org/reference/functions/the_permalink/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/the_permalink/#uses)
   | Source: [wp-includes/link-template.php:17](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L17-L28)
 * hook[the_permalink](https://developer.wordpress.org/reference/hooks/the_permalink/)
 * Filters the display of the permalink for the current post.
 * Used by [2 functions](https://developer.wordpress.org/reference/hooks/the_permalink/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/the_permalink/#uses)
   | Source: [wp-includes/link-template.php:27](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L27-L27)
 * function[user_trailingslashit()](https://developer.wordpress.org/reference/functions/user_trailingslashit/)
 * Retrieves a trailing-slashed string if the site is set for adding trailing slashes.
 * Used by [28 functions](https://developer.wordpress.org/reference/functions/user_trailingslashit/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/user_trailingslashit/#uses)
   | Source: [wp-includes/link-template.php:47](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/link-template.php#L47-L66)

 [Previous Page](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/page/6/?output_format=md)

[1](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/?output_format=md)…
[5](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/page/5/?output_format=md)
[6](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/page/6/?output_format=md)
7