функция
since 6.8.0
is_post_embeddable()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
is_post_embeddable( int|WP_Post|null $post = null ): bool
Описание
Определяет, можно ли встроить запись.
Параметры
$post
int|WP_Post|null
необязательный
= null
ID записи или объект WP_Post. По умолчанию глобальный $post.
Возвращаемое значение
bool
Исходный код
wp-includes/post.php:2524
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 );
}
История изменений
| Версия | Описание |
|---|---|
| 6.8.0 | Introduced. |

