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