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 |
---|---|
156 | $category, |
157 | $author, |
158 | $post->post_name, |
159 | ); |
160 | $permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) ); |
161 | $permalink = user_trailingslashit($permalink, 'single'); |
162 | } else { // if they're not using the fancy permalink option |
163 | $permalink = home_url('?p=' . $post->ID); |
164 | } |
165 | return apply_filters('post_link', $permalink, $post, $leavename); |
166 | } |
167 |
|
168 | /** |
169 | * Retrieve the permalink for a post with a custom post type. |
170 | * |
171 | * @since 3.0.0 |
172 | * |
173 | * @param int $id Optional. Post ID. |
174 | * @param bool $leavename Optional, defaults to false. Whether to keep post name. |