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.
This hook occurs 2 times in this file.
Line | Code |
---|---|
1222 | $show_on_front = get_option( 'show_on_front' ); |
1223 | $page_for_posts = get_option( 'page_for_posts' ); |
1224 |
|
1225 | if ( 'page' === $show_on_front && $page_for_posts ) { |
1226 | $link = get_permalink( $page_for_posts ); |
1227 | } else { |
1228 | $link = get_home_url(); |
1229 | } |
1230 | /** This filter is documented in wp-includes/link-template.php */ |
1231 | return apply_filters( 'post_type_archive_link', $link, $post_type ); |
1232 | } |
1233 |
|
1234 | if ( ! $post_type_obj->has_archive ) { |
1235 | return false; |
1236 | } |
1237 |
|
1238 | if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) { |
1239 | $struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive; |
1240 | if ( $post_type_obj->rewrite['with_front'] ) { |
Line | Code |
1249 |
|
1250 | /** |
1251 | * Filters the post type archive permalink. |
1252 | * |
1253 | * @since 3.1.0 |
1254 | * |
1255 | * @param string $link The post type archive permalink. |
1256 | * @param string $post_type Post type name. |
1257 | */ |
1258 | return apply_filters( 'post_type_archive_link', $link, $post_type ); |
1259 | } |
1260 |
|
1261 | /** |
1262 | * Retrieves the permalink for a post type archive feed. |
1263 | * |
1264 | * @since 3.1.0 |
1265 | * |
1266 | * @param string $post_type Post type |
1267 | * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. |