is_embed

函数
is_embed ( No parameters )
返回值
  • (bool) Whether the query is for an embedded post.
定义位置
相关方法
is_feedis_timeis_homeis_termis_iterable
引入
4.4.0
弃用
-

is_embed: 如果当前页面是一个嵌入的文章或页面,该函数返回真。嵌入的文章或页面是一个显示在另一个页面或文章中的内容,如YouTube视频或社交媒体文章。

查询的是一个嵌入式的文章吗?

function is_embed() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
		return false;
	}

	return $wp_query->is_embed();
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 18:32:58

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: