站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Query Overview
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
=== 更多关于 <tt>WP->parse_request()</tt>的内容 === As mentioned above, <tt>WP->parse_request()</tt> (part of class <tt>WP</tt> in <tt>wp-includes/classes.php</tt>) parses a URL into a query specification. Here is a summary of the steps it uses to do this: 如上所述,<tt>WP->parse_request()</tt> (class <tt>WP</tt> in <tt>wp-includes/classes.php</tt>的一部分)将URL解析为查询specification。下面是这个步骤的总结: # Strips the GET variable section out of the URL (i.e. anything after a "?" in the URL). Also strips out the blog's home URL. #去除URL中的得到变数部分(例如,URL中"?"后的任何内容)。同时去除博客主页URL。 # Obtains the '''rewrite rules''' that are currently in effect, by calling <tt>$wp_rewrite->wp_rewrite_rules()</tt> (<tt>$wp_rewrite</tt> is an object of class <tt>WP_Rewrite</tt>, which is defined in <tt>wp-includes/rewrite.php</tt>). The rewrite rules are basically a set of pattern matching rules for WordPress permalinks, with a specification of what to do if the pattern matches. For instance, by default there is a rule that would match a stripped permalink like <tt>category/abc</tt>, and its specification says that it means the "abc" category was requested. There is also a rewrite rule for the home page (nothing after the blog URL). # 通过调用<tt>$wp_rewrite->wp_rewrite_rules()</tt> ,得到当前有效的'''rewrite rules''' (<tt>$wp_rewrite</tt>是an object of class <tt>WP_Rewrite</tt>, 定义在<tt>wp-includes/rewrite.php</tt>中)。重写规则基本上是一组WordPress permalinks的模式匹配规则,规定了模式匹配时,应该做什么。例如,默认情况下,有一个规则会匹配stripped permalink像 <tt>category/abc</tt>, 而且规定的意思是需要"abc" 类别。主页也有一个重写规则(博客URL后什么内容也没有)。 # Goes through the rewrite rules in order, until it finds a match between a rewrite rule and the permalink. If nothing is found, it's a 404 error. If a match is found, WordPress extracts the information according to the rule specification. #按顺序查看重写规则,知道找到重写规则和permalink之间的一个匹配。如果什么匹配也没有发现,返回404错误。如果找到了匹配,WordPress根据规则,提取信息。 # Obtains the list of '''query variables''' that is currently in effect. For each query variable, WordPress checks to see if it has been set by permalink parsing, POST submission, or GET submission, and if so, WordPress saves the variable's value into the '''query specification''' array (<tt>$wp->query_vars</tt>, part of class <tt>WP</tt> in <tt>wp-includes/classes.php</tt>). #得到当前有效的一列'''查询变数'''。对于每个查询变数,WordPress检查看这个变数是否由permalink 解析,文章递交,或者得到递交设置了,如果已经设置了,WordPress将变数的值保存到'''query specification'''数组(<tt>$wp->query_vars</tt>, class <tt>WP</tt> in <tt>wp-includes/classes.php</tt>的一部分)。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)