WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 18 | /** |
| 19 | * Filters the display of the permalink for the current post. |
| 20 | * |
| 21 | * @since 1.5.0 |
| 22 | * @since 4.4.0 Added the `$post` parameter. |
| 23 | * |
| 24 | * @param string $permalink The permalink for the current post. |
| 25 | * @param int|WP_Post $post Post ID, WP_Post object, or 0. Default 0. |
| 26 | */ |
| 27 | echo esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) ); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
| 32 | * |
| 33 | * Conditionally adds a trailing slash if the permalink structure has a trailing |
| 34 | * slash, strips the trailing slash if not. The string is passed through the |
| 35 | * {@see 'user_trailingslashit'} filter. Will remove trailing slash from string, if |
| 36 | * site is not set to have them. |