如何使用PHP注释记录WordPress主题/插件的过滤器/操作

我正在寻求有关如何为主题或插件之外的过滤器和操作生成文档的建议。

作为WordPress开发人员, 通过我的项目中的PHP注释为这些自定义过滤器和操作生成文档会很有帮助。例如说这样的事情:

/**
 * A short description.
 *
 * A summary.
 *
 * @since 1.0.0
 * @filter plugin_post_types
 */
$post_types = apply_filters('plugin_post_types', $post_types);

或类似的规定。

我曾尝试给PHPDocumentor和ApiGen一个镜头, 但它们更多地关注类, 方法等。

有人知道当前的解决方案吗?也许有人可以就如何处理类似情况分享一些见识。我真的不想手动编写文档。

谢谢!


#1


我个人说, 只要你坚持, 任何适合你的就足够了。 PHPDoc应该是完美的。

撇开个人注释-如果我们谈论WordPress开发, 那么它们的编码标准定义得很好。

请转到他们的文档页面, 你可以找到有关他们如何记录钩子(动作和过滤器)的示例:https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php /#4-钩子动作和过滤器

来源:

https://www.srcmini02.com/65314.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37302.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?