post_link_category хук-фильтр . WP 3.5.0
Filters the category that gets used in the %category% permalink token.
Использование
add_filter( 'post_link_category', 'filter_function_name_8313', 10, 3 ); function filter_function_name_8313( $cat, $cats, $post ){ // filter... return $cat; }
- $cat(WP_Term)
- The category to use in the permalink.
- $cats(массив)
- Array of all categories (WP_Term objects) associated with the post.
- $post(WP_Post)
- The post in question.
Список изменений
С версии 3.5.0 | Введена. |
Где вызывается хук
wp-includes/link-template.php 192
$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );