pinkcrab / settings_pages
PinkCrab frameworks settings page api wrapper. Requires the PinkCrab framework and PinkCrab Form_Fields libraries.
Requires
- php: >=7.1.0
- pinkcrab/form_fields: ^0.1.0
- pinkcrab/plugin-framework: ^0.3.0
Requires (Dev)
- php-stubs/wordpress-stubs: ^5.6.0
- phpstan/phpstan: ^0.12.6
- phpunit/phpunit: ^7.0
- phpunit/phpunit-dom-assertions: ~2
- pinkcrab/phpunit-helpers: dev-master
- roots/wordpress: ^5.5
- symfony/var-dumper: ^5.0
- szepeviktor/phpstan-wordpress: ^0.7.2
- wp-phpunit/wp-phpunit: ^5.0
- yoast/phpunit-polyfills: ^0.1.0
This package is auto-updated.
Last update: 2023-03-18 21:20:42 UTC
README
Settings page is extendable class which allows for the registration, display and processing of Settings in WordPress.
For more details please visit our docs. https://app.gitbook.com/@glynn-quelch/s/pinkcrab/
Version
Release 0.2.0
We have made no changes to how this works from V0.1.*, but we have now moved to using composer purely for this package. You can still use it without composer, but the classes and interfaces would need to be added manually.
Install
composer require pinkcrab/settings_pages
Why?
The WordPress WP-Admin has some interesting API's and sadly most of them have not really changed much over the years. As a result the hoops that need jumping through are fustrating at times.
So we created this module to make it not only quicker and easier to create settings pages, but also to leverage out Form_Fields module to remove the need to write out each input in raw HTML.
Testing
PHP Unit
If you would like to run the tests for this package, please ensure you add your database details into the test/wp-config.php file before running phpunit.
$ phpunit
$ composer test
PHP Stan
The module comes with a pollyfill for all WP Functions, allowing for the testing of all core files. The current config omits the Dice file as this is not ours. To run the suite call.
$ vendor/bin/phpstan analyse src/ -l8
$ composer analyse
License
MIT License
http://www.opensource.org/licenses/mit-license.html
Change Log
0.2.0 - Moved to composer, renamed all namespaces to match the composer format.