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 |
---|---|
1137 | $show_on_front = get_option( 'show_on_front' ); |
1138 | $page_for_posts = get_option( 'page_for_posts' ); |
1139 |
|
1140 | if ( 'page' == $show_on_front && $page_for_posts ) { |
1141 | $link = get_permalink( $page_for_posts ); |
1142 | } else { |
1143 | $link = get_home_url(); |
1144 | } |
1145 | /** This filter is documented in wp-includes/link-template.php */ |
1146 | return apply_filters( 'post_type_archive_link', $link, $post_type ); |
1147 | } |
1148 |
|
1149 | if ( ! $post_type_obj->has_archive ) |
1150 | return false; |
1151 |
|
1152 | if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) { |
1153 | $struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive; |
1154 | if ( $post_type_obj->rewrite['with_front'] ) |
1155 | $struct = $wp_rewrite->front . $struct; |
Line | Code |
1162 |
|
1163 | /** |
1164 | * Filters the post type archive permalink. |
1165 | * |
1166 | * @since 3.1.0 |
1167 | * |
1168 | * @param string $link The post type archive permalink. |
1169 | * @param string $post_type Post type name. |
1170 | */ |
1171 | return apply_filters( 'post_type_archive_link', $link, $post_type ); |
1172 | } |
1173 |
|
1174 | /** |
1175 | * Retrieves the permalink for a post type archive feed. |
1176 | * |
1177 | * @since 3.1.0 |
1178 | * |
1179 | * @param string $post_type Post type |
1180 | * @param string $feed Optional. Feed type. Default empty. |