Rewrite API --重写规则API

 

Rewrite API(重写规则API)

Description(描述)


 

WordPress allows theme and plugin developers to programmatically specify new, custom rewrite rules. The following functions (which are mostly aliases for WP_Rewrite methods) can be used to achieve this.html

WordPress容许主题和插件开发人员以编程方式指定新的自定义重写规则。如下功能(主要为wp_rewrite中文方法的别名)能够用来实现这。web

Note that these rules are usually called inside the init hook. Furthermore, permalinks will need to be refreshed (you can do this from your admin under (Settings > Permalinks) before the rewrite changes will take effect. Requires one-time use of flush_rules() to take effect. See also Flushing Rewrite on Activation.注意,这些规则一般在init钩子内部调用。此外,永久连接将须要刷新(你能够从你的管理下(设置> 固定连接)重写以前,修改将生效。。要求一次性使用flush_rules()生效。参见关于激活的刷新重写数据库

API Reference(API引用)

Articles(文章)


 

  • Lesson: Rewrite API Overview
  • Class: WP_Rewrite() - An overview of WordPress's built-in URL rewrite class.
  • 课程:重写API概述
  • Class: WP_Rewrite()【中文 - WordPress内置的URL重写类概述。

Hooks (钩子)

#这些钩子和动做的位置是 WP_Rewrite类 的  rewrite_rules()方法 编程


 

  • Action: generate_rewrite_rules - Runs after all the rules have been created.
  • Filter: root_rewrite_rules - 过滤器,为你的博客的根生成的重写规则。(博客根)【中文】
  • Filter:post_rewrite_rules - Filters,为永久连接的URL生成的重写规则. (文章)
  • Filter: page_rewrite_rules - Filters,为页面生成的重写规则. (页面)
  • Filter: date_rewrite_rules - Filters,为过期的归档URL生成的重写规则. (日期归档)
  • Filter: search_rewrite_rules - Filters,为搜索URL生成的重写规则. (搜索页)
  • Filter: comments_rewrite_rules - Filters,为最新评论订阅 URL生成的重写规则. (评论订阅)
  • Filter: author_rewrite_rules - Filters,为做者归档URL生成的重写规则. (做者归档)
  • Filter: rewrite_rules_array - Filters,此刻的全部重写规则. (全部的重写规则)
  • Filter: {$permastruct}_rewrite_rules - 可用于建立或修改任何自定义固定连接重写规则,如分类自定义文章类型.
  • Action: generate_rewrite_rules -在建立了全部规则以后运行. (after

Functions(函数)


      Categories(分类):ide

相关文章
相关标签/搜索