WordPress: Inline Documentation:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: This page is the start of the effort to add inline documentation to the WordPress core code to aid in future development, improvements and changes, as well as to assist others when learni...)
 
无编辑摘要
第1行: 第1行:
This page is the start of the effort to add inline documentation to the WordPress core code to aid in future development, improvements and changes, as well as to assist others when learning about PHP and WordPress.
This page is the start of the effort to add inline documentation to the WordPress core code to aid in future development, improvements and changes, as well as to assist others when learning about PHP and WordPress.
本页面是添加内嵌文档到WordPress核心代码来帮助将来的发展,改进和更新的起点,同样也是在学习PHP 和 WordPress时帮助别人。


Use of this page and subsequent child pages is meant for developing standard methodologies and formats, as well as to ensure that there is no duplication of effort. In the best case, inline documentation should appear as close to this [http://pear.php.net/manual/en/standards.sample.php PEAR sample].
Use of this page and subsequent child pages is meant for developing standard methodologies and formats, as well as to ensure that there is no duplication of effort. In the best case, inline documentation should appear as close to this [http://pear.php.net/manual/en/standards.sample.php PEAR sample].
本页面以及后来的子页面意味这开发标准方法和格式,也是为了保证没有副作用。在最好的情况下,内嵌文档应该出现在靠近这个[http://pear.php.net/manual/en/standards.sample.php PEAR 样本]的地方。


== What Should be Documented ==
== What Should be Documented ==


Documenting globals gives information for phpDocumentor and others reading the source code on how the global is used. It isn't required and in most cases not necessary, since the core developers may not  accept the patches.
Documenting globals gives information for phpDocumentor and others reading the source code on how the global is used. It isn't required and in most cases not necessary, since the core developers may not  accept the patches.
== 什么应该备有资料文献 ==
备份phpDocumentor的资料文献,和其他关于global如何使用的阅读源代码。它不是必需的,而且在大多数时候都不是必需的,因为核心开发人员可能不能接受这个补丁。


Functions and class methods are often difficult to be used without context. Documentation can offer context, but inline documentation should not be used for giving extreme examples, except for small lines of code where codex information is not immediately available.
Functions and class methods are often difficult to be used without context. Documentation can offer context, but inline documentation should not be used for giving extreme examples, except for small lines of code where codex information is not immediately available.
函数和类方法在没有上下文环境的时候很难使用。文件可以提供上下文,但是内嵌文档不应该用来给出极端的例子,除非在codex 信息不能立即获得的小行代码中。


Most of the classes used in WordPress are Singletons (the entire functionality is contained in a single class), but often require initializing of properties manually. Often the question of when to use a method in a class is not clear in most situations.
Most of the classes used in WordPress are Singletons (the entire functionality is contained in a single class), but often require initializing of properties manually. Often the question of when to use a method in a class is not clear in most situations.
多数WordPress中使用的类都是单独的(全部的功能包含在一个单独的类中), 但是通常要求手动初始化属性。大多数情况下什么时候在类中使用方法是不清楚的。


Newer class additions and some external libraries use multiple classes to form a library for functionality. This creates a higher learning curve as the base class (the class the developer uses that provides the functionality from all of the rest of the classes) is not clear. Adding documentation on where the class falls in the class library hierarchy provides more clarity.
Newer class additions and some external libraries use multiple classes to form a library for functionality. This creates a higher learning curve as the base class (the class the developer uses that provides the functionality from all of the rest of the classes) is not clear. Adding documentation on where the class falls in the class library hierarchy provides more clarity.


The properties of classes need to be documented for class documentation completeness. The PHPdoc tags for those can be found at the main site and an example can be found below.
The properties of classes need to be documented for class documentation completeness. The PHPdoc tags for those can be found at the main site and an example can be found below.
新的附加类和一些外部的库使用多种类来组成有某种功能的库。这创建了一个更高的学习曲线,因为基类(开发者用来提供从所有其他类获得其功能的类) 不清楚。给类所在的类库层次中添加文档会提供更高的清晰度。
为了类资料的完整性,类的属性需要备有资料文献。用于这功能的PHPdoc 标签可以在主页找到,例子可以在下面找到。


== PHPdoc Tags==
== PHPdoc Tags==


PHPDoc tags work with some editors to display more information about a piece of code. It is useful to developers using those editors to understand what the purpose and where they would use it in their code.
PHPDoc tags work with some editors to display more information about a piece of code. It is useful to developers using those editors to understand what the purpose and where they would use it in their code.
== PHPdoc标签==
PHPDoc 标签和一些编辑器一起显示更多有关于一段代码的信息。对开发者使用那些编辑器来了解目标是什么以及在他们的代码中能在什么地方使用是很有用的。


The convention for allow PHPdoc blocks is to have @since information (even if not available at the time) and @package information, which should always be "WordPress" unless it is an external library.
The convention for allow PHPdoc blocks is to have @since information (even if not available at the time) and @package information, which should always be "WordPress" unless it is an external library.
<pre>
/**
* ... Description(s) here
*
* @package WordPress
* @since 2.1 or {{@internal Unknown}}}
*
* ... More information if needed.
*/
</pre>
允许PHPdoc 模块的惯例是含有@since 信息(尽管目前不可用)和@package信息, 必须是"WordPress",除非是一个外部库。


<pre>
<pre>
第33行: 第66行:


You will not use PHPdoc comment blocks inside function and method blocks, except to document "TODO" information. All other comments inside methods and functions should not use PHPdoc comments.
You will not use PHPdoc comment blocks inside function and method blocks, except to document "TODO" information. All other comments inside methods and functions should not use PHPdoc comments.
<pre>
/**
* @todo ... Description
*/
</pre>
Or the second form can be used is most cases.
<pre>/** @todo ... Description */</pre>
在函数和方法模块内不能使用PHPdoc注释模块,除非提供 "TODO" 信息。 所有其他的方法和函数内不能使用PHPdoc注释。


<pre>
<pre>
第48行: 第92行:


Not necessary for WordPress core files, but might be useful for your own plugins, if you split the code into logical files.
Not necessary for WordPress core files, but might be useful for your own plugins, if you split the code into logical files.
<pre>
/**
* This file holds all of the users
* custom information
*/
require ABSPATH.'/wp-config.php';
</pre>
== 映射Includes 和Requires ==
为includes和requires准备资料文献,对于解释包括的文件和现有的文件有什么关系,以及为什么需要它和在它里面能找到些什么是很有用的。
对于WordPress核心文件来说并不是必需的,但是如果你吧代码分成逻辑文件的话,可能对你的插件很有用。


<pre>
<pre>
第62行: 第120行:


Some PHPdoc tags can be applied globally to every other PHPdoc comment block for phpDocumentor sites.
Some PHPdoc tags can be applied globally to every other PHPdoc comment block for phpDocumentor sites.
<pre>
/**
* ... Description of what is contained in file here
*
* @package WordPress
*/
</pre>
== 文件资料 ==
文件资料使用PHPdoc注释模块,可以用来给出一个关于在文件中有什么内容和能找到什么东西的总览。充分使用它的优点可以阻止过于深入的查看文件和防止浪费时间。
一些PHPdoc标签可以为phpDocumentor站点全局应用到其他每一个PHPdoc 注释模块中。


<pre>
<pre>
第84行: 第156行:
  */
  */
</pre>
</pre>
== 全局PHPdoc注释模块 ==
它对于准备一般用于函数@uses参数的全局资料通常是有用的。
先得到描述信息,因为那是编码器所需要的。其他的信息也许也重要, 用@since举例,@ global标签只对phpDocumentator站点有用。
<pre>
/**
* ... Description
* @since
* @global    type    $varname
*/
</pre>


== Function PHPdoc ==
== Function PHPdoc ==
第90行: 第177行:


The short description must include the function name with only the parenthesize '()'. The short description should not restate what the function name is, but look deeper in to what the function does (the code) and summarize that. The function name might say one thing, but actually do something completely different (the specs changed, but the usage did not).
The short description must include the function name with only the parenthesize '()'. The short description should not restate what the function name is, but look deeper in to what the function does (the code) and summarize that. The function name might say one thing, but actually do something completely different (the specs changed, but the usage did not).
== 函数 PHPdoc ==
WordPress 函数 PHPdoc类型包括短描述和长描述(如果适用的话).
短描述必须包括只带括号'()'的函数名字。短描述不应该重复说名函数名是什么,而应该深入一些描述这个函数是做什么的(代码)并作总结。函数名字可能表达了什么,但事实上做的却是完全不同的东西(规格改变了但是用法没有变)。


The short description is required for the documentation of the function to be considered complete. A note may be left in certain circumstances, see below, that lets others know that the short description is missing.
The short description is required for the documentation of the function to be considered complete. A note may be left in certain circumstances, see below, that lets others know that the short description is missing.
<pre>
/**
* function_name() - Short Description
</pre>
短描述要求完全考虑到这个函数的文献资料。在特殊情况下可能会留下记录,如下,让人知道短描述丢失了。


<pre>
<pre>
第101行: 第201行:


In rare cases, the function is so short that the summary can be used to describe the full extent of the function's purpose. It is up to the documentation author's judgment, but as a rule always try to include the long descriptions in the PHPdoc block.  
In rare cases, the function is so short that the summary can be used to describe the full extent of the function's purpose. It is up to the documentation author's judgment, but as a rule always try to include the long descriptions in the PHPdoc block.  
<pre>
/**
* function_name() - Short Description
*
* Long Description
*
*/
</pre>
长描述应该包含在大多数的函数中,来清楚地给出短描述包含的意思。大多数情况下,摘要只是作为在长描述中编码器读取的提示。
极少情况下,函数非常的短,摘要就可以描述全部的函数目的范围了。这取决于文献资料作者的判断,但是作为一个规则,应该尝试吧长描述包括到PHPdoc 模块中去。


<pre>
<pre>
第112行: 第225行:


It is acceptable if the function does not have parameter or return documentation to leave a note that the short and long descriptions are missing. This should only be used when you are writing documentation for a multiple functions are only leaving a note that you intentionally left that area blank for someone else or for yourself to complete later.
It is acceptable if the function does not have parameter or return documentation to leave a note that the short and long descriptions are missing. This should only be used when you are writing documentation for a multiple functions are only leaving a note that you intentionally left that area blank for someone else or for yourself to complete later.
<pre>
/**
* function_name() - {{@internal Missing Short Description}}}
*
* {{@internal Missing Long Description}}}
*
*/
</pre>
如果函数没有参数,或者返回资料留下短和长描述丢失的记录,这是可以接受的。这只能在你为一个多重函数写资料时,留下一个你专门为别人或者你自己留下空白以便将来完成的记录时,才可以使用。


<pre>
<pre>
第127行: 第251行:


After the short and long description, other information is important to the coder and phpDocumentor sites.
After the short and long description, other information is important to the coder and phpDocumentor sites.
<pre>
/**
* function_name() - Short Description
*
* Long Description
*
* @package WordPress
* @since version
*
* @param    type    $varname    Description
* @return  type                Description
*/
</pre>
对于其他提醒你或者你本不想留下空白的标签。其他时候,它应该被认为是有人故意留下空白,或者是不认为描述对于别人理解函数是必须的。信息可能并不服务于某种目的,如果在别的地方也可以找到的话。如,在使用@uses标签时,如果全局变量已经拥有资料时。
<pre> * @uses function_name() {{@internal Missing Description}}}</pre>
在短和长描述后,别的信息对于编码器和phpDocumentor 站点也是很重要的。


<pre>
<pre>
第143行: 第287行:


The convention for @since is to use just the version number, "2.1", or "2.3.1" and leave off any other strings. The @package information gives coders and phpDocumentor which application the function and therefore the @since application the version number belongs to.
The convention for @since is to use just the version number, "2.1", or "2.3.1" and leave off any other strings. The @package information gives coders and phpDocumentor which application the function and therefore the @since application the version number belongs to.
@since的惯例是只使用版本号,"2.1",或者"2.3.1",并且停止其他的字符串。 @package 信息给出了编码器和请求函数用的phpDocumentor,这样@since 就会请求属于它的版本号。


For consistency, if parameters are available, they must always be documented for every function. If the "return" keyword is used anywhere in the function, then the @return tag should be used to document that possible case. If it does not exist, then it is best to not include the tag, because if it exists, the reader might expect it to have the "return" keyword.
For consistency, if parameters are available, they must always be documented for every function. If the "return" keyword is used anywhere in the function, then the @return tag should be used to document that possible case. If it does not exist, then it is best to not include the tag, because if it exists, the reader might expect it to have the "return" keyword.
为了保持一致,如果参数可用,它们必须为每个函数建立资料文献。如果"return" 关键词在函数中的任何地方使用,那么@return标签应该被用来建立可能的资料。 如果它不存在的话,最好就不要包含这个标签,因为如果它存在,读者可能希望它能有 "return" 这个关键词。


If the function is deprecated, should not be used any longer, then the @deprecated tag along with the version and description of what to use instead should be given. Also include the @uses tag with the function name.
If the function is deprecated, should not be used any longer, then the @deprecated tag along with the version and description of what to use instead should be given. Also include the @uses tag with the function name.
<pre>
/**
* ... Descriptions
*
* @deprecated 2.1  Use function_name() instead.
* @uses function_name()
*
* ... parameters and return descriptions
*/
</pre>
如果函数被反对,就不应该继续使用了,然后会给出@deprecated 标签连同办不办和使用哪些作为替代的描述。同样包括带有函数名字的@uses标签。


<pre>
<pre>
第164行: 第325行:


The [http://pear.php.net/manual/en/standards.sample.php PEAR sample] should be referenced for the tags to use for each.
The [http://pear.php.net/manual/en/standards.sample.php PEAR sample] should be referenced for the tags to use for each.
== 类PHPdoc 标签 ==
关于类PHPdoc标签的在WordPress类中使用的信息是故意删除的。注意类的定义,属性(变量),和类方法(函数)都需要建立文献资料。
[http://pear.php.net/manual/en/standards.sample.php PEAR 样本]应该用来作为这些标签的使用的参考。


==Past WP-Hackers Discussions==
==Past WP-Hackers Discussions==
第172行: 第339行:
*[http://comox.textdrive.com/pipermail/wp-hackers/2006-February/004989.html PATCH Documentation] (February 2006)
*[http://comox.textdrive.com/pipermail/wp-hackers/2006-February/004989.html PATCH Documentation] (February 2006)
*[http://comox.textdrive.com/pipermail/wp-hackers/2007-October/015584.html Proposal for a function commenting convention ] (October 2007)
*[http://comox.textdrive.com/pipermail/wp-hackers/2007-October/015584.html Proposal for a function commenting convention ] (October 2007)
==过去的 WP-Hackers 讨论==
WP-Hackers列表有大量过去的关于添加内嵌文档的讨论。在最近的一些案例中,这个页面无法在讨论中引用或者被发现。通过给WordPress文件建立资料,关于WP-Hackers和别的东西的讨论可以结束了,如果足够的努力放到给这些文件建立档案文献的话。
*[http://comox.textdrive.com/pipermail/wp-hackers/2006-February/004921.html 内嵌文档] (February 2006)
*[http://comox.textdrive.com/pipermail/wp-hackers/2006-February/004989.html PATCH 文档] (February 2006)
*[http://comox.textdrive.com/pipermail/wp-hackers/2007-October/015584.html 函数注释约定建议] (October 2007)


==Resources==
==Resources==
第179行: 第354行:
*[http://www.zend.com/store/products/zend-studio/ Zend Studio] - PHP Development Environment (commercial product)
*[http://www.zend.com/store/products/zend-studio/ Zend Studio] - PHP Development Environment (commercial product)
* At aptana.tv there is [http://www.aptana.tv/movies/aptana_scriptdoc_overview/ScriptDocOverview.html a video showing the power of proper inline documentation]. Some tags are really helpful as you can see there.
* At aptana.tv there is [http://www.aptana.tv/movies/aptana_scriptdoc_overview/ScriptDocOverview.html a video showing the power of proper inline documentation]. Some tags are really helpful as you can see there.
==资源==
* [http://phpxref.com/xref/wordpress/nav.html.gz?index.html.gz 英文版]
*[http://www.phpdoc.org/ phpDocumentor] –为php语言自动建立档案的工具  (phpdoc.org)
*[http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html phpDocumentor 指南] – 如何使用 phpDocumentor (phpdoc.org)
*[http://www.zend.com/store/products/zend-studio/ Zend 工作室] - PHP 开发环境 (商业产品)
* 在 aptana.tv 有 [http://www.aptana.tv/movies/aptana_scriptdoc_overview/ScriptDocOverview.html 一个视频展示出适当的内嵌文档的力量]. 一些标签就如你在那看到的一样,非常有用。


==Files with Inline Documentation==
==Files with Inline Documentation==


For a list of current files in WordPress, see [[WordPress:WordPress Files]].
For a list of current files in WordPress, see [[WordPress:WordPress Files]].
==拥有内嵌文档的文件==
想得到一个WordPress中现有文件的列表,参见[[WordPress:WordPress 文件]].


===External Library Files===
===External Library Files===


Third party libraries should have file level documentation, but should not be part of the WordPress documentation effort. The following third party files have file level documentation. Below is the list of external files in WordPress 2.5 (1/10/2008).
Third party libraries should have file level documentation, but should not be part of the WordPress documentation effort. The following third party files have file level documentation. Below is the list of external files in WordPress 2.5 (1/10/2008).
===外部库文件===
第三方的库应该有文件级别的资料,但是不应该成为WordPress文档资料的一部分。 下面这些第三方文件都拥有文件级别的资料。下面是WordPress 2.5 中的外部文件列表(1/10/2008).


'''All external library files are completed'''
'''All external library files are completed'''
第196行: 第386行:
* /wp-includes/class-pop3.php
* /wp-includes/class-pop3.php
* /wp-includes/class-smtp.php (does not need file level documentation because it has class level documentation)
* /wp-includes/class-smtp.php (does not need file level documentation because it has class level documentation)
* /wp-includes/class-snoopy.php
* /wp-includes/gettext.php
* /wp-includes/streams.php
* /wp-includes/rss.php
* /wp-includes/rss-functions.php (deprecated)
'''所有的外部库文件都完成了'''
* /wp-includes/atomlib.php
* /wp-includes/class-IXR.php
* /wp-includes/class-phpass.php
* /wp-includes/class-phpmailer.php (不需要文件级别的资料,因为它有类级别的资料)
* /wp-includes/class-pop3.php
* /wp-includes/class-smtp.php (不需要文件级别的资料,因为它有类级别的资料)
* /wp-includes/class-snoopy.php
* /wp-includes/class-snoopy.php
* /wp-includes/gettext.php
* /wp-includes/gettext.php
第205行: 第409行:


These files have complete PHPdoc style documentation. Listed are the documentation writer, along with the WordPress Trac ticket number.
These files have complete PHPdoc style documentation. Listed are the documentation writer, along with the WordPress Trac ticket number.
===WordPress 完成的文件===
这些文件已经完成了PHPdoc 样式资料。列出的部分是资料作者,连同 WordPress Trac ticket 号码。


# [http://trac.wordpress.org/ticket/5211 #5211] - /wp-settings.php - Jacob Santos (Use as an example for other files)
# [http://trac.wordpress.org/ticket/5211 #5211] - /wp-settings.php - Jacob Santos (Use as an example for other files)
第227行: 第437行:
# [http://trac.wordpress.org/ticket/3852 #3852] - /wp-includes/plugin.php - Martin Sturm and cleanup by Jacob Santos  ([http://trac.wordpress.org/ticket/5225 #5225])
# [http://trac.wordpress.org/ticket/3852 #3852] - /wp-includes/plugin.php - Martin Sturm and cleanup by Jacob Santos  ([http://trac.wordpress.org/ticket/5225 #5225])
# [http://trac.wordpress.org/ticket/4383 #4383] - /wp-includes/registration.php - Robin Adrianse and cleanup by Jacob Santos
# [http://trac.wordpress.org/ticket/4383 #4383] - /wp-includes/registration.php - Robin Adrianse and cleanup by Jacob Santos
# [http://trac.wordpress.org/ticket/5572 #5572] - /wp-includes/registration-functions.php - Jacob Santos
# [http://trac.wordpress.org/ticket/4742 #4742] - /wp-includes/taxonomy.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5513 #5513] - /wp-includes/template-loader.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5233 #5233] - /wp-includes/update.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5572 #5572] - /wp-includes/vars.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5572 #5572] - /wp-includes/version.php - Jacob Santos
# [http://trac.wordpress.org/ticket/2474 #2474] - /wp-includes/wpdb.php - Robert Deaton
# [http://trac.wordpress.org/ticket/5211 #5211] - /wp-settings.php - Jacob Santos (作为其他文件的示例使用)
# [http://trac.wordpress.org/ticket/4393 #4393] - /wp-includes/author-template.php - Robin Adrianse 和清除 by Jacob Santos
# [http://trac.wordpress.org/ticket/5523 #5523] - /wp-includes/bookmark.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5521 #5521] - /wp-includes/bookmark-template.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5511 #5511] - /wp-includes/cache.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5526 #5526] - /wp-includes/canonical.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5528 #5528] - /wp-includes/comment-template.php - Jacob Santos (help from Peter Walker [http://trac.wordpress.org/ticket/2648 #2648])
# [http://trac.wordpress.org/ticket/5510 #5510] - /wp-includes/compat.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/default-filters.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/feed-rss2-comments.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/feed-rss2.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/feed-rdf.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/feed-atom-comments.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/feed-rss.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5527 #5527] - /wp-includes/feed-atom.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5641 #5641] - /wp-includes/kses.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5590 #5590] - /wp-includes/l10n.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5621 #5621] - /wp-includes/locale.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5509 #5509] - /wp-includes/pluggable.php – 由 Jacob Santos在Robert Deaton来自[http://trac.wordpress.org/ticket/2477 #2477]的补丁的基础上更新
# [http://trac.wordpress.org/ticket/3852 #3852] - /wp-includes/plugin.php - Martin Sturm 和清除 by Jacob Santos  ([http://trac.wordpress.org/ticket/5225 #5225])
# [http://trac.wordpress.org/ticket/4383 #4383] - /wp-includes/registration.php - Robin Adrianse 和清除 by Jacob Santos
# [http://trac.wordpress.org/ticket/5572 #5572] - /wp-includes/registration-functions.php - Jacob Santos
# [http://trac.wordpress.org/ticket/5572 #5572] - /wp-includes/registration-functions.php - Jacob Santos
# [http://trac.wordpress.org/ticket/4742 #4742] - /wp-includes/taxonomy.php - Jacob Santos
# [http://trac.wordpress.org/ticket/4742 #4742] - /wp-includes/taxonomy.php - Jacob Santos
第261行: 第501行:


* [http://trac.wordpress.org/ticket/3970 #3970] - /wp-admin/admin-functions.php - Started by Sabin Iacob
* [http://trac.wordpress.org/ticket/3970 #3970] - /wp-admin/admin-functions.php - Started by Sabin Iacob
 
===未完成的文件===
如果你想通过文件或者函数进行资料编写,那么每个文件都应该有个标签,作为工作的一部分,做完这个之后再添加到列表中。这些文件已经开始并且完成后可以使用一些帮助。
# [http://trac.wordpress.org/ticket/5632 #5632] - /wp-includes/capabilities.php – 由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5633 #5633] - /wp-includes/category.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5634 #5634] - /wp-includes/category-template.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5635 #5635] - /wp-includes/classes.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5637 #5637] - /wp-includes/cron.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5578 #5578] - /wp-includes/comment.php – 在Peter Walker的来自[http://trac.wordpress.org/ticket/2648 #2648]的补丁的基础上由Jacob Santos更新
# [http://trac.wordpress.org/ticket/5636 #5636] - /wp-includes/feed.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5638 #5638] - /wp-includes/formatting.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5639 #5639] - /wp-includes/functions.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5640 #5640] - /wp-includes/general-template.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/5642 #5642] - /wp-includes/link-template.php -由 Jacob Santos开始
# [http://trac.wordpress.org/ticket/3982 #3982] - /wp-includes/post.php – 由Scott Merrill开始, Jacob Santos在[http://trac.wordpress.org/ticket/2473 #2473]的部分基础上更新
# [http://trac.wordpress.org/ticket/0000 #0000] - /wp-includes/post-template.php – 由你开始
# [http://trac.wordpress.org/ticket/0000 #0000] - /wp-includes/query.php - 由你开始
# [http://trac.wordpress.org/ticket/0000 #0000] - /wp-includes/script-loader.php -由你开始
# [http://trac.wordpress.org/ticket/0000 #0000] - /wp-includes/theme.php -由你开始
# [http://trac.wordpress.org/ticket/5512 #5512] - /wp-includes/user.php – 由Jacob Santos开始
# [http://trac.wordpress.org/ticket/0000 #0000] - /wp-includes/widgets.php -由你开始
这个票已经过期因为admin-functions.php 不再使用并且在2.5+版本失效了. 文献资料对于转移到wp-admin/includes/*.* 文件夹下的函数仍然好用
* [http://trac.wordpress.org/ticket/3970 #3970] - /wp-admin/admin-functions.php – 由 Sabin Iacob开始

2008年5月7日 (三) 18:02的版本

This page is the start of the effort to add inline documentation to the WordPress core code to aid in future development, improvements and changes, as well as to assist others when learning about PHP and WordPress.

本页面是添加内嵌文档到WordPress核心代码来帮助将来的发展,改进和更新的起点,同样也是在学习PHP 和 WordPress时帮助别人。

Use of this page and subsequent child pages is meant for developing standard methodologies and formats, as well as to ensure that there is no duplication of effort. In the best case, inline documentation should appear as close to this PEAR sample.

本页面以及后来的子页面意味这开发标准方法和格式,也是为了保证没有副作用。在最好的情况下,内嵌文档应该出现在靠近这个PEAR 样本的地方。

What Should be Documented

Documenting globals gives information for phpDocumentor and others reading the source code on how the global is used. It isn't required and in most cases not necessary, since the core developers may not accept the patches.

什么应该备有资料文献

备份phpDocumentor的资料文献,和其他关于global如何使用的阅读源代码。它不是必需的,而且在大多数时候都不是必需的,因为核心开发人员可能不能接受这个补丁。

Functions and class methods are often difficult to be used without context. Documentation can offer context, but inline documentation should not be used for giving extreme examples, except for small lines of code where codex information is not immediately available.

函数和类方法在没有上下文环境的时候很难使用。文件可以提供上下文,但是内嵌文档不应该用来给出极端的例子,除非在codex 信息不能立即获得的小行代码中。

Most of the classes used in WordPress are Singletons (the entire functionality is contained in a single class), but often require initializing of properties manually. Often the question of when to use a method in a class is not clear in most situations.

多数WordPress中使用的类都是单独的(全部的功能包含在一个单独的类中), 但是通常要求手动初始化属性。大多数情况下什么时候在类中使用方法是不清楚的。

Newer class additions and some external libraries use multiple classes to form a library for functionality. This creates a higher learning curve as the base class (the class the developer uses that provides the functionality from all of the rest of the classes) is not clear. Adding documentation on where the class falls in the class library hierarchy provides more clarity.

The properties of classes need to be documented for class documentation completeness. The PHPdoc tags for those can be found at the main site and an example can be found below.

新的附加类和一些外部的库使用多种类来组成有某种功能的库。这创建了一个更高的学习曲线,因为基类(开发者用来提供从所有其他类获得其功能的类) 不清楚。给类所在的类库层次中添加文档会提供更高的清晰度。

为了类资料的完整性,类的属性需要备有资料文献。用于这功能的PHPdoc 标签可以在主页找到,例子可以在下面找到。

PHPdoc Tags

PHPDoc tags work with some editors to display more information about a piece of code. It is useful to developers using those editors to understand what the purpose and where they would use it in their code.

PHPdoc标签

PHPDoc 标签和一些编辑器一起显示更多有关于一段代码的信息。对开发者使用那些编辑器来了解目标是什么以及在他们的代码中能在什么地方使用是很有用的。

The convention for allow PHPdoc blocks is to have @since information (even if not available at the time) and @package information, which should always be "WordPress" unless it is an external library.

/**
 * ... Description(s) here
 *
 * @package WordPress
 * @since 2.1 or {{@internal Unknown}}}
 *
 * ... More information if needed.
 */

允许PHPdoc 模块的惯例是含有@since 信息(尽管目前不可用)和@package信息, 必须是"WordPress",除非是一个外部库。

/**
 * ... Description(s) here
 *
 * @package WordPress
 * @since 2.1 or {{@internal Unknown}}}
 *
 * ... More information if needed.
 */

You will not use PHPdoc comment blocks inside function and method blocks, except to document "TODO" information. All other comments inside methods and functions should not use PHPdoc comments.

/**
 * @todo ... Description
 */

Or the second form can be used is most cases.

/** @todo ... Description */

在函数和方法模块内不能使用PHPdoc注释模块,除非提供 "TODO" 信息。 所有其他的方法和函数内不能使用PHPdoc注释。

/**
 * @todo ... Description
 */

Or the second form can be used is most cases.

/** @todo ... Description */

Mapping Includes and Requires

Documenting includes and requires can be useful to explain what relationship the included file has to the current file and why it is needed and what can be found in it.

Not necessary for WordPress core files, but might be useful for your own plugins, if you split the code into logical files.

/** 
 * This file holds all of the users
 * custom information
 */
require ABSPATH.'/wp-config.php';

映射Includes 和Requires

为includes和requires准备资料文献,对于解释包括的文件和现有的文件有什么关系,以及为什么需要它和在它里面能找到些什么是很有用的。

对于WordPress核心文件来说并不是必需的,但是如果你吧代码分成逻辑文件的话,可能对你的插件很有用。

/** 
 * This file holds all of the users
 * custom information
 */
require ABSPATH.'/wp-config.php';

File Documentation

File documentation using PHPdoc comment blocks can be used to give an overview on what the file holds and what can be found in the file. Used to its full advantage may prevent someone from exploring the file too deeply and wasting their time.

Some PHPdoc tags can be applied globally to every other PHPdoc comment block for phpDocumentor sites.

/**
 * ... Description of what is contained in file here
 *
 * @package WordPress
 */

文件资料

文件资料使用PHPdoc注释模块,可以用来给出一个关于在文件中有什么内容和能找到什么东西的总览。充分使用它的优点可以阻止过于深入的查看文件和防止浪费时间。

一些PHPdoc标签可以为phpDocumentor站点全局应用到其他每一个PHPdoc 注释模块中。

/**
 * ... Description of what is contained in file here
 *
 * @package WordPress
 */

Global PHPdoc Comment Block

Often it is useful to document globals that are commonly used for the function @uses reference.

It is better to have the description first as it is what the coder needs. The rest of the information might be important, @since for example, but @global tag is only useful for phpDocumentator sites.

/**
 * ... Description 
 * @since
 * @global    type    $varname
 */

全局PHPdoc注释模块

它对于准备一般用于函数@uses参数的全局资料通常是有用的。

先得到描述信息,因为那是编码器所需要的。其他的信息也许也重要, 用@since举例,@ global标签只对phpDocumentator站点有用。

/**
 * ... Description 
 * @since
 * @global    type    $varname
 */


Function PHPdoc

The convention for WordPress function PHPdoc types includes the short description and long description (if applicable).

The short description must include the function name with only the parenthesize '()'. The short description should not restate what the function name is, but look deeper in to what the function does (the code) and summarize that. The function name might say one thing, but actually do something completely different (the specs changed, but the usage did not).

函数 PHPdoc

WordPress 函数 PHPdoc类型包括短描述和长描述(如果适用的话).

短描述必须包括只带括号'()'的函数名字。短描述不应该重复说名函数名是什么,而应该深入一些描述这个函数是做什么的(代码)并作总结。函数名字可能表达了什么,但事实上做的却是完全不同的东西(规格改变了但是用法没有变)。

The short description is required for the documentation of the function to be considered complete. A note may be left in certain circumstances, see below, that lets others know that the short description is missing.

/**
 * function_name() - Short Description

短描述要求完全考虑到这个函数的文献资料。在特殊情况下可能会留下记录,如下,让人知道短描述丢失了。

/**
 * function_name() - Short Description

Long descriptions should be included in most functions to give clarity to what the short description means. In most cases, the summary should only serve as a reminder to what the coder read in the long description.

In rare cases, the function is so short that the summary can be used to describe the full extent of the function's purpose. It is up to the documentation author's judgment, but as a rule always try to include the long descriptions in the PHPdoc block.

/**
 * function_name() - Short Description
 * 
 * Long Description
 *
 */

长描述应该包含在大多数的函数中,来清楚地给出短描述包含的意思。大多数情况下,摘要只是作为在长描述中编码器读取的提示。

极少情况下,函数非常的短,摘要就可以描述全部的函数目的范围了。这取决于文献资料作者的判断,但是作为一个规则,应该尝试吧长描述包括到PHPdoc 模块中去。

/**
 * function_name() - Short Description
 * 
 * Long Description
 *
 */

It is acceptable if the function does not have parameter or return documentation to leave a note that the short and long descriptions are missing. This should only be used when you are writing documentation for a multiple functions are only leaving a note that you intentionally left that area blank for someone else or for yourself to complete later.

/**
 * function_name() - {{@internal Missing Short Description}}}
 *
 * {{@internal Missing Long Description}}}
 *
 */

如果函数没有参数,或者返回资料留下短和长描述丢失的记录,这是可以接受的。这只能在你为一个多重函数写资料时,留下一个你专门为别人或者你自己留下空白以便将来完成的记录时,才可以使用。

/**
 * function_name() - {{@internal Missing Short Description}}}
 *
 * {{@internal Missing Long Description}}}
 *
 */

For other tags to remind yourself or others that you did not mean for the tag to be blank in that area. Other times, it should be assumed that if someone left something blank, that they meant to do so, or didn't think the description was required for others to understand the function. The information might not serve any purpose if it is available elsewhere. For example in the @uses tag for globals, if the global variable was already documented.

 * @uses function_name() {{@internal Missing Description}}}

After the short and long description, other information is important to the coder and phpDocumentor sites.

/**
 * function_name() - Short Description
 * 
 * Long Description
 *
 * @package WordPress
 * @since version
 *
 * @param    type    $varname    Description
 * @return   type                Description
 */

对于其他提醒你或者你本不想留下空白的标签。其他时候,它应该被认为是有人故意留下空白,或者是不认为描述对于别人理解函数是必须的。信息可能并不服务于某种目的,如果在别的地方也可以找到的话。如,在使用@uses标签时,如果全局变量已经拥有资料时。

 * @uses function_name() {{@internal Missing Description}}}

在短和长描述后,别的信息对于编码器和phpDocumentor 站点也是很重要的。

/**
 * function_name() - Short Description
 * 
 * Long Description
 *
 * @package WordPress
 * @since version
 *
 * @param    type    $varname    Description
 * @return   type                Description
 */

The convention for @since is to use just the version number, "2.1", or "2.3.1" and leave off any other strings. The @package information gives coders and phpDocumentor which application the function and therefore the @since application the version number belongs to.

@since的惯例是只使用版本号,"2.1",或者"2.3.1",并且停止其他的字符串。 @package 信息给出了编码器和请求函数用的phpDocumentor,这样@since 就会请求属于它的版本号。

For consistency, if parameters are available, they must always be documented for every function. If the "return" keyword is used anywhere in the function, then the @return tag should be used to document that possible case. If it does not exist, then it is best to not include the tag, because if it exists, the reader might expect it to have the "return" keyword.

为了保持一致,如果参数可用,它们必须为每个函数建立资料文献。如果"return" 关键词在函数中的任何地方使用,那么@return标签应该被用来建立可能的资料。 如果它不存在的话,最好就不要包含这个标签,因为如果它存在,读者可能希望它能有 "return" 这个关键词。

If the function is deprecated, should not be used any longer, then the @deprecated tag along with the version and description of what to use instead should be given. Also include the @uses tag with the function name.

/**
 * ... Descriptions
 *
 * @deprecated 2.1  Use function_name() instead.
 * @uses function_name()
 *
 * ... parameters and return descriptions
 */

如果函数被反对,就不应该继续使用了,然后会给出@deprecated 标签连同办不办和使用哪些作为替代的描述。同样包括带有函数名字的@uses标签。

/**
 * ... Descriptions
 *
 * @deprecated 2.1  Use function_name() instead.
 * @uses function_name()
 *
 * ... parameters and return descriptions
 */

Class PHPdoc tags

The information on class PHPdoc tags to use in WordPress classes is intentionally left out. One note is that the class definition, the class properties (variables), and class methods (functions) all need to have documentation to be complete.

The PEAR sample should be referenced for the tags to use for each.

类PHPdoc 标签

关于类PHPdoc标签的在WordPress类中使用的信息是故意删除的。注意类的定义,属性(变量),和类方法(函数)都需要建立文献资料。

PEAR 样本应该用来作为这些标签的使用的参考。

Past WP-Hackers Discussions

The WP-Hackers list has a number of past discussions on adding inline documentation. In recent cases, this page was not referenced or found during the discussion. By documenting WordPress files, the discussions on WP-Hackers and elsewhere can be brought to a close if enough effort is put forth to do the work to document the files.

过去的 WP-Hackers 讨论

WP-Hackers列表有大量过去的关于添加内嵌文档的讨论。在最近的一些案例中,这个页面无法在讨论中引用或者被发现。通过给WordPress文件建立资料,关于WP-Hackers和别的东西的讨论可以结束了,如果足够的努力放到给这些文件建立档案文献的话。

Resources

资源

Files with Inline Documentation

For a list of current files in WordPress, see WordPress:WordPress Files.

拥有内嵌文档的文件

想得到一个WordPress中现有文件的列表,参见WordPress:WordPress 文件.

External Library Files

Third party libraries should have file level documentation, but should not be part of the WordPress documentation effort. The following third party files have file level documentation. Below is the list of external files in WordPress 2.5 (1/10/2008).

外部库文件

第三方的库应该有文件级别的资料,但是不应该成为WordPress文档资料的一部分。 下面这些第三方文件都拥有文件级别的资料。下面是WordPress 2.5 中的外部文件列表(1/10/2008).

All external library files are completed

  • /wp-includes/atomlib.php
  • /wp-includes/class-IXR.php
  • /wp-includes/class-phpass.php
  • /wp-includes/class-phpmailer.php (does not need file level documentation because it has class level documentation)
  • /wp-includes/class-pop3.php
  • /wp-includes/class-smtp.php (does not need file level documentation because it has class level documentation)
  • /wp-includes/class-snoopy.php
  • /wp-includes/gettext.php
  • /wp-includes/streams.php
  • /wp-includes/rss.php
  • /wp-includes/rss-functions.php (deprecated)

所有的外部库文件都完成了

  • /wp-includes/atomlib.php
  • /wp-includes/class-IXR.php
  • /wp-includes/class-phpass.php
  • /wp-includes/class-phpmailer.php (不需要文件级别的资料,因为它有类级别的资料)
  • /wp-includes/class-pop3.php
  • /wp-includes/class-smtp.php (不需要文件级别的资料,因为它有类级别的资料)
  • /wp-includes/class-snoopy.php
  • /wp-includes/gettext.php
  • /wp-includes/streams.php
  • /wp-includes/rss.php
  • /wp-includes/rss-functions.php (deprecated)

WordPress Finished Files

These files have complete PHPdoc style documentation. Listed are the documentation writer, along with the WordPress Trac ticket number.

WordPress 完成的文件

这些文件已经完成了PHPdoc 样式资料。列出的部分是资料作者,连同 WordPress Trac ticket 号码。


  1. #5211 - /wp-settings.php - Jacob Santos (Use as an example for other files)
  2. #4393 - /wp-includes/author-template.php - Robin Adrianse and cleanup by Jacob Santos
  3. #5523 - /wp-includes/bookmark.php - Jacob Santos
  4. #5521 - /wp-includes/bookmark-template.php - Jacob Santos
  5. #5511 - /wp-includes/cache.php - Jacob Santos
  6. #5526 - /wp-includes/canonical.php - Jacob Santos
  7. #5528 - /wp-includes/comment-template.php - Jacob Santos (help from Peter Walker #2648)
  8. #5510 - /wp-includes/compat.php - Jacob Santos
  9. #5527 - /wp-includes/default-filters.php - Jacob Santos
  10. #5527 - /wp-includes/feed-rss2-comments.php - Jacob Santos
  11. #5527 - /wp-includes/feed-rss2.php - Jacob Santos
  12. #5527 - /wp-includes/feed-rdf.php - Jacob Santos
  13. #5527 - /wp-includes/feed-atom-comments.php - Jacob Santos
  14. #5527 - /wp-includes/feed-rss.php - Jacob Santos
  15. #5527 - /wp-includes/feed-atom.php - Jacob Santos
  16. #5641 - /wp-includes/kses.php - Jacob Santos
  17. #5590 - /wp-includes/l10n.php - Jacob Santos
  18. #5621 - /wp-includes/locale.php - Jacob Santos
  19. #5509 - /wp-includes/pluggable.php - Updated by Jacob Santos based on Robert Deaton's patch from #2477
  20. #3852 - /wp-includes/plugin.php - Martin Sturm and cleanup by Jacob Santos (#5225)
  21. #4383 - /wp-includes/registration.php - Robin Adrianse and cleanup by Jacob Santos
  22. #5572 - /wp-includes/registration-functions.php - Jacob Santos
  23. #4742 - /wp-includes/taxonomy.php - Jacob Santos
  24. #5513 - /wp-includes/template-loader.php - Jacob Santos
  25. #5233 - /wp-includes/update.php - Jacob Santos
  26. #5572 - /wp-includes/vars.php - Jacob Santos
  27. #5572 - /wp-includes/version.php - Jacob Santos
  28. #2474 - /wp-includes/wpdb.php - Robert Deaton


  1. #5211 - /wp-settings.php - Jacob Santos (作为其他文件的示例使用)
  2. #4393 - /wp-includes/author-template.php - Robin Adrianse 和清除 by Jacob Santos
  3. #5523 - /wp-includes/bookmark.php - Jacob Santos
  4. #5521 - /wp-includes/bookmark-template.php - Jacob Santos
  5. #5511 - /wp-includes/cache.php - Jacob Santos
  6. #5526 - /wp-includes/canonical.php - Jacob Santos
  7. #5528 - /wp-includes/comment-template.php - Jacob Santos (help from Peter Walker #2648)
  8. #5510 - /wp-includes/compat.php - Jacob Santos
  9. #5527 - /wp-includes/default-filters.php - Jacob Santos
  10. #5527 - /wp-includes/feed-rss2-comments.php - Jacob Santos
  11. #5527 - /wp-includes/feed-rss2.php - Jacob Santos
  12. #5527 - /wp-includes/feed-rdf.php - Jacob Santos
  13. #5527 - /wp-includes/feed-atom-comments.php - Jacob Santos
  14. #5527 - /wp-includes/feed-rss.php - Jacob Santos
  15. #5527 - /wp-includes/feed-atom.php - Jacob Santos
  16. #5641 - /wp-includes/kses.php - Jacob Santos
  17. #5590 - /wp-includes/l10n.php - Jacob Santos
  18. #5621 - /wp-includes/locale.php - Jacob Santos
  19. #5509 - /wp-includes/pluggable.php – 由 Jacob Santos在Robert Deaton来自#2477的补丁的基础上更新
  20. #3852 - /wp-includes/plugin.php - Martin Sturm 和清除 by Jacob Santos (#5225)
  21. #4383 - /wp-includes/registration.php - Robin Adrianse 和清除 by Jacob Santos
  22. #5572 - /wp-includes/registration-functions.php - Jacob Santos
  23. #4742 - /wp-includes/taxonomy.php - Jacob Santos
  24. #5513 - /wp-includes/template-loader.php - Jacob Santos
  25. #5233 - /wp-includes/update.php - Jacob Santos
  26. #5572 - /wp-includes/vars.php - Jacob Santos
  27. #5572 - /wp-includes/version.php - Jacob Santos
  28. #2474 - /wp-includes/wpdb.php - Robert Deaton

Incomplete Files

Every file should be labeled as a work in progress and if you want to adopt a file or function for documentation, then do so and add it to this list. These files however have already been started and could use some help with completion.

  1. #5632 - /wp-includes/capabilities.php - Started by Jacob Santos
  2. #5633 - /wp-includes/category.php - Started by Jacob Santos
  3. #5634 - /wp-includes/category-template.php - Started by Jacob Santos
  4. #5635 - /wp-includes/classes.php - Started by Jacob Santos
  5. #5637 - /wp-includes/cron.php - Started by Jacob Santos
  6. #5578 - /wp-includes/comment.php - Updated by Jacob Santos based on Peter Walker's patch from #2648
  7. #5636 - /wp-includes/feed.php - Started by Jacob Santos
  8. #5638 - /wp-includes/formatting.php - Started by Jacob Santos
  9. #5639 - /wp-includes/functions.php - Started by Jacob Santos
  10. #5640 - /wp-includes/general-template.php - Started by Jacob Santos
  11. #5642 - /wp-includes/link-template.php - Started by Jacob Santos
  12. #3982 - /wp-includes/post.php - Started by Scott Merrill, updated by Jacob Santos and based in part off of #2473.
  13. #0000 - /wp-includes/post-template.php - Started by You
  14. #0000 - /wp-includes/query.php - Started by You
  15. #0000 - /wp-includes/script-loader.php - Started by You
  16. #0000 - /wp-includes/theme.php - Started by You
  17. #5512 - /wp-includes/user.php - Started by Jacob Santos
  18. #0000 - /wp-includes/widgets.php - Started by You

This ticket is outdated because admin-functions.php is no longer used for functions and is deprecated in 2.5+. The documentation is still good for the functions that were moved to the wp-admin/includes/*.* folder.

  • #3970 - /wp-admin/admin-functions.php - Started by Sabin Iacob

未完成的文件

如果你想通过文件或者函数进行资料编写,那么每个文件都应该有个标签,作为工作的一部分,做完这个之后再添加到列表中。这些文件已经开始并且完成后可以使用一些帮助。

  1. #5632 - /wp-includes/capabilities.php – 由 Jacob Santos开始
  2. #5633 - /wp-includes/category.php -由 Jacob Santos开始
  3. #5634 - /wp-includes/category-template.php -由 Jacob Santos开始
  4. #5635 - /wp-includes/classes.php -由 Jacob Santos开始
  5. #5637 - /wp-includes/cron.php -由 Jacob Santos开始
  6. #5578 - /wp-includes/comment.php – 在Peter Walker的来自#2648的补丁的基础上由Jacob Santos更新
  7. #5636 - /wp-includes/feed.php -由 Jacob Santos开始
  8. #5638 - /wp-includes/formatting.php -由 Jacob Santos开始
  9. #5639 - /wp-includes/functions.php -由 Jacob Santos开始
  10. #5640 - /wp-includes/general-template.php -由 Jacob Santos开始
  11. #5642 - /wp-includes/link-template.php -由 Jacob Santos开始
  12. #3982 - /wp-includes/post.php – 由Scott Merrill开始, Jacob Santos在#2473的部分基础上更新
  13. #0000 - /wp-includes/post-template.php – 由你开始
  14. #0000 - /wp-includes/query.php - 由你开始
  15. #0000 - /wp-includes/script-loader.php -由你开始
  16. #0000 - /wp-includes/theme.php -由你开始
  17. #5512 - /wp-includes/user.php – 由Jacob Santos开始
  18. #0000 - /wp-includes/widgets.php -由你开始

这个票已经过期因为admin-functions.php 不再使用并且在2.5+版本失效了. 文献资料对于转移到wp-admin/includes/*.* 文件夹下的函数仍然好用

  • #3970 - /wp-admin/admin-functions.php – 由 Sabin Iacob开始