brightoak / wordpress-tools
一套用于以现代PHP方式执行WordPress任务的工具集合。
0.11.0
2019-08-28 18:23 UTC
Requires
- php: ^7.1
- illuminate/support: ^5.8
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-09-29 05:22:02 UTC
README
这是一个用于在WordPress中执行常用且应该更简单的事情的工具。
安装
您可以通过composer安装此包
composer require brightoak/wordpress-tools
使用方法
自定义文章类型
简单示例
add_action('init', function(){ CustomPostType::init('example')->setSupports('title', 'editor')->register(); });
来自https://codex.wordpress.org/Function_Reference/register_post_type的详细示例
add_action('init', function(){ CustomPostType::init('book') ->setOptions('description' => 'Description', 'has_archive' => true]) ->setSupports('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments') ->register(); });
测试
composer test
变更日志
请参阅CHANGELOG以获取有关最近更改的更多信息。
贡献
请参阅CONTRIBUTING以获取详细信息。
安全
如果您发现任何安全相关的问题,请通过rory@brightoak.com发送电子邮件,而不是使用问题跟踪器。
鸣谢
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。
PHP包模板
此包使用PHP包模板生成。