Download the PHP package piotrpress/wordpress-abilities without Composer
On this page you can find all versions of the php package piotrpress/wordpress-abilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download piotrpress/wordpress-abilities
More information about piotrpress/wordpress-abilities
Files in piotrpress/wordpress-abilities
Package wordpress-abilities
Short Description This is a lightweight PHP 8+ library for defining and registering custom WordPress Abilities using modern, attribute-based metadata.
License GPL-3.0-or-later
Homepage https://github.com/PiotrPress/wordpress-abilities
Informations about the package wordpress-abilities
WordPress Abilities
This is a lightweight PHP 8+ library for defining and registering custom WordPress Abilities using modern, attribute-based metadata.
It helps you keep Ability definitions close to the code that executes them. By combining #[Ability(...)] attribute with AbilityInterface / AbstractAbility, you can describe data in a clear, typed way, then register everything with a single call.
Installation
Example
Category
The category argument in Ability attribute accepts two forms:
AbilityCategoryobject - use this when you want to register a new category. If a category with the same slug already exists, no re-registration is attemptedstring- use this when you want to assign the Ability to an existing category slug.
Development
NOTE: The format command will format composer.json file, it's required PHP >= 8.2.
NOTE: The test command will run PHPUnit tests, it's required PHP >= 8.3.
Requirements
- PHP
>= 8.0
License
GPL3