Files
wp-multisite-waas/inc/database/memberships/class-membership-status.php
David Stone d88e50df38 Prep Plugin for release on WordPress.org (#23)
* Update translation text domain
* Escape everything that should be escaped.
* Add nonce checks where needed.
* Sanitize all inputs.
* Apply Code style changes across the codebase.
* Correct many deprecation notices.
* Optimize load order of many filters.
* Add Proper Build script
* Use emojii flags
* Fix i18n deprecation  notice for translating too early
* Put all scripts in footer and load async
2025-04-14 11:36:46 -06:00

77 lines
1.6 KiB
PHP

<?php
/**
* Membership Status enum.
*
* @package WP_Ultimo
* @subpackage WP_Ultimo\Database\Memberships
* @since 2.0.0
*/
namespace WP_Ultimo\Database\Memberships;
// Exit if accessed directly
defined('ABSPATH') || exit;
use WP_Ultimo\Database\Engine\Enum;
/**
* Membership Status.
*
* @since 2.0.0
*/
class Membership_Status extends Enum {
/**
* Default product type.
*/
const __default = 'pending'; // phpcs:ignore
const PENDING = 'pending';
const ACTIVE = 'active';
const TRIALING = 'trialing';
const EXPIRED = 'expired';
const ON_HOLD = 'on-hold';
const CANCELLED = 'cancelled';
/**
* Returns an array with values => CSS Classes.
*
* @since 2.0.0
* @return array
*/
protected function classes() {
return [
static::PENDING => 'wu-bg-gray-200 wu-text-gray-700',
static::ACTIVE => 'wu-bg-green-200 wu-text-green-700',
static::TRIALING => 'wu-bg-orange-200 wu-text-orange-700',
static::ON_HOLD => 'wu-bg-blue-200 wu-text-blue-700',
static::EXPIRED => 'wu-bg-yellow-200 wu-text-yellow-700',
static::CANCELLED => 'wu-bg-red-200 wu-text-red-700',
];
}
/**
* Returns an array with values => labels.
*
* @since 2.0.0
* @return array
*/
protected function labels() {
return [
static::PENDING => __('Pending', 'wp-multisite-waas'),
static::ACTIVE => __('Active', 'wp-multisite-waas'),
static::TRIALING => __('Trialing', 'wp-multisite-waas'),
static::ON_HOLD => __('On Hold', 'wp-multisite-waas'),
static::EXPIRED => __('Expired', 'wp-multisite-waas'),
static::CANCELLED => __('Cancelled', 'wp-multisite-waas'),
];
}
}