get_queried_object_id() - WordPress 函数参考中文文档

返回介绍

get_queried_object_id()

发布于 2017-09-11 字数1636 浏览 949 评论 0

get_queried_object_id()

Retrieve ID of the current queried object.


描述

Wrapper for WP_Query::get_queried_object_id().


返回值

(int) ID of the queried object.


源代码

File: wp-includes/query.php

function get_queried_object_id() {
	global $wp_query;
	return $wp_query->get_queried_object_id();
}

更新日志

Version 描述
3.1.0 Introduced.

相关函数

Uses

  • wp-includes/class-wp-query.php:
    WP_Query::get_queried_object_id()

Used By

  • wp-includes/link-template.php:
    wp_get_canonical_url()
  • wp-includes/class-wp-query.php:
    WP_Query::setup_postdata()
  • wp-includes/category-template.php:
    wp_list_categories()
  • wp-includes/link-template.php:
    rel_canonical()
  • wp-includes/link-template.php:
    wp_get_shortlink()
  • wp-includes/template.php:
    get_page_template()
  • wp-includes/post-template.php:
    is_page_template()
  • wp-includes/post-template.php:
    wp_list_pages()
  • wp-includes/canonical.php:
    redirect_canonical()
  • Show 4 more used by
    Hide more used by


User Contributed Notes

上一篇:get_queried_object()

下一篇:get_query_template()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!