is_sticky
Filters whether a post is sticky.
Usage
add_filter( 'is_sticky', 'wp_kama_is_sticky_filter', 10, 2 );
/**
* Function for `is_sticky` filter-hook.
*
* @param bool $is_sticky Whether a post is sticky.
* @param int $post_id Post ID.
*
* @return bool
*/
function wp_kama_is_sticky_filter( $is_sticky, $post_id ){
// filter...
return $is_sticky;
}
- $is_sticky(true|false)
- Whether a post is sticky.
- $post_id(int)
- Post ID.
Changelog
| Since 5.3.0 | Introduced. |
Where the hook is called
is_sticky
wp-includes/post.php 2901
return apply_filters( 'is_sticky', $is_sticky, $post_id );