wpseek.com
WordPress开发者和主题制作者的搜索引擎



is_post_embeddable › WordPress Function

Since6.8.0
已弃用n/a
› is_post_embeddable ( $post = null )
参数:
  • (int|WP_Post|null) $post Optional. Post ID or `WP_Post` object. Defaults to global $post.
    Required: No
    默认: null
返回:
  • (bool) Whether the post should be considered embeddable.
定义在:
文档:

Determines whether a post is embeddable.



源码

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 );
}