IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    WordPress 查询参数(WordPress Query Vars)完全列表

    Denis发表于 2017-05-16 13:52:06
    love 0

    WordPress 查询参数分公开(Public)和私用(Private),公开就是可以博客链接加入参数就可以查询数据,而私有只能在代码中通过参数传递 WP_Query class。

    WordPress 的公开查询参数

    • attachment
    • attachment_id
    • author
    • author_name
    • cat
    • calendar
    • category_name
    • comments_popup
    • cpage
    • day
    • error
    • exact
    • feed
    • hour
    • m
    • minute
    • monthnum
    • more
    • name
    • order
    • orderby
    • p
    • page_id
    • page
    • paged
    • pagename
    • pb
    • post_type
    • posts
    • preview
    • robots
    • s
    • search
    • second
    • sentence
    • static
    • subpost
    • subpost_id
    • taxonomy
    • tag
    • tb
    • term
    • w
    • withcomments
    • withoutcomments
    • year

    WordPress 的私有查询参数

    • category__in
    • category__not_in
    • category__and
    • comments_per_page
    • offset
    • perm
    • post__in
    • post__not_in
    • post_mime_type
    • post_parent__in
    • tag__and
    • tag__in
    • tag__not_in
    • tag_id
    • tag_slug__and
    • tag_slug__in
    • meta_key
    • meta_value

    WPJAM Basic 新增的公开查询参数

    1. 把 tag_id 设置为公开查询参数。
    2. 如果定义了自定义分类,那么 $custom_taxonomy.'_id' 也会自动被设置为公开查询参数。
    3. 添加了 module 和 action 这两个 Public Query Vars,用于插件的路由规则。

    © 我爱水煮鱼 / RSS 订阅 / 长期承接 WordPress 项目

    有什么问题,请扫描下面二维码到小密圈提问咨询:
    WordPress的小密圈



沪ICP备19023445号-2号
友情链接