convertkit
/
includes
/
mcp
/
abilities
/
resources
/
class-convertkit-mcp-ability-resource-products.php
class-convertkit-mcp-ability-resource-products.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.4.4, at includes/mcp/abilities/resources/class-convertkit-mcp-ability-resource-products.php
| 1 | <?php |
| 2 | /** |
| 3 | * Kit MCP Ability: List Products. |
| 4 | * |
| 5 | * @package ConvertKit |
| 6 | * @author ConvertKit |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * Ability that lists every Kit Product cached from the connected Kit account, |
| 11 | * returning each product's ID and name. |
| 12 | * |
| 13 | * Produces an ability named `kit/products-list`. |
| 14 | * |
| 15 | * @package ConvertKit |
| 16 | * @author ConvertKit |
| 17 | */ |
| 18 | class ConvertKit_MCP_Ability_Resource_Products extends ConvertKit_MCP_Ability_Resource { |
| 19 | |
| 20 | /** |
| 21 | * Returns the resource slug for this ability. |
| 22 | * |
| 23 | * @since 3.4.0 |
| 24 | * |
| 25 | * @return string |
| 26 | */ |
| 27 | protected function get_resource() { |
| 28 | |
| 29 | return 'products'; |
| 30 | |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Returns the class name of the ConvertKit_Resource_* implementation |
| 35 | * backing this ability. |
| 36 | * |
| 37 | * @since 3.4.0 |
| 38 | * |
| 39 | * @return string |
| 40 | */ |
| 41 | protected function get_resource_class() { |
| 42 | |
| 43 | return 'ConvertKit_Resource_Products'; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Returns the ability's human-readable label. |
| 49 | * |
| 50 | * @since 3.4.0 |
| 51 | * |
| 52 | * @return string |
| 53 | */ |
| 54 | public function get_label() { |
| 55 | |
| 56 | return __( 'List Kit Products', 'convertkit' ); |
| 57 | |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Returns the ability's human-readable description. |
| 62 | * |
| 63 | * @since 3.4.0 |
| 64 | * |
| 65 | * @return string |
| 66 | */ |
| 67 | public function get_description() { |
| 68 | |
| 69 | return __( 'Lists every Kit Product configured on the connected Kit account, returning each product\'s numeric ID and name. Use this before kit/post-settings-update or kit/product-insert when the user refers to a Product by name rather than ID, to look up the corresponding numeric Product ID. For restrict-content products the same ID is used with a "product_" prefix.', 'convertkit' ); |
| 70 | |
| 71 | } |
| 72 | |
| 73 | } |
| 74 |