brightoak / wordpress-tools
A collection of tools for doing WordPress tasks in a modern PHP way.
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-10-29 05:34:49 UTC
README
This is a tool for doing things in WordPress that are often verbose and should be easier.
Installation
You can install the package via composer:
composer require brightoak/wordpress-tools
Usage
Custom Post Types:
Simple example:
add_action('init', function(){ CustomPostType::init('example')->setSupports('title', 'editor')->register(); });
Elaborate example from 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(); });
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email rory@brightoak.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate.