is_post_embeddable()
Determines whether a post is embeddable.
Хуки из функции
Возвращает
true|false
. Whether the post should be considered embeddable.
Использование
is_post_embeddable( $post );
- $post(int|WP_Post|null)
- Post ID or WP_Post object.
По умолчанию: global $post
Список изменений
С версии 6.8.0 | Введена. |
Код is_post_embeddable() is post embeddable WP 6.8.1
function is_post_embeddable( $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $post_type = get_post_type_object( $post->post_type ); if ( ! $post_type ) { return false; } $is_embeddable = $post_type->embeddable; /** * Filter whether a post is embeddable. * * @since 6.8.0 * * @param bool $is_embeddable Whether the post is embeddable. * @param WP_Post $post Post object. */ return apply_filters( 'is_post_embeddable', $is_embeddable, $post ); }