| 1 |
<?php |
| 2 |
/** |
| 3 |
* Merchant Abilities Category. |
| 4 |
* |
| 5 |
* Registers the "merchant" ability category with WordPress. |
| 6 |
* |
| 7 |
* @package Merchant |
| 8 |
* @since 2.3.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Merchant_Abilities_Category |
| 17 |
* |
| 18 |
* Registers the `merchant` ability category during the |
| 19 |
* `wp_abilities_api_categories_init` hook so that all |
| 20 |
* Merchant abilities are grouped under a single category |
| 21 |
* in the WordPress Abilities API. |
| 22 |
* |
| 23 |
* @since 2.3.0 |
| 24 |
*/ |
| 25 |
class Merchant_Abilities_Category { |
| 26 |
|
| 27 |
/** |
| 28 |
* Hook into the WP Abilities API category registration. |
| 29 |
* |
| 30 |
* @return void |
| 31 |
*/ |
| 32 |
public static function register() { |
| 33 |
add_action( 'wp_abilities_api_categories_init', array( static::class, 'register_category' ) ); |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Register the "merchant" ability category with WordPress. |
| 38 |
* |
| 39 |
* @return void |
| 40 |
*/ |
| 41 |
public static function register_category() { |
| 42 |
wp_register_ability_category( 'merchant', array( |
| 43 |
'label' => __( 'Merchant — WooCommerce Toolkit', 'merchant' ), |
| 44 |
'description' => __( 'Manage Merchant modules, campaigns, settings, and analytics.', 'merchant' ), |
| 45 |
) ); |
| 46 |
} |
| 47 |
} |
| 48 |
|