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 |
---|---|
29 | /** |
30 | * Filters whether a post has a post thumbnail. |
31 | * |
32 | * @since 5.1.0 |
33 | * |
34 | * @param bool $has_thumbnail true if the post has a post thumbnail, otherwise false. |
35 | * @param int|WP_Post|null $post Post ID or WP_Post object. Default is global `$post`. |
36 | * @param int|string $thumbnail_id Post thumbnail ID or empty string. |
37 | */ |
38 | return (bool) apply_filters( 'has_post_thumbnail', $has_thumbnail, $post, $thumbnail_id ); |
39 | } |
40 |
|
41 | /** |
42 | * Retrieve post thumbnail ID. |
43 | * |
44 | * @since 2.9.0 |
45 | * @since 4.4.0 `$post` can be a post ID or WP_Post object. |
46 | * |
47 | * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. |