Use PHP 7.4 featers and PHP 8 polyfills
This commit is contained in:
@ -33,9 +33,9 @@ class Register_Endpoint {
|
||||
* @since 2.0.0
|
||||
* @return void
|
||||
*/
|
||||
public function init() {
|
||||
public function init(): void {
|
||||
|
||||
add_action('wu_register_rest_routes', array($this, 'register_route'));
|
||||
add_action('wu_register_rest_routes', [$this, 'register_route']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,29 +46,29 @@ class Register_Endpoint {
|
||||
* @param \WP_Ultimo\API $api The API main singleton.
|
||||
* @return void
|
||||
*/
|
||||
public function register_route($api) {
|
||||
public function register_route($api): void {
|
||||
|
||||
$namespace = $api->get_namespace();
|
||||
|
||||
register_rest_route(
|
||||
$namespace,
|
||||
'/register',
|
||||
array(
|
||||
[
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'handle_get'),
|
||||
'permission_callback' => \Closure::fromCallable(array($api, 'check_authorization')),
|
||||
)
|
||||
'callback' => [$this, 'handle_get'],
|
||||
'permission_callback' => \Closure::fromCallable([$api, 'check_authorization']),
|
||||
]
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
$namespace,
|
||||
'/register',
|
||||
array(
|
||||
[
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
'callback' => array($this, 'handle_endpoint'),
|
||||
'permission_callback' => \Closure::fromCallable(array($api, 'check_authorization')),
|
||||
'callback' => [$this, 'handle_endpoint'],
|
||||
'permission_callback' => \Closure::fromCallable([$api, 'check_authorization']),
|
||||
'args' => $this->get_rest_args(),
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -82,9 +82,9 @@ class Register_Endpoint {
|
||||
*/
|
||||
public function handle_get($request) {
|
||||
|
||||
return array(
|
||||
return [
|
||||
'registration_status' => wu_get_setting('enable_registration', true) ? 'open' : 'closed',
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,9 +109,9 @@ class Register_Endpoint {
|
||||
|
||||
if (is_wp_error($validation_errors)) {
|
||||
$validation_errors->add_data(
|
||||
array(
|
||||
[
|
||||
'status' => 400,
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
return $validation_errors;
|
||||
@ -129,10 +129,10 @@ class Register_Endpoint {
|
||||
$customer->update_last_login(true, true);
|
||||
|
||||
$customer->add_note(
|
||||
array(
|
||||
[
|
||||
'text' => __('Created via REST API', 'wp-ultimo'),
|
||||
'author_id' => $customer->get_user_id(),
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
/*
|
||||
@ -140,12 +140,12 @@ class Register_Endpoint {
|
||||
*/
|
||||
$payment_method = wp_parse_args(
|
||||
wu_get_isset($params, 'payment_method'),
|
||||
array(
|
||||
[
|
||||
'gateway' => '',
|
||||
'gateway_customer_id' => '',
|
||||
'gateway_subscription_id' => '',
|
||||
'gateway_payment_id' => '',
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
/*
|
||||
@ -155,9 +155,9 @@ class Register_Endpoint {
|
||||
|
||||
$cart_params = wp_parse_args(
|
||||
$cart_params,
|
||||
array(
|
||||
[
|
||||
'type' => 'new',
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$cart = new Cart($cart_params);
|
||||
@ -171,9 +171,9 @@ class Register_Endpoint {
|
||||
__('Products are required.', 'wp-ultimo'),
|
||||
array_merge(
|
||||
(array) $cart->done(),
|
||||
array(
|
||||
[
|
||||
'status' => 400,
|
||||
)
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -188,9 +188,9 @@ class Register_Endpoint {
|
||||
wu_get_isset(
|
||||
$params,
|
||||
'membership',
|
||||
array(
|
||||
[
|
||||
'status' => Membership_Status::PENDING,
|
||||
)
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
@ -214,10 +214,10 @@ class Register_Endpoint {
|
||||
}
|
||||
|
||||
$membership->add_note(
|
||||
array(
|
||||
[
|
||||
'text' => __('Created via REST API', 'wp-ultimo'),
|
||||
'author_id' => $customer->get_user_id(),
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$payment_data = $cart->to_payment_data();
|
||||
@ -227,9 +227,9 @@ class Register_Endpoint {
|
||||
wu_get_isset(
|
||||
$params,
|
||||
'payment',
|
||||
array(
|
||||
[
|
||||
'status' => Payment_Status::PENDING,
|
||||
)
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
@ -252,10 +252,10 @@ class Register_Endpoint {
|
||||
}
|
||||
|
||||
$payment->add_note(
|
||||
array(
|
||||
[
|
||||
'text' => __('Created via REST API', 'wp-ultimo'),
|
||||
'author_id' => $customer->get_user_id(),
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$site = false;
|
||||
@ -301,7 +301,7 @@ class Register_Endpoint {
|
||||
} catch (\Throwable $e) {
|
||||
$wpdb->query('ROLLBACK');
|
||||
|
||||
return new \WP_Error('registration_error', $e->getMessage(), array('status' => 500));
|
||||
return new \WP_Error('registration_error', $e->getMessage(), ['status' => 500]);
|
||||
}
|
||||
|
||||
$wpdb->query('COMMIT');
|
||||
@ -309,12 +309,12 @@ class Register_Endpoint {
|
||||
/*
|
||||
* We have everything we need now.
|
||||
*/
|
||||
return array(
|
||||
return [
|
||||
'membership' => $membership->to_array(),
|
||||
'customer' => $customer->to_array(),
|
||||
'payment' => $payment->to_array(),
|
||||
'site' => $site ? $site : array('id' => 0),
|
||||
);
|
||||
'site' => $site ?: ['id' => 0],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -331,203 +331,203 @@ class Register_Endpoint {
|
||||
*/
|
||||
$billing_address_fields = Billing_Address::fields_for_rest(false);
|
||||
|
||||
$customer_args = array(
|
||||
'customer_id' => array(
|
||||
$customer_args = [
|
||||
'customer_id' => [
|
||||
'description' => __('The customer ID, if the customer already exists. If you also need to create a customer/wp user, use the "customer" property.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
),
|
||||
'customer' => array(
|
||||
],
|
||||
'customer' => [
|
||||
'description' => __('Customer data. Needs to be present when customer id is not.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'user_id' => array(
|
||||
'properties' => [
|
||||
'user_id' => [
|
||||
'description' => __('Existing WordPress user id to attach this customer to. If you also need to create a WordPress user, pass the properties "username", "password", and "email".', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
),
|
||||
'username' => array(
|
||||
],
|
||||
'username' => [
|
||||
'description' => __('The customer username. This is used to create the WordPress user.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'minLength' => 4,
|
||||
),
|
||||
'password' => array(
|
||||
],
|
||||
'password' => [
|
||||
'description' => __('The customer password. This is used to create the WordPress user. Note that no validation is performed here to enforce strength.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'minLength' => 6,
|
||||
),
|
||||
'email' => array(
|
||||
],
|
||||
'email' => [
|
||||
'description' => __('The customer email address. This is used to create the WordPress user.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'email',
|
||||
),
|
||||
'billing_address' => array(
|
||||
],
|
||||
'billing_address' => [
|
||||
'type' => 'object',
|
||||
'properties' => $billing_address_fields,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$membership_args = array(
|
||||
'membership' => array(
|
||||
$membership_args = [
|
||||
'membership' => [
|
||||
'description' => __('The membership data is automatically generated based on the cart info passed (e.g. products) but can be overridden with this property.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'status' => array(
|
||||
'properties' => [
|
||||
'status' => [
|
||||
'description' => __('The membership status.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'enum' => array_values(Membership_Status::get_allowed_list()),
|
||||
'default' => Membership_Status::PENDING,
|
||||
),
|
||||
'date_expiration' => array(
|
||||
],
|
||||
'date_expiration' => [
|
||||
'description' => __('The membership expiration date. Must be a valid PHP date format.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
),
|
||||
'date_trial_end' => array(
|
||||
],
|
||||
'date_trial_end' => [
|
||||
'description' => __('The membership trial end date. Must be a valid PHP date format.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
),
|
||||
'date_activated' => array(
|
||||
],
|
||||
'date_activated' => [
|
||||
'description' => __('The membership activation date. Must be a valid PHP date format.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
),
|
||||
'date_renewed' => array(
|
||||
],
|
||||
'date_renewed' => [
|
||||
'description' => __('The membership last renewed date. Must be a valid PHP date format.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
),
|
||||
'date_cancellation' => array(
|
||||
],
|
||||
'date_cancellation' => [
|
||||
'description' => __('The membership cancellation date. Must be a valid PHP date format.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
),
|
||||
'date_payment_plan_completed' => array(
|
||||
],
|
||||
'date_payment_plan_completed' => [
|
||||
'description' => __('The membership completion date. Used when the membership is limited to a limited number of billing cycles. Must be a valid PHP date format.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$payment_args = array(
|
||||
'payment' => array(
|
||||
$payment_args = [
|
||||
'payment' => [
|
||||
'description' => __('The payment data is automatically generated based on the cart info passed (e.g. products) but can be overridden with this property.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'status' => array(
|
||||
'properties' => [
|
||||
'status' => [
|
||||
'description' => __('The payment status.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'enum' => array_values(Payment_Status::get_allowed_list()),
|
||||
'default' => Payment_Status::PENDING,
|
||||
),
|
||||
),
|
||||
),
|
||||
'payment_method' => array(
|
||||
],
|
||||
],
|
||||
],
|
||||
'payment_method' => [
|
||||
'description' => __('Payment method information. Useful when using the REST API to integrate other payment methods.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'gateway' => array(
|
||||
'properties' => [
|
||||
'gateway' => [
|
||||
'description' => __('The gateway name. E.g. stripe.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
),
|
||||
'gateway_customer_id' => array(
|
||||
],
|
||||
'gateway_customer_id' => [
|
||||
'description' => __('The customer ID on the gateway system.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
),
|
||||
'gateway_subscription_id' => array(
|
||||
],
|
||||
'gateway_subscription_id' => [
|
||||
'description' => __('The subscription ID on the gateway system.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
),
|
||||
'gateway_payment_id' => array(
|
||||
],
|
||||
'gateway_payment_id' => [
|
||||
'description' => __('The payment ID on the gateway system.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$site_args = array(
|
||||
'site' => array(
|
||||
$site_args = [
|
||||
'site' => [
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'site_url' => array(
|
||||
'properties' => [
|
||||
'site_url' => [
|
||||
'type' => 'string',
|
||||
'description' => __('The site subdomain or subdirectory (depending on your Multisite install). This would be "test" in "test.your-network.com".', 'wp-ultimo'),
|
||||
'minLength' => 4,
|
||||
'required' => true,
|
||||
),
|
||||
'site_title' => array(
|
||||
],
|
||||
'site_title' => [
|
||||
'type' => 'string',
|
||||
'description' => __('The site title. E.g. My Amazing Site', 'wp-ultimo'),
|
||||
'minLength' => 4,
|
||||
'required' => true,
|
||||
),
|
||||
'publish' => array(
|
||||
],
|
||||
'publish' => [
|
||||
'description' => __('If we should publish this site regardless of membership/payment status. Sites are created as pending by default, and are only published when a payment is received or the status of the membership changes to "active". This flag allows you to bypass the pending state.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
),
|
||||
'template_id' => array(
|
||||
],
|
||||
'template_id' => [
|
||||
'description' => __('The template ID we should copy when creating this site. If left empty, the value dictated by the products will be used.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
),
|
||||
'site_meta' => array(
|
||||
],
|
||||
'site_meta' => [
|
||||
'description' => __('An associative array of key values to be saved as site_meta.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
),
|
||||
'site_option' => array(
|
||||
],
|
||||
'site_option' => [
|
||||
'description' => __('An associative array of key values to be saved as site_options. Useful for changing plugin settings and other site configurations.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$cart_args = array(
|
||||
'products' => array(
|
||||
$cart_args = [
|
||||
'products' => [
|
||||
'description' => __('The products to be added to this membership. Takes an array of product ids or slugs.', 'wp-ultimo'),
|
||||
'uniqueItems' => true,
|
||||
'type' => 'array',
|
||||
),
|
||||
'duration' => array(
|
||||
],
|
||||
'duration' => [
|
||||
'description' => __('The membership duration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'duration_unit' => array(
|
||||
],
|
||||
'duration_unit' => [
|
||||
'description' => __('The membership duration unit.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'default' => 'month',
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'week',
|
||||
'month',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'discount_code' => array(
|
||||
],
|
||||
],
|
||||
'discount_code' => [
|
||||
'description' => __('A discount code. E.g. PROMO10.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
),
|
||||
'auto_renew' => array(
|
||||
],
|
||||
'auto_renew' => [
|
||||
'description' => __('The membership auto-renew status. Useful when integrating with other payment options via this REST API.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
'required' => true,
|
||||
),
|
||||
'country' => array(
|
||||
],
|
||||
'country' => [
|
||||
'description' => __('The customer country. Used to calculate taxes and check if registration is allowed for that country.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __('The currency to be used.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
$args = array_merge($customer_args, $membership_args, $cart_args, $payment_args, $site_args);
|
||||
|
||||
@ -616,13 +616,13 @@ class Register_Endpoint {
|
||||
* the site on WordPress.
|
||||
*/
|
||||
$transient = array_merge(
|
||||
wu_get_isset($site_data, 'site_meta', array()),
|
||||
wu_get_isset($site_data, 'site_option', array())
|
||||
wu_get_isset($site_data, 'site_meta', []),
|
||||
wu_get_isset($site_data, 'site_option', [])
|
||||
);
|
||||
|
||||
$template_id = apply_filters('wu_checkout_template_id', (int) wu_get_isset($site_data, 'template_id'), $membership, $this);
|
||||
|
||||
$site_data = array(
|
||||
$site_data = [
|
||||
'domain' => $d->domain,
|
||||
'path' => $d->path,
|
||||
'title' => wu_get_isset($site_data, 'site_title'),
|
||||
@ -630,10 +630,10 @@ class Register_Endpoint {
|
||||
'customer_id' => $membership->get_customer()->get_id(),
|
||||
'membership_id' => $membership->get_id(),
|
||||
'transient' => $transient,
|
||||
'signup_meta' => wu_get_isset($site_data, 'site_meta', array()),
|
||||
'signup_options' => wu_get_isset($site_data, 'site_option', array()),
|
||||
'signup_meta' => wu_get_isset($site_data, 'site_meta', []),
|
||||
'signup_options' => wu_get_isset($site_data, 'site_option', []),
|
||||
'type' => Site_Type::CUSTOMER_OWNED,
|
||||
);
|
||||
];
|
||||
|
||||
$membership->create_pending_site($site_data);
|
||||
|
||||
@ -664,7 +664,7 @@ class Register_Endpoint {
|
||||
*/
|
||||
public function validation_rules() {
|
||||
|
||||
return array(
|
||||
return [
|
||||
'customer_id' => 'required_without:customer',
|
||||
'customer' => 'required_without:customer_id',
|
||||
'customer.username' => 'required_without_all:customer_id,customer.user_id',
|
||||
@ -673,7 +673,7 @@ class Register_Endpoint {
|
||||
'customer.user_id' => 'required_without_all:customer_id,customer.username,customer.password,customer.email',
|
||||
'site.site_url' => 'required_with:site|alpha_num|min:4|lowercase|unique_site',
|
||||
'site.site_title' => 'required_with:site|min:4',
|
||||
);
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Validates the rules and make sure we only save models when necessary.
|
||||
|
@ -18,76 +18,76 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'migrated_from_id' => array(
|
||||
return [
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'notice_type' => array(
|
||||
],
|
||||
'notice_type' => [
|
||||
'description' => __('Can be info, success, warning or error.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'info',
|
||||
'success',
|
||||
'warning',
|
||||
'error',
|
||||
),
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('This broadcast name, which is used as broadcast title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __('The type being set.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'status' => array(
|
||||
],
|
||||
'status' => [
|
||||
'description' => __('The status being set.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'author_id' => array(
|
||||
],
|
||||
'author_id' => [
|
||||
'description' => __('The author ID.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'title' => array(
|
||||
],
|
||||
'title' => [
|
||||
'description' => __('Post title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'content' => array(
|
||||
],
|
||||
'content' => [
|
||||
'description' => __('Post content.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'excerpt' => array(
|
||||
],
|
||||
'excerpt' => [
|
||||
'description' => __('Post excerpt.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Post creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Post last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'slug' => array(
|
||||
],
|
||||
'slug' => [
|
||||
'description' => __('The slug.', 'wp-ultimo'),
|
||||
'type' => 'mixed',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,76 +18,76 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'migrated_from_id' => array(
|
||||
return [
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'notice_type' => array(
|
||||
],
|
||||
'notice_type' => [
|
||||
'description' => __('Can be info, success, warning or error.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'info',
|
||||
'success',
|
||||
'warning',
|
||||
'error',
|
||||
),
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('This broadcast name, which is used as broadcast title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __('The type being set.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'status' => array(
|
||||
],
|
||||
'status' => [
|
||||
'description' => __('The status being set.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'author_id' => array(
|
||||
],
|
||||
'author_id' => [
|
||||
'description' => __('The author ID.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'title' => array(
|
||||
],
|
||||
'title' => [
|
||||
'description' => __('Post title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'content' => array(
|
||||
],
|
||||
'content' => [
|
||||
'description' => __('Post content.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'excerpt' => array(
|
||||
],
|
||||
'excerpt' => [
|
||||
'description' => __('Post excerpt.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Post creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Post last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'slug' => array(
|
||||
],
|
||||
'slug' => [
|
||||
'description' => __('The slug.', 'wp-ultimo'),
|
||||
'type' => 'mixed',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,75 +18,75 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'slug' => array(
|
||||
return [
|
||||
'slug' => [
|
||||
'description' => __('The checkout form slug. It needs to be unique and preferably make it clear what it is about. E.g. my_checkout_form.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('Your checkout form name, which is used as checkout form title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this checkout form as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => true,
|
||||
),
|
||||
'custom_css' => array(
|
||||
],
|
||||
'custom_css' => [
|
||||
'description' => __('Custom CSS code for the checkout form.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'settings' => array(
|
||||
],
|
||||
'settings' => [
|
||||
'description' => __('The checkout form settings and configurations.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'required' => false,
|
||||
),
|
||||
'allowed_countries' => array(
|
||||
],
|
||||
'allowed_countries' => [
|
||||
'description' => __('The allowed countries that can access this checkout.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'thank_you_page_id' => array(
|
||||
],
|
||||
'thank_you_page_id' => [
|
||||
'description' => __('The thank you page ID. This page is shown after a successful purchase.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'conversion_snippets' => array(
|
||||
],
|
||||
'conversion_snippets' => [
|
||||
'description' => __('Snippets to run on thank you page.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'template' => array(
|
||||
],
|
||||
'template' => [
|
||||
'description' => __("Template mode. Can be either 'blank', 'single-step' or 'multi-step'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'blank',
|
||||
'single-step',
|
||||
'multi-step',
|
||||
),
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,75 +18,75 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'slug' => array(
|
||||
return [
|
||||
'slug' => [
|
||||
'description' => __('The checkout form slug. It needs to be unique and preferably make it clear what it is about. E.g. my_checkout_form.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('Your checkout form name, which is used as checkout form title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this checkout form as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_css' => array(
|
||||
],
|
||||
'custom_css' => [
|
||||
'description' => __('Custom CSS code for the checkout form.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'settings' => array(
|
||||
],
|
||||
'settings' => [
|
||||
'description' => __('The checkout form settings and configurations.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'allowed_countries' => array(
|
||||
],
|
||||
'allowed_countries' => [
|
||||
'description' => __('The allowed countries that can access this checkout.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'thank_you_page_id' => array(
|
||||
],
|
||||
'thank_you_page_id' => [
|
||||
'description' => __('The thank you page ID. This page is shown after a successful purchase.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'conversion_snippets' => array(
|
||||
],
|
||||
'conversion_snippets' => [
|
||||
'description' => __('Snippets to run on thank you page.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'template' => array(
|
||||
],
|
||||
'template' => [
|
||||
'description' => __("Template mode. Can be either 'blank', 'single-step' or 'multi-step'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'blank',
|
||||
'single-step',
|
||||
'multi-step',
|
||||
),
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,83 +18,83 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'user_id' => array(
|
||||
return [
|
||||
'user_id' => [
|
||||
'description' => __('The WordPress user ID attached to this customer.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'date_registered' => array(
|
||||
],
|
||||
'date_registered' => [
|
||||
'description' => __('Date when the customer was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'email_verification' => array(
|
||||
],
|
||||
'email_verification' => [
|
||||
'description' => __('Email verification status - either `none`, `pending`, or `verified`.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'verified',
|
||||
'pending',
|
||||
'none',
|
||||
),
|
||||
),
|
||||
'last_login' => array(
|
||||
],
|
||||
],
|
||||
'last_login' => [
|
||||
'description' => __('Date this customer last logged in.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'has_trialed' => array(
|
||||
],
|
||||
'has_trialed' => [
|
||||
'description' => __('Whether or not the customer has trialed before.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'vip' => array(
|
||||
],
|
||||
'vip' => [
|
||||
'description' => __('If this customer is a VIP customer or not.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'ips' => array(
|
||||
],
|
||||
'ips' => [
|
||||
'description' => __('List of IP addresses used by this customer.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'extra_information' => array(
|
||||
],
|
||||
'extra_information' => [
|
||||
'description' => __('Any extra information related to this customer.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __("The customer type. Can be 'customer'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'customer',
|
||||
),
|
||||
),
|
||||
'signup_form' => array(
|
||||
],
|
||||
],
|
||||
'signup_form' => [
|
||||
'description' => __('The form used to signup.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,83 +18,83 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'user_id' => array(
|
||||
return [
|
||||
'user_id' => [
|
||||
'description' => __('The WordPress user ID attached to this customer.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_registered' => array(
|
||||
],
|
||||
'date_registered' => [
|
||||
'description' => __('Date when the customer was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'email_verification' => array(
|
||||
],
|
||||
'email_verification' => [
|
||||
'description' => __('Email verification status - either `none`, `pending`, or `verified`.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'verified',
|
||||
'pending',
|
||||
'none',
|
||||
),
|
||||
),
|
||||
'last_login' => array(
|
||||
],
|
||||
],
|
||||
'last_login' => [
|
||||
'description' => __('Date this customer last logged in.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'has_trialed' => array(
|
||||
],
|
||||
'has_trialed' => [
|
||||
'description' => __('Whether or not the customer has trialed before.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'vip' => array(
|
||||
],
|
||||
'vip' => [
|
||||
'description' => __('If this customer is a VIP customer or not.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'ips' => array(
|
||||
],
|
||||
'ips' => [
|
||||
'description' => __('List of IP addresses used by this customer.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'extra_information' => array(
|
||||
],
|
||||
'extra_information' => [
|
||||
'description' => __('Any extra information related to this customer.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __("The customer type. Can be 'customer'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'customer',
|
||||
),
|
||||
),
|
||||
'signup_form' => array(
|
||||
],
|
||||
],
|
||||
'signup_form' => [
|
||||
'description' => __('The form used to signup.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,108 +18,108 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'name' => array(
|
||||
return [
|
||||
'name' => [
|
||||
'description' => __('Your discount code name, which is used as discount code title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'code' => array(
|
||||
],
|
||||
'code' => [
|
||||
'description' => __('A unique identification to redeem the discount code. E.g. PROMO10.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'description' => array(
|
||||
],
|
||||
'description' => [
|
||||
'description' => __('A description for the discount code, usually a short text.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'uses' => array(
|
||||
],
|
||||
'uses' => [
|
||||
'description' => __('Number of times this discount was applied.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'max_uses' => array(
|
||||
],
|
||||
'max_uses' => [
|
||||
'description' => __('The number of times this discount can be used before becoming inactive.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'apply_to_renewals' => array(
|
||||
],
|
||||
'apply_to_renewals' => [
|
||||
'description' => __('Wether or not we should apply the discount to membership renewals.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __("The type of the discount code. Can be 'percentage' (e.g. 10%% OFF), 'absolute' (e.g. $10 OFF).", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'percentage',
|
||||
'absolute',
|
||||
),
|
||||
),
|
||||
'value' => array(
|
||||
],
|
||||
],
|
||||
'value' => [
|
||||
'description' => __('Amount discounted in cents.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'setup_fee_type' => array(
|
||||
],
|
||||
'setup_fee_type' => [
|
||||
'description' => __('Type of the discount for the setup fee value. Can be a percentage or absolute.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'percentage',
|
||||
'absolute',
|
||||
),
|
||||
),
|
||||
'setup_fee_value' => array(
|
||||
],
|
||||
],
|
||||
'setup_fee_value' => [
|
||||
'description' => __('Amount discounted for setup fees in cents.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this discount code as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_start' => array(
|
||||
],
|
||||
'date_start' => [
|
||||
'description' => __('Start date for the coupon code to be considered valid.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_expiration' => array(
|
||||
],
|
||||
'date_expiration' => [
|
||||
'description' => __('Expiration date for the coupon code.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when this discount code was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'allowed_products' => array(
|
||||
],
|
||||
'allowed_products' => [
|
||||
'description' => __('The list of products that allows this discount code to be used. If empty, all products will accept this code.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'limit_products' => array(
|
||||
],
|
||||
'limit_products' => [
|
||||
'description' => __('This discount code will be limited to be used in certain products? If set to true, you must define a list of allowed products.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,108 +18,108 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'name' => array(
|
||||
return [
|
||||
'name' => [
|
||||
'description' => __('Your discount code name, which is used as discount code title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'code' => array(
|
||||
],
|
||||
'code' => [
|
||||
'description' => __('A unique identification to redeem the discount code. E.g. PROMO10.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'description' => array(
|
||||
],
|
||||
'description' => [
|
||||
'description' => __('A description for the discount code, usually a short text.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'uses' => array(
|
||||
],
|
||||
'uses' => [
|
||||
'description' => __('Number of times this discount was applied.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'max_uses' => array(
|
||||
],
|
||||
'max_uses' => [
|
||||
'description' => __('The number of times this discount can be used before becoming inactive.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'apply_to_renewals' => array(
|
||||
],
|
||||
'apply_to_renewals' => [
|
||||
'description' => __('Wether or not we should apply the discount to membership renewals.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __("The type of the discount code. Can be 'percentage' (e.g. 10%% OFF), 'absolute' (e.g. $10 OFF).", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'percentage',
|
||||
'absolute',
|
||||
),
|
||||
),
|
||||
'value' => array(
|
||||
],
|
||||
],
|
||||
'value' => [
|
||||
'description' => __('Amount discounted in cents.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'setup_fee_type' => array(
|
||||
],
|
||||
'setup_fee_type' => [
|
||||
'description' => __('Type of the discount for the setup fee value. Can be a percentage or absolute.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'percentage',
|
||||
'absolute',
|
||||
),
|
||||
),
|
||||
'setup_fee_value' => array(
|
||||
],
|
||||
],
|
||||
'setup_fee_value' => [
|
||||
'description' => __('Amount discounted for setup fees in cents.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this discount code as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_start' => array(
|
||||
],
|
||||
'date_start' => [
|
||||
'description' => __('Start date for the coupon code to be considered valid.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_expiration' => array(
|
||||
],
|
||||
'date_expiration' => [
|
||||
'description' => __('Expiration date for the coupon code.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when this discount code was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'allowed_products' => array(
|
||||
],
|
||||
'allowed_products' => [
|
||||
'description' => __('The list of products that allows this discount code to be used. If empty, all products will accept this code.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'limit_products' => array(
|
||||
],
|
||||
'limit_products' => [
|
||||
'description' => __('This discount code will be limited to be used in certain products? If set to true, you must define a list of allowed products.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,62 +18,62 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'domain' => array(
|
||||
return [
|
||||
'domain' => [
|
||||
'description' => __("Your Domain name. You don't need to put http or https in front of your domain in this field. e.g: example.com.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'blog_id' => array(
|
||||
],
|
||||
'blog_id' => [
|
||||
'description' => __('The blog ID attached to this domain.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this domain as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'primary_domain' => array(
|
||||
],
|
||||
'primary_domain' => [
|
||||
'description' => __("Define true to set this as primary domain of a site, meaning it's the main url, or set false.", 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'secure' => array(
|
||||
],
|
||||
'secure' => [
|
||||
'description' => __('If this domain has some SSL security or not.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'stage' => array(
|
||||
],
|
||||
'stage' => [
|
||||
'description' => __('The state of the domain model object. Can be one of this options: checking-dns, checking-ssl-cert, done-without-ssl, done and failed.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'checking-dns',
|
||||
'checking-ssl-cert',
|
||||
'done-without-ssl',
|
||||
'done',
|
||||
'failed',
|
||||
),
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when the domain was created. If no date is set, the current date and time will be used.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,62 +18,62 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'domain' => array(
|
||||
return [
|
||||
'domain' => [
|
||||
'description' => __("Your Domain name. You don't need to put http or https in front of your domain in this field. e.g: example.com.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'blog_id' => array(
|
||||
],
|
||||
'blog_id' => [
|
||||
'description' => __('The blog ID attached to this domain.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this domain as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'primary_domain' => array(
|
||||
],
|
||||
'primary_domain' => [
|
||||
'description' => __("Define true to set this as primary domain of a site, meaning it's the main url, or set false.", 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'secure' => array(
|
||||
],
|
||||
'secure' => [
|
||||
'description' => __('If this domain has some SSL security or not.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'stage' => array(
|
||||
],
|
||||
'stage' => [
|
||||
'description' => __('The state of the domain model object. Can be one of this options: checking-dns, checking-ssl-cert, done-without-ssl, done and failed.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'checking-dns',
|
||||
'checking-ssl-cert',
|
||||
'done-without-ssl',
|
||||
'done',
|
||||
'failed',
|
||||
),
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when the domain was created. If no date is set, the current date and time will be used.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,127 +18,127 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'style' => array(
|
||||
return [
|
||||
'style' => [
|
||||
'description' => __("The email style. Can be 'html' or 'plain-text'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'html',
|
||||
'plain-text',
|
||||
),
|
||||
),
|
||||
'schedule' => array(
|
||||
],
|
||||
],
|
||||
'schedule' => [
|
||||
'description' => __('Whether or not this is a scheduled email.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __('The type being set.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'event' => array(
|
||||
],
|
||||
'event' => [
|
||||
'description' => __('The event that needs to be fired for this email to be sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'send_hours' => array(
|
||||
],
|
||||
'send_hours' => [
|
||||
'description' => __('The amount of hours that the email will wait before is sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'send_days' => array(
|
||||
],
|
||||
'send_days' => [
|
||||
'description' => __('The amount of days that the email will wait before is sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'schedule_type' => array(
|
||||
],
|
||||
'schedule_type' => [
|
||||
'description' => __("The type of schedule. Can be 'days' or 'hours'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'days',
|
||||
'hours',
|
||||
),
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('The name being set as title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_sender' => array(
|
||||
],
|
||||
'custom_sender' => [
|
||||
'description' => __('If has a custom sender.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_sender_name' => array(
|
||||
],
|
||||
'custom_sender_name' => [
|
||||
'description' => __('The name of the custom sender. E.g. From: John Doe.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_sender_email' => array(
|
||||
],
|
||||
'custom_sender_email' => [
|
||||
'description' => __('The email of the custom sender. E.g. From: johndoe@gmail.com.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'target' => array(
|
||||
],
|
||||
'target' => [
|
||||
'description' => __("If we should send this to a customer or to the network admin. Can be 'customer' or 'admin'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'customer',
|
||||
'admin',
|
||||
),
|
||||
),
|
||||
'send_copy_to_admin' => array(
|
||||
],
|
||||
],
|
||||
'send_copy_to_admin' => [
|
||||
'description' => __('Checks if we should send a copy of the email to the admin.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this email as active (true), which means available will fire when the event occur, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'legacy' => array(
|
||||
],
|
||||
'legacy' => [
|
||||
'description' => __('Whether or not this is a legacy email.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'title' => array(
|
||||
],
|
||||
'title' => [
|
||||
'description' => __('Post title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'content' => array(
|
||||
],
|
||||
'content' => [
|
||||
'description' => __('Post content.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'excerpt' => array(
|
||||
],
|
||||
'excerpt' => [
|
||||
'description' => __('Post excerpt.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Post creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Post last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,127 +18,127 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'style' => array(
|
||||
return [
|
||||
'style' => [
|
||||
'description' => __("The email style. Can be 'html' or 'plain-text'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'html',
|
||||
'plain-text',
|
||||
),
|
||||
),
|
||||
'schedule' => array(
|
||||
],
|
||||
],
|
||||
'schedule' => [
|
||||
'description' => __('Whether or not this is a scheduled email.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __('The type being set.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'event' => array(
|
||||
],
|
||||
'event' => [
|
||||
'description' => __('The event that needs to be fired for this email to be sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'send_hours' => array(
|
||||
],
|
||||
'send_hours' => [
|
||||
'description' => __('The amount of hours that the email will wait before is sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'send_days' => array(
|
||||
],
|
||||
'send_days' => [
|
||||
'description' => __('The amount of days that the email will wait before is sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'schedule_type' => array(
|
||||
],
|
||||
'schedule_type' => [
|
||||
'description' => __("The type of schedule. Can be 'days' or 'hours'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'days',
|
||||
'hours',
|
||||
),
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('The name being set as title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_sender' => array(
|
||||
],
|
||||
'custom_sender' => [
|
||||
'description' => __('If has a custom sender.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_sender_name' => array(
|
||||
],
|
||||
'custom_sender_name' => [
|
||||
'description' => __('The name of the custom sender. E.g. From: John Doe.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'custom_sender_email' => array(
|
||||
],
|
||||
'custom_sender_email' => [
|
||||
'description' => __('The email of the custom sender. E.g. From: johndoe@gmail.com.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'target' => array(
|
||||
],
|
||||
'target' => [
|
||||
'description' => __("If we should send this to a customer or to the network admin. Can be 'customer' or 'admin'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'customer',
|
||||
'admin',
|
||||
),
|
||||
),
|
||||
'send_copy_to_admin' => array(
|
||||
],
|
||||
],
|
||||
'send_copy_to_admin' => [
|
||||
'description' => __('Checks if we should send a copy of the email to the admin.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this email as active (true), which means available will fire when the event occur, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'legacy' => array(
|
||||
],
|
||||
'legacy' => [
|
||||
'description' => __('Whether or not this is a legacy email.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'title' => array(
|
||||
],
|
||||
'title' => [
|
||||
'description' => __('Post title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'content' => array(
|
||||
],
|
||||
'content' => [
|
||||
'description' => __('Post content.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'excerpt' => array(
|
||||
],
|
||||
'excerpt' => [
|
||||
'description' => __('Post excerpt.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Post creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Post last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,59 +18,59 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'severity' => array(
|
||||
return [
|
||||
'severity' => [
|
||||
'description' => __('Severity of the problem.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when the event was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'payload' => array(
|
||||
],
|
||||
'payload' => [
|
||||
'description' => __('Payload of the event.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'required' => true,
|
||||
),
|
||||
'initiator' => array(
|
||||
],
|
||||
'initiator' => [
|
||||
'description' => __('The type of user responsible for initiating the event. There are two options: Manual and System. By default, the event is saved as manual.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'system',
|
||||
'manual',
|
||||
),
|
||||
),
|
||||
'object_type' => array(
|
||||
],
|
||||
],
|
||||
'object_type' => [
|
||||
'description' => __("The type of object related to this event. It's usually the model name.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'slug' => array(
|
||||
],
|
||||
'slug' => [
|
||||
'description' => __('The event slug. It needs to be unique and preferably make it clear what it is about. Example: account_created is about creating an account.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'object_id' => array(
|
||||
],
|
||||
'object_id' => [
|
||||
'description' => __('The ID of the related objects.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,59 +18,59 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'severity' => array(
|
||||
return [
|
||||
'severity' => [
|
||||
'description' => __('Severity of the problem.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when the event was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'payload' => array(
|
||||
],
|
||||
'payload' => [
|
||||
'description' => __('Payload of the event.', 'wp-ultimo'),
|
||||
'type' => 'object',
|
||||
'required' => false,
|
||||
),
|
||||
'initiator' => array(
|
||||
],
|
||||
'initiator' => [
|
||||
'description' => __('The type of user responsible for initiating the event. There are two options: Manual and System. By default, the event is saved as manual.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'system',
|
||||
'manual',
|
||||
),
|
||||
),
|
||||
'object_type' => array(
|
||||
],
|
||||
],
|
||||
'object_type' => [
|
||||
'description' => __("The type of object related to this event. It's usually the model name.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'slug' => array(
|
||||
],
|
||||
'slug' => [
|
||||
'description' => __('The event slug. It needs to be unique and preferably make it clear what it is about. Example: account_created is about creating an account.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'object_id' => array(
|
||||
],
|
||||
'object_id' => [
|
||||
'description' => __('The ID of the related objects.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -20,162 +20,162 @@ use WP_Ultimo\Database\Memberships\Membership_Status;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'customer_id' => array(
|
||||
return [
|
||||
'customer_id' => [
|
||||
'description' => __('The ID of the customer attached to this membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'user_id' => array(
|
||||
],
|
||||
'user_id' => [
|
||||
'description' => __('The user ID attached to this membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'plan_id' => array(
|
||||
],
|
||||
'plan_id' => [
|
||||
'description' => __('The plan ID associated with the membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'addon_products' => array(
|
||||
],
|
||||
'addon_products' => [
|
||||
'description' => __('Additional products related to this membership. Services, Packages or other types of products.', 'wp-ultimo'),
|
||||
'type' => 'mixed',
|
||||
'required' => false,
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __("The currency that this membership. It's a 3-letter code. E.g. 'USD'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'duration' => array(
|
||||
],
|
||||
'duration' => [
|
||||
'description' => __('The interval period between a charge. Only the interval amount, the unit will be defined in another property.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'duration_unit' => array(
|
||||
],
|
||||
'duration_unit' => [
|
||||
'description' => __("The duration amount type. Can be 'day', 'week', 'month' or 'year'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'month',
|
||||
'week',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'amount' => array(
|
||||
],
|
||||
],
|
||||
'amount' => [
|
||||
'description' => __('The product amount.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'initial_amount' => array(
|
||||
],
|
||||
'initial_amount' => [
|
||||
'description' => __('The initial amount charged for this membership, including the setup fee.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date of creation of this membership.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_activated' => array(
|
||||
],
|
||||
'date_activated' => [
|
||||
'description' => __('Date when this membership was activated.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_trial_end' => array(
|
||||
],
|
||||
'date_trial_end' => [
|
||||
'description' => __('Date when the trial period ends, if this membership has or had a trial period.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_renewed' => array(
|
||||
],
|
||||
'date_renewed' => [
|
||||
'description' => __('Date when the membership was cancelled.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_cancellation' => array(
|
||||
],
|
||||
'date_cancellation' => [
|
||||
'description' => __('Date when the membership was cancelled.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_expiration' => array(
|
||||
],
|
||||
'date_expiration' => [
|
||||
'description' => __('Date when the membership will expiry.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_payment_plan_completed' => array(
|
||||
],
|
||||
'date_payment_plan_completed' => [
|
||||
'description' => __('Change of the payment completion for the plan value.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'auto_renew' => array(
|
||||
],
|
||||
'auto_renew' => [
|
||||
'description' => __('If this membership should auto-renewal.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'times_billed' => array(
|
||||
],
|
||||
'times_billed' => [
|
||||
'description' => __('Amount of times this membership got billed.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'billing_cycles' => array(
|
||||
],
|
||||
'billing_cycles' => [
|
||||
'description' => __('Maximum times we should charge this membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'status' => array(
|
||||
],
|
||||
'status' => [
|
||||
'description' => __("The membership status. Can be 'pending', 'active', 'on-hold', 'expired', 'cancelled' or other values added by third-party add-ons.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => Membership_Status::get_allowed_list(),
|
||||
),
|
||||
'gateway_customer_id' => array(
|
||||
],
|
||||
'gateway_customer_id' => [
|
||||
'description' => __('The ID of the customer on the payment gateway database.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'gateway_subscription_id' => array(
|
||||
],
|
||||
'gateway_subscription_id' => [
|
||||
'description' => __('The ID of the subscription on the payment gateway database.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'gateway' => array(
|
||||
],
|
||||
'gateway' => [
|
||||
'description' => __('ID of the gateway being used on this subscription.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'signup_method' => array(
|
||||
],
|
||||
'signup_method' => [
|
||||
'description' => __('Signup method used to create this membership.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'upgraded_from' => array(
|
||||
],
|
||||
'upgraded_from' => [
|
||||
'description' => __('Plan that this membership upgraded from.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Date this membership was last modified.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'disabled' => array(
|
||||
],
|
||||
'disabled' => [
|
||||
'description' => __('If this membership is a disabled one.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'recurring' => array(
|
||||
],
|
||||
'recurring' => [
|
||||
'description' => __('If this membership is recurring (true), which means the customer paid a defined amount each period of time, or not recurring (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -20,162 +20,162 @@ use WP_Ultimo\Database\Memberships\Membership_Status;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'customer_id' => array(
|
||||
return [
|
||||
'customer_id' => [
|
||||
'description' => __('The ID of the customer attached to this membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'user_id' => array(
|
||||
],
|
||||
'user_id' => [
|
||||
'description' => __('The user ID attached to this membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'plan_id' => array(
|
||||
],
|
||||
'plan_id' => [
|
||||
'description' => __('The plan ID associated with the membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'addon_products' => array(
|
||||
],
|
||||
'addon_products' => [
|
||||
'description' => __('Additional products related to this membership. Services, Packages or other types of products.', 'wp-ultimo'),
|
||||
'type' => 'mixed',
|
||||
'required' => false,
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __("The currency that this membership. It's a 3-letter code. E.g. 'USD'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'duration' => array(
|
||||
],
|
||||
'duration' => [
|
||||
'description' => __('The interval period between a charge. Only the interval amount, the unit will be defined in another property.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'duration_unit' => array(
|
||||
],
|
||||
'duration_unit' => [
|
||||
'description' => __("The duration amount type. Can be 'day', 'week', 'month' or 'year'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'month',
|
||||
'week',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'amount' => array(
|
||||
],
|
||||
],
|
||||
'amount' => [
|
||||
'description' => __('The product amount.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'initial_amount' => array(
|
||||
],
|
||||
'initial_amount' => [
|
||||
'description' => __('The initial amount charged for this membership, including the setup fee.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date of creation of this membership.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_activated' => array(
|
||||
],
|
||||
'date_activated' => [
|
||||
'description' => __('Date when this membership was activated.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_trial_end' => array(
|
||||
],
|
||||
'date_trial_end' => [
|
||||
'description' => __('Date when the trial period ends, if this membership has or had a trial period.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_renewed' => array(
|
||||
],
|
||||
'date_renewed' => [
|
||||
'description' => __('Date when the membership was cancelled.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_cancellation' => array(
|
||||
],
|
||||
'date_cancellation' => [
|
||||
'description' => __('Date when the membership was cancelled.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_expiration' => array(
|
||||
],
|
||||
'date_expiration' => [
|
||||
'description' => __('Date when the membership will expiry.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_payment_plan_completed' => array(
|
||||
],
|
||||
'date_payment_plan_completed' => [
|
||||
'description' => __('Change of the payment completion for the plan value.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'auto_renew' => array(
|
||||
],
|
||||
'auto_renew' => [
|
||||
'description' => __('If this membership should auto-renewal.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'times_billed' => array(
|
||||
],
|
||||
'times_billed' => [
|
||||
'description' => __('Amount of times this membership got billed.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'billing_cycles' => array(
|
||||
],
|
||||
'billing_cycles' => [
|
||||
'description' => __('Maximum times we should charge this membership.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'status' => array(
|
||||
],
|
||||
'status' => [
|
||||
'description' => __("The membership status. Can be 'pending', 'active', 'on-hold', 'expired', 'cancelled' or other values added by third-party add-ons.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => Membership_Status::get_allowed_list(),
|
||||
),
|
||||
'gateway_customer_id' => array(
|
||||
],
|
||||
'gateway_customer_id' => [
|
||||
'description' => __('The ID of the customer on the payment gateway database.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'gateway_subscription_id' => array(
|
||||
],
|
||||
'gateway_subscription_id' => [
|
||||
'description' => __('The ID of the subscription on the payment gateway database.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'gateway' => array(
|
||||
],
|
||||
'gateway' => [
|
||||
'description' => __('ID of the gateway being used on this subscription.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'signup_method' => array(
|
||||
],
|
||||
'signup_method' => [
|
||||
'description' => __('Signup method used to create this membership.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'upgraded_from' => array(
|
||||
],
|
||||
'upgraded_from' => [
|
||||
'description' => __('Plan that this membership upgraded from.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Date this membership was last modified.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'disabled' => array(
|
||||
],
|
||||
'disabled' => [
|
||||
'description' => __('If this membership is a disabled one.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'recurring' => array(
|
||||
],
|
||||
'recurring' => [
|
||||
'description' => __('If this membership is recurring (true), which means the customer paid a defined amount each period of time, or not recurring (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -20,106 +20,106 @@ use WP_Ultimo\Database\Payments\Payment_Status;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'customer_id' => array(
|
||||
return [
|
||||
'customer_id' => [
|
||||
'description' => __('The ID of the customer attached to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'membership_id' => array(
|
||||
],
|
||||
'membership_id' => [
|
||||
'description' => __('The ID of the membership attached to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'parent_id' => array(
|
||||
],
|
||||
'parent_id' => [
|
||||
'description' => __('The ID from another payment that this payment is related to.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __("The currency of this payment. It's a 3-letter code. E.g. 'USD'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'subtotal' => array(
|
||||
],
|
||||
'subtotal' => [
|
||||
'description' => __('Value before taxes, discounts, fees and other changes.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => true,
|
||||
),
|
||||
'refund_total' => array(
|
||||
],
|
||||
'refund_total' => [
|
||||
'description' => __('Total amount refunded.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => false,
|
||||
),
|
||||
'tax_total' => array(
|
||||
],
|
||||
'tax_total' => [
|
||||
'description' => __('The amount, in currency, of the tax.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => false,
|
||||
),
|
||||
'discount_code' => array(
|
||||
],
|
||||
'discount_code' => [
|
||||
'description' => __('Discount code used.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'total' => array(
|
||||
],
|
||||
'total' => [
|
||||
'description' => __('This takes into account fees, discounts and credits.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => true,
|
||||
),
|
||||
'status' => array(
|
||||
],
|
||||
'status' => [
|
||||
'description' => __("The payment status: Can be 'pending', 'completed', 'refunded', 'partially-refunded', 'partially-paid', 'failed', 'cancelled' or other values added by third-party add-ons.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => Payment_Status::get_allowed_list(),
|
||||
),
|
||||
'gateway' => array(
|
||||
],
|
||||
'gateway' => [
|
||||
'description' => __('ID of the gateway being used on this payment.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'product_id' => array(
|
||||
],
|
||||
'product_id' => [
|
||||
'description' => __('The ID of the product of this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'gateway_payment_id' => array(
|
||||
],
|
||||
'gateway_payment_id' => [
|
||||
'description' => __('The ID of the payment on the gateway, if it exists.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'discount_total' => array(
|
||||
],
|
||||
'discount_total' => [
|
||||
'description' => __('The total value of the discounts applied to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'invoice_number' => array(
|
||||
],
|
||||
'invoice_number' => [
|
||||
'description' => __('Sequential invoice number assigned to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'cancel_membership_on_refund' => array(
|
||||
],
|
||||
'cancel_membership_on_refund' => [
|
||||
'description' => __('Holds if we need to cancel the membership on refund.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -20,106 +20,106 @@ use WP_Ultimo\Database\Payments\Payment_Status;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'customer_id' => array(
|
||||
return [
|
||||
'customer_id' => [
|
||||
'description' => __('The ID of the customer attached to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'membership_id' => array(
|
||||
],
|
||||
'membership_id' => [
|
||||
'description' => __('The ID of the membership attached to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'parent_id' => array(
|
||||
],
|
||||
'parent_id' => [
|
||||
'description' => __('The ID from another payment that this payment is related to.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __("The currency of this payment. It's a 3-letter code. E.g. 'USD'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'subtotal' => array(
|
||||
],
|
||||
'subtotal' => [
|
||||
'description' => __('Value before taxes, discounts, fees and other changes.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => false,
|
||||
),
|
||||
'refund_total' => array(
|
||||
],
|
||||
'refund_total' => [
|
||||
'description' => __('Total amount refunded.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => false,
|
||||
),
|
||||
'tax_total' => array(
|
||||
],
|
||||
'tax_total' => [
|
||||
'description' => __('The amount, in currency, of the tax.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => false,
|
||||
),
|
||||
'discount_code' => array(
|
||||
],
|
||||
'discount_code' => [
|
||||
'description' => __('Discount code used.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'total' => array(
|
||||
],
|
||||
'total' => [
|
||||
'description' => __('This takes into account fees, discounts and credits.', 'wp-ultimo'),
|
||||
'type' => 'number',
|
||||
'required' => false,
|
||||
),
|
||||
'status' => array(
|
||||
],
|
||||
'status' => [
|
||||
'description' => __("The payment status: Can be 'pending', 'completed', 'refunded', 'partially-refunded', 'partially-paid', 'failed', 'cancelled' or other values added by third-party add-ons.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => Payment_Status::get_allowed_list(),
|
||||
),
|
||||
'gateway' => array(
|
||||
],
|
||||
'gateway' => [
|
||||
'description' => __('ID of the gateway being used on this payment.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'product_id' => array(
|
||||
],
|
||||
'product_id' => [
|
||||
'description' => __('The ID of the product of this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'gateway_payment_id' => array(
|
||||
],
|
||||
'gateway_payment_id' => [
|
||||
'description' => __('The ID of the payment on the gateway, if it exists.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'discount_total' => array(
|
||||
],
|
||||
'discount_total' => [
|
||||
'description' => __('The total value of the discounts applied to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'invoice_number' => array(
|
||||
],
|
||||
'invoice_number' => [
|
||||
'description' => __('Sequential invoice number assigned to this payment.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'cancel_membership_on_refund' => array(
|
||||
],
|
||||
'cancel_membership_on_refund' => [
|
||||
'description' => __('Holds if we need to cancel the membership on refund.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,182 +18,182 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'featured_image_id' => array(
|
||||
return [
|
||||
'featured_image_id' => [
|
||||
'description' => __('The ID of the feature image of the product.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'slug' => array(
|
||||
],
|
||||
'slug' => [
|
||||
'description' => __('The product slug. It needs to be unique and preferably make it clear what it is about. Example: my_new_product.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('Your product name, which is used as product title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'description' => array(
|
||||
],
|
||||
'description' => [
|
||||
'description' => __('A description for the product, usually a short text.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __("The currency that this product accepts. It's a 3-letter code. E.g. 'USD'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'pricing_type' => array(
|
||||
],
|
||||
'pricing_type' => [
|
||||
'description' => __("The pricing type can be 'free', 'paid' or 'contact_us'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'free',
|
||||
'paid',
|
||||
'contact_us',
|
||||
),
|
||||
),
|
||||
'trial_duration' => array(
|
||||
],
|
||||
],
|
||||
'trial_duration' => [
|
||||
'description' => __('The duration of the trial period of this product, if the product has one.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'trial_duration_unit' => array(
|
||||
],
|
||||
'trial_duration_unit' => [
|
||||
'description' => __('The unit of the trial duration amount. Can be day, week, month or year.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'week',
|
||||
'month',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'duration' => array(
|
||||
],
|
||||
],
|
||||
'duration' => [
|
||||
'description' => __('Time interval between charges.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'duration_unit' => array(
|
||||
],
|
||||
'duration_unit' => [
|
||||
'description' => __('Time interval unit between charges.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'month',
|
||||
'week',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'amount' => array(
|
||||
],
|
||||
],
|
||||
'amount' => [
|
||||
'description' => __('The value of this product. E.g. 19.99.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'setup_fee' => array(
|
||||
],
|
||||
'setup_fee' => [
|
||||
'description' => __('The setup fee value, if the product has one. E.g. 159.99.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this product as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __("The default product types are 'product', 'service' and 'package'. More types can be add using the product type filter.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'plan',
|
||||
'service',
|
||||
'package',
|
||||
),
|
||||
),
|
||||
'parent_id' => array(
|
||||
],
|
||||
],
|
||||
'parent_id' => [
|
||||
'description' => __('The ID from another Product that this product is related to.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'recurring' => array(
|
||||
],
|
||||
'recurring' => [
|
||||
'description' => __('Set this product as a recurring one (true), which means the customer paid a defined amount each period of time, or not recurring (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'billing_cycles' => array(
|
||||
],
|
||||
'billing_cycles' => [
|
||||
'description' => __('The number of times we should charge this product.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when this was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Date when this was last modified.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'taxable' => array(
|
||||
],
|
||||
'taxable' => [
|
||||
'description' => __('Set this product as a taxable one (true), which means tax rules are applied to, or not taxable (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'tax_category' => array(
|
||||
],
|
||||
'tax_category' => [
|
||||
'description' => __('Category of taxes applied to this product. You need to set this if taxable is set to true.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'contact_us_label' => array(
|
||||
],
|
||||
'contact_us_label' => [
|
||||
'description' => __("If the product is the 'contact_us' type, it will need a label for the contact us button.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'contact_us_link' => array(
|
||||
],
|
||||
'contact_us_link' => [
|
||||
'description' => __('The url where the contact us button will lead to.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'feature_list' => array(
|
||||
],
|
||||
'feature_list' => [
|
||||
'description' => __('A list (array) of features of the product.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'customer_role' => array(
|
||||
],
|
||||
'customer_role' => [
|
||||
'description' => __('The customer role of this product.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'available_addons' => array(
|
||||
],
|
||||
'available_addons' => [
|
||||
'description' => __('The available addons of this product.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'group' => array(
|
||||
],
|
||||
'group' => [
|
||||
'description' => __('The group of this product, if has any.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'legacy_options' => array(
|
||||
],
|
||||
'legacy_options' => [
|
||||
'description' => __('If the legacy options are enabled.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'featured_plan' => array(
|
||||
],
|
||||
'featured_plan' => [
|
||||
'description' => __('Feature list for pricing tables.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,182 +18,182 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'featured_image_id' => array(
|
||||
return [
|
||||
'featured_image_id' => [
|
||||
'description' => __('The ID of the feature image of the product.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'slug' => array(
|
||||
],
|
||||
'slug' => [
|
||||
'description' => __('The product slug. It needs to be unique and preferably make it clear what it is about. Example: my_new_product.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('Your product name, which is used as product title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'description' => array(
|
||||
],
|
||||
'description' => [
|
||||
'description' => __('A description for the product, usually a short text.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'currency' => array(
|
||||
],
|
||||
'currency' => [
|
||||
'description' => __("The currency that this product accepts. It's a 3-letter code. E.g. 'USD'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'pricing_type' => array(
|
||||
],
|
||||
'pricing_type' => [
|
||||
'description' => __("The pricing type can be 'free', 'paid' or 'contact_us'.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'free',
|
||||
'paid',
|
||||
'contact_us',
|
||||
),
|
||||
),
|
||||
'trial_duration' => array(
|
||||
],
|
||||
],
|
||||
'trial_duration' => [
|
||||
'description' => __('The duration of the trial period of this product, if the product has one.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'trial_duration_unit' => array(
|
||||
],
|
||||
'trial_duration_unit' => [
|
||||
'description' => __('The unit of the trial duration amount. Can be day, week, month or year.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'week',
|
||||
'month',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'duration' => array(
|
||||
],
|
||||
],
|
||||
'duration' => [
|
||||
'description' => __('Time interval between charges.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'duration_unit' => array(
|
||||
],
|
||||
'duration_unit' => [
|
||||
'description' => __('Time interval unit between charges.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'day',
|
||||
'month',
|
||||
'week',
|
||||
'year',
|
||||
),
|
||||
),
|
||||
'amount' => array(
|
||||
],
|
||||
],
|
||||
'amount' => [
|
||||
'description' => __('The value of this product. E.g. 19.99.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'setup_fee' => array(
|
||||
],
|
||||
'setup_fee' => [
|
||||
'description' => __('The setup fee value, if the product has one. E.g. 159.99.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this product as active (true), which means available to be used, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __("The default product types are 'product', 'service' and 'package'. More types can be add using the product type filter.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'plan',
|
||||
'service',
|
||||
'package',
|
||||
),
|
||||
),
|
||||
'parent_id' => array(
|
||||
],
|
||||
],
|
||||
'parent_id' => [
|
||||
'description' => __('The ID from another Product that this product is related to.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'recurring' => array(
|
||||
],
|
||||
'recurring' => [
|
||||
'description' => __('Set this product as a recurring one (true), which means the customer paid a defined amount each period of time, or not recurring (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'billing_cycles' => array(
|
||||
],
|
||||
'billing_cycles' => [
|
||||
'description' => __('The number of times we should charge this product.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when this was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Date when this was last modified.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'taxable' => array(
|
||||
],
|
||||
'taxable' => [
|
||||
'description' => __('Set this product as a taxable one (true), which means tax rules are applied to, or not taxable (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'tax_category' => array(
|
||||
],
|
||||
'tax_category' => [
|
||||
'description' => __('Category of taxes applied to this product. You need to set this if taxable is set to true.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'contact_us_label' => array(
|
||||
],
|
||||
'contact_us_label' => [
|
||||
'description' => __("If the product is the 'contact_us' type, it will need a label for the contact us button.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'contact_us_link' => array(
|
||||
],
|
||||
'contact_us_link' => [
|
||||
'description' => __('The url where the contact us button will lead to.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'feature_list' => array(
|
||||
],
|
||||
'feature_list' => [
|
||||
'description' => __('A list (array) of features of the product.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'customer_role' => array(
|
||||
],
|
||||
'customer_role' => [
|
||||
'description' => __('The customer role of this product.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'available_addons' => array(
|
||||
],
|
||||
'available_addons' => [
|
||||
'description' => __('The available addons of this product.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'group' => array(
|
||||
],
|
||||
'group' => [
|
||||
'description' => __('The group of this product, if has any.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'legacy_options' => array(
|
||||
],
|
||||
'legacy_options' => [
|
||||
'description' => __('If the legacy options are enabled.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'featured_plan' => array(
|
||||
],
|
||||
'featured_plan' => [
|
||||
'description' => __('Feature list for pricing tables.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,148 +18,148 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'categories' => array(
|
||||
return [
|
||||
'categories' => [
|
||||
'description' => __('The categories this site belongs to.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'featured_image_id' => array(
|
||||
],
|
||||
'featured_image_id' => [
|
||||
'description' => __('The ID of the feature image of the site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'site_id' => array(
|
||||
],
|
||||
'site_id' => [
|
||||
'description' => __('The network ID for this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'title' => array(
|
||||
],
|
||||
'title' => [
|
||||
'description' => __('The site title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('The site name.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'description' => array(
|
||||
],
|
||||
'description' => [
|
||||
'description' => __('A description for the site, usually a short text.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'domain' => array(
|
||||
],
|
||||
'domain' => [
|
||||
'description' => __("The site domain. You don't need to put http or https in front of your domain in this field. e.g: example.com.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'path' => array(
|
||||
],
|
||||
'path' => [
|
||||
'description' => __('Path of the site. Used when in sub-directory mode.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'registered' => array(
|
||||
],
|
||||
'registered' => [
|
||||
'description' => __('Date when the site was registered.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'last_updated' => array(
|
||||
],
|
||||
'last_updated' => [
|
||||
'description' => __('Date of the last update on this site.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Holds the ID of the customer that owns this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'public' => array(
|
||||
],
|
||||
'public' => [
|
||||
'description' => __('Set true if this site is a public one, false if not.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'archived' => array(
|
||||
],
|
||||
'archived' => [
|
||||
'description' => __('Is this an archived site.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'mature' => array(
|
||||
],
|
||||
'mature' => [
|
||||
'description' => __('Is this a site with mature content.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'spam' => array(
|
||||
],
|
||||
'spam' => [
|
||||
'description' => __('Is this an spam site.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'deleted' => array(
|
||||
],
|
||||
'deleted' => [
|
||||
'description' => __('Is this site deleted.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'lang_id' => array(
|
||||
],
|
||||
'lang_id' => [
|
||||
'description' => __('The ID of the language being used on this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'customer_id' => array(
|
||||
],
|
||||
'customer_id' => [
|
||||
'description' => __('The ID of the customer that owns this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'membership_id' => array(
|
||||
],
|
||||
'membership_id' => [
|
||||
'description' => __('The ID of the membership associated with this site, if any.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => true,
|
||||
),
|
||||
'template_id' => array(
|
||||
],
|
||||
'template_id' => [
|
||||
'description' => __('The ID of the templated used to create this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __('The type of this particular site. Can be default, site_template, customer_owned, pending, external, main or other values added by third-party add-ons.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'default',
|
||||
'site_template',
|
||||
'customer_owned',
|
||||
'pending',
|
||||
'external',
|
||||
'main',
|
||||
),
|
||||
),
|
||||
'signup_options' => array(
|
||||
],
|
||||
],
|
||||
'signup_options' => [
|
||||
'description' => __('Keeps signup options for the site.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'signup_meta' => array(
|
||||
],
|
||||
'signup_meta' => [
|
||||
'description' => __('Keeps signup meta for the site.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,148 +18,148 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'categories' => array(
|
||||
return [
|
||||
'categories' => [
|
||||
'description' => __('The categories this site belongs to.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'featured_image_id' => array(
|
||||
],
|
||||
'featured_image_id' => [
|
||||
'description' => __('The ID of the feature image of the site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'site_id' => array(
|
||||
],
|
||||
'site_id' => [
|
||||
'description' => __('The network ID for this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'title' => array(
|
||||
],
|
||||
'title' => [
|
||||
'description' => __('The site title.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'name' => array(
|
||||
],
|
||||
'name' => [
|
||||
'description' => __('The site name.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'description' => array(
|
||||
],
|
||||
'description' => [
|
||||
'description' => __('A description for the site, usually a short text.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'domain' => array(
|
||||
],
|
||||
'domain' => [
|
||||
'description' => __("The site domain. You don't need to put http or https in front of your domain in this field. e.g: example.com.", 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'path' => array(
|
||||
],
|
||||
'path' => [
|
||||
'description' => __('Path of the site. Used when in sub-directory mode.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'registered' => array(
|
||||
],
|
||||
'registered' => [
|
||||
'description' => __('Date when the site was registered.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'last_updated' => array(
|
||||
],
|
||||
'last_updated' => [
|
||||
'description' => __('Date of the last update on this site.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Holds the ID of the customer that owns this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'public' => array(
|
||||
],
|
||||
'public' => [
|
||||
'description' => __('Set true if this site is a public one, false if not.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'archived' => array(
|
||||
],
|
||||
'archived' => [
|
||||
'description' => __('Is this an archived site.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'mature' => array(
|
||||
],
|
||||
'mature' => [
|
||||
'description' => __('Is this a site with mature content.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'spam' => array(
|
||||
],
|
||||
'spam' => [
|
||||
'description' => __('Is this an spam site.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'deleted' => array(
|
||||
],
|
||||
'deleted' => [
|
||||
'description' => __('Is this site deleted.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'lang_id' => array(
|
||||
],
|
||||
'lang_id' => [
|
||||
'description' => __('The ID of the language being used on this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'customer_id' => array(
|
||||
],
|
||||
'customer_id' => [
|
||||
'description' => __('The ID of the customer that owns this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'membership_id' => array(
|
||||
],
|
||||
'membership_id' => [
|
||||
'description' => __('The ID of the membership associated with this site, if any.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'template_id' => array(
|
||||
],
|
||||
'template_id' => [
|
||||
'description' => __('The ID of the templated used to create this site.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'type' => array(
|
||||
],
|
||||
'type' => [
|
||||
'description' => __('The type of this particular site. Can be default, site_template, customer_owned, pending, external, main or other values added by third-party add-ons.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
'enum' => array(
|
||||
'enum' => [
|
||||
'default',
|
||||
'site_template',
|
||||
'customer_owned',
|
||||
'pending',
|
||||
'external',
|
||||
'main',
|
||||
),
|
||||
),
|
||||
'signup_options' => array(
|
||||
],
|
||||
],
|
||||
'signup_options' => [
|
||||
'description' => __('Keeps signup options for the site.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'signup_meta' => array(
|
||||
],
|
||||
'signup_meta' => [
|
||||
'description' => __('Keeps signup meta for the site.', 'wp-ultimo'),
|
||||
'type' => 'array',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Model creation date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,65 +18,65 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'name' => array(
|
||||
return [
|
||||
'name' => [
|
||||
'description' => __('Webhook name, which is used as product title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'webhook_url' => array(
|
||||
],
|
||||
'webhook_url' => [
|
||||
'description' => __('The URL used for the webhook call.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'event' => array(
|
||||
],
|
||||
'event' => [
|
||||
'description' => __('The event that needs to be fired for this webhook to be sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'event_count' => array(
|
||||
],
|
||||
'event_count' => [
|
||||
'description' => __('How many times this webhook was sent.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this webhook as active (true), which means available will fire when the event occur, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'hidden' => array(
|
||||
],
|
||||
'hidden' => [
|
||||
'description' => __('Is this webhook hidden.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when this was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'integration' => array(
|
||||
],
|
||||
'integration' => [
|
||||
'description' => __('The integration that created this webhook.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => true,
|
||||
),
|
||||
'date_last_failed' => array(
|
||||
],
|
||||
'date_last_failed' => [
|
||||
'description' => __('The date when this webhook last fail.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -18,65 +18,65 @@ defined('ABSPATH') || exit;
|
||||
*
|
||||
* @since 2.0.11
|
||||
*/
|
||||
return array(
|
||||
'name' => array(
|
||||
return [
|
||||
'name' => [
|
||||
'description' => __('Webhook name, which is used as product title as well.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'webhook_url' => array(
|
||||
],
|
||||
'webhook_url' => [
|
||||
'description' => __('The URL used for the webhook call.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'event' => array(
|
||||
],
|
||||
'event' => [
|
||||
'description' => __('The event that needs to be fired for this webhook to be sent.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'event_count' => array(
|
||||
],
|
||||
'event_count' => [
|
||||
'description' => __('How many times this webhook was sent.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'active' => array(
|
||||
],
|
||||
'active' => [
|
||||
'description' => __('Set this webhook as active (true), which means available will fire when the event occur, or inactive (false).', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'hidden' => array(
|
||||
],
|
||||
'hidden' => [
|
||||
'description' => __('Is this webhook hidden.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
'date_created' => array(
|
||||
],
|
||||
'date_created' => [
|
||||
'description' => __('Date when this was created.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'integration' => array(
|
||||
],
|
||||
'integration' => [
|
||||
'description' => __('The integration that created this webhook.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_last_failed' => array(
|
||||
],
|
||||
'date_last_failed' => [
|
||||
'description' => __('The date when this webhook last fail.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'date_modified' => array(
|
||||
],
|
||||
'date_modified' => [
|
||||
'description' => __('Model last modification date.', 'wp-ultimo'),
|
||||
'type' => 'string',
|
||||
'required' => false,
|
||||
),
|
||||
'migrated_from_id' => array(
|
||||
],
|
||||
'migrated_from_id' => [
|
||||
'description' => __('The ID of the original 1.X model that was used to generate this item on migration.', 'wp-ultimo'),
|
||||
'type' => 'integer',
|
||||
'required' => false,
|
||||
),
|
||||
'skip_validation' => array(
|
||||
],
|
||||
'skip_validation' => [
|
||||
'description' => __('Set true to have field information validation bypassed when saving this event.', 'wp-ultimo'),
|
||||
'type' => 'boolean',
|
||||
'required' => false,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
@ -28,13 +28,13 @@ trait Rest_Api {
|
||||
* @since 2.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $enabled_rest_endpoints = array(
|
||||
protected $enabled_rest_endpoints = [
|
||||
'get_item',
|
||||
'get_items',
|
||||
'create_item',
|
||||
'update_item',
|
||||
'delete_item',
|
||||
);
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns the base used right after the namespace.
|
||||
@ -54,14 +54,14 @@ trait Rest_Api {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public function enable_rest_api() {
|
||||
public function enable_rest_api(): void {
|
||||
|
||||
$is_enabled = \WP_Ultimo\API::get_instance()->is_api_enabled();
|
||||
|
||||
if ($is_enabled) {
|
||||
add_action('rest_api_init', array($this, 'register_routes_general'));
|
||||
add_action('rest_api_init', [$this, 'register_routes_general']);
|
||||
|
||||
add_action('rest_api_init', array($this, 'register_routes_with_id'));
|
||||
add_action('rest_api_init', [$this, 'register_routes_with_id']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,27 +71,27 @@ trait Rest_Api {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public function register_routes_general() {
|
||||
public function register_routes_general(): void {
|
||||
|
||||
$routes = array();
|
||||
$routes = [];
|
||||
|
||||
if (in_array('get_items', $this->enabled_rest_endpoints, true)) {
|
||||
$routes = array(
|
||||
array(
|
||||
$routes = [
|
||||
[
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_items_rest'),
|
||||
'permission_callback' => array($this, 'get_items_permissions_check'),
|
||||
),
|
||||
);
|
||||
'callback' => [$this, 'get_items_rest'],
|
||||
'permission_callback' => [$this, 'get_items_permissions_check'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
if (in_array('create_item', $this->enabled_rest_endpoints, true)) {
|
||||
$routes[] = array(
|
||||
$routes[] = [
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
'callback' => array($this, 'create_item_rest'),
|
||||
'permission_callback' => array($this, 'create_item_permissions_check'),
|
||||
'callback' => [$this, 'create_item_rest'],
|
||||
'permission_callback' => [$this, 'create_item_permissions_check'],
|
||||
'args' => $this->get_arguments_schema(),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
if ( ! empty($routes)) {
|
||||
@ -112,33 +112,33 @@ trait Rest_Api {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public function register_routes_with_id() {
|
||||
public function register_routes_with_id(): void {
|
||||
|
||||
$routes = array();
|
||||
$routes = [];
|
||||
|
||||
if (in_array('get_item', $this->enabled_rest_endpoints, true)) {
|
||||
$routes[] = array(
|
||||
$routes[] = [
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item_rest'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
);
|
||||
'callback' => [$this, 'get_item_rest'],
|
||||
'permission_callback' => [$this, 'get_item_permissions_check'],
|
||||
];
|
||||
}
|
||||
|
||||
if (in_array('update_item', $this->enabled_rest_endpoints, true)) {
|
||||
$routes[] = array(
|
||||
$routes[] = [
|
||||
'methods' => \WP_REST_Server::EDITABLE,
|
||||
'callback' => array($this, 'update_item_rest'),
|
||||
'permission_callback' => array($this, 'update_item_permissions_check'),
|
||||
'callback' => [$this, 'update_item_rest'],
|
||||
'permission_callback' => [$this, 'update_item_permissions_check'],
|
||||
'args' => $this->get_arguments_schema(true),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
if (in_array('delete_item', $this->enabled_rest_endpoints, true)) {
|
||||
$routes[] = array(
|
||||
$routes[] = [
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
'callback' => array($this, 'delete_item_rest'),
|
||||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
);
|
||||
'callback' => [$this, 'delete_item_rest'],
|
||||
'permission_callback' => [$this, 'delete_item_permissions_check'],
|
||||
];
|
||||
}
|
||||
|
||||
if ( ! empty($routes)) {
|
||||
@ -165,7 +165,7 @@ trait Rest_Api {
|
||||
$item = $this->model_class::get_by_id($request['id']);
|
||||
|
||||
if (empty($item)) {
|
||||
return new \WP_Error("wu_rest_{$this->slug}_invalid_id", __('Item not found.', 'wp-ultimo'), array('status' => 404));
|
||||
return new \WP_Error("wu_rest_{$this->slug}_invalid_id", __('Item not found.', 'wp-ultimo'), ['status' => 404]);
|
||||
}
|
||||
|
||||
return rest_ensure_response($item);
|
||||
@ -196,7 +196,7 @@ trait Rest_Api {
|
||||
|
||||
$body = json_decode($request->get_body(), true);
|
||||
|
||||
$model_name = (new $this->model_class(array()))->model;
|
||||
$model_name = (new $this->model_class([]))->model;
|
||||
|
||||
$saver_function = "wu_create_{$model_name}";
|
||||
|
||||
@ -215,7 +215,7 @@ trait Rest_Api {
|
||||
}
|
||||
|
||||
if ( ! $saved) {
|
||||
return new \WP_Error("wu_rest_{$this->slug}", __('Something went wrong (Code 1).', 'wp-ultimo'), array('status' => 400));
|
||||
return new \WP_Error("wu_rest_{$this->slug}", __('Something went wrong (Code 1).', 'wp-ultimo'), ['status' => 400]);
|
||||
}
|
||||
|
||||
return rest_ensure_response($item);
|
||||
@ -235,12 +235,12 @@ trait Rest_Api {
|
||||
$item = $this->model_class::get_by_id($id);
|
||||
|
||||
if (empty($item)) {
|
||||
return new \WP_Error("wu_rest_{$this->slug}_invalid_id", __('Item not found.', 'wp-ultimo'), array('status' => 404));
|
||||
return new \WP_Error("wu_rest_{$this->slug}_invalid_id", __('Item not found.', 'wp-ultimo'), ['status' => 404]);
|
||||
}
|
||||
|
||||
$params = array_filter(
|
||||
json_decode($request->get_body(), true),
|
||||
array($this, 'is_not_credential_key'),
|
||||
[$this, 'is_not_credential_key'],
|
||||
ARRAY_FILTER_USE_KEY
|
||||
);
|
||||
|
||||
@ -250,7 +250,7 @@ trait Rest_Api {
|
||||
if ($param === 'meta') {
|
||||
$item->update_meta_batch($value);
|
||||
} elseif (method_exists($item, $set_method)) {
|
||||
call_user_func(array($item, $set_method), $value);
|
||||
call_user_func([$item, $set_method], $value);
|
||||
} else {
|
||||
$error_message = sprintf(
|
||||
/* translators: 1. Object class name; 2. Set method name */
|
||||
@ -262,7 +262,7 @@ trait Rest_Api {
|
||||
return new \WP_Error(
|
||||
"wu_rest_{$this->slug}_invalid_set_method",
|
||||
$error_message,
|
||||
array('status' => 400)
|
||||
['status' => 400]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -292,7 +292,7 @@ trait Rest_Api {
|
||||
$item = $this->model_class::get_by_id($request['id']);
|
||||
|
||||
if (empty($item)) {
|
||||
return new \WP_Error("wu_rest_{$this->slug}_invalid_id", __('Item not found.', 'wp-ultimo'), array('status' => 404));
|
||||
return new \WP_Error("wu_rest_{$this->slug}_invalid_id", __('Item not found.', 'wp-ultimo'), ['status' => 404]);
|
||||
}
|
||||
|
||||
$result = $item->delete();
|
||||
@ -440,12 +440,12 @@ trait Rest_Api {
|
||||
*/
|
||||
private function is_not_credential_key($value) {
|
||||
|
||||
$credentials_keys = array(
|
||||
$credentials_keys = [
|
||||
'api_key',
|
||||
'api_secret',
|
||||
'api-key',
|
||||
'api-secret',
|
||||
);
|
||||
];
|
||||
|
||||
return ! in_array($value, $credentials_keys, true);
|
||||
}
|
||||
@ -460,15 +460,15 @@ trait Rest_Api {
|
||||
*/
|
||||
private function is_not_id_key($value) {
|
||||
|
||||
$arr = array(
|
||||
$arr = [
|
||||
'id',
|
||||
);
|
||||
];
|
||||
|
||||
if ($this->slug === 'site') {
|
||||
$arr = array(
|
||||
$arr = [
|
||||
'id',
|
||||
'blog_id',
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
return ! in_array($value, $arr, true);
|
||||
@ -486,7 +486,7 @@ trait Rest_Api {
|
||||
|
||||
$schema = wu_rest_get_endpoint_schema($this->model_class, $edit ? 'update' : 'create', true);
|
||||
|
||||
$args = array_filter($schema, array($this, 'is_not_id_key'), ARRAY_FILTER_USE_KEY);
|
||||
$args = array_filter($schema, [$this, 'is_not_id_key'], ARRAY_FILTER_USE_KEY);
|
||||
|
||||
return $this->filter_schema_arguments($args);
|
||||
}
|
||||
@ -521,12 +521,12 @@ trait Rest_Api {
|
||||
|
||||
$remove_status = apply_filters(
|
||||
"wu_api_{$this->slug}_remove_status",
|
||||
array(
|
||||
[
|
||||
'broadcast',
|
||||
'membership',
|
||||
'product',
|
||||
'payment',
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
if ( ! in_array($this->slug, $remove_status, true) && isset($args['status'])) {
|
||||
@ -535,12 +535,12 @@ trait Rest_Api {
|
||||
|
||||
$remove_slug = apply_filters(
|
||||
"wu_api_{$this->slug}_remove_slug",
|
||||
array(
|
||||
[
|
||||
'broadcast',
|
||||
'product',
|
||||
'checkout_form',
|
||||
'event',
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
if ( ! in_array($this->slug, $remove_slug, true) && isset($args['slug'])) {
|
||||
|
@ -28,7 +28,7 @@ trait WP_CLI {
|
||||
* @since 2.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $wp_cli_enabled_sub_commands = array();
|
||||
protected $wp_cli_enabled_sub_commands = [];
|
||||
|
||||
/**
|
||||
* Returns the base used right after the root.
|
||||
@ -48,7 +48,7 @@ trait WP_CLI {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public function enable_wp_cli() {
|
||||
public function enable_wp_cli(): void {
|
||||
|
||||
if ( ! defined('WP_CLI')) {
|
||||
return;
|
||||
@ -62,9 +62,9 @@ trait WP_CLI {
|
||||
\WP_CLI::add_command(
|
||||
"{$wp_cli_root} {$this->get_wp_cli_command_base()} {$sub_command}",
|
||||
$sub_command_data['callback'],
|
||||
array(
|
||||
[
|
||||
'synopsis' => $sub_command_data['synopsis'],
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -72,25 +72,25 @@ trait WP_CLI {
|
||||
/**
|
||||
* Set wP-CLI Sub-command enabled for this entity.
|
||||
*/
|
||||
public function set_wp_cli_enabled_sub_commands() {
|
||||
public function set_wp_cli_enabled_sub_commands(): void {
|
||||
|
||||
$sub_commands = array(
|
||||
'get' => array(
|
||||
'callback' => array($this, 'wp_cli_get_item'),
|
||||
),
|
||||
'list' => array(
|
||||
'callback' => array($this, 'wp_cli_get_items'),
|
||||
),
|
||||
'create' => array(
|
||||
'callback' => array($this, 'wp_cli_create_item'),
|
||||
),
|
||||
'update' => array(
|
||||
'callback' => array($this, 'wp_cli_update_item'),
|
||||
),
|
||||
'delete' => array(
|
||||
'callback' => array($this, 'wp_cli_delete_item'),
|
||||
),
|
||||
);
|
||||
$sub_commands = [
|
||||
'get' => [
|
||||
'callback' => [$this, 'wp_cli_get_item'],
|
||||
],
|
||||
'list' => [
|
||||
'callback' => [$this, 'wp_cli_get_items'],
|
||||
],
|
||||
'create' => [
|
||||
'callback' => [$this, 'wp_cli_create_item'],
|
||||
],
|
||||
'update' => [
|
||||
'callback' => [$this, 'wp_cli_update_item'],
|
||||
],
|
||||
'delete' => [
|
||||
'callback' => [$this, 'wp_cli_delete_item'],
|
||||
],
|
||||
];
|
||||
|
||||
$params = array_merge($this->wp_cli_get_fields(), $this->wp_cli_extra_parameters());
|
||||
|
||||
@ -101,42 +101,42 @@ trait WP_CLI {
|
||||
*/
|
||||
$params_to_remove = apply_filters(
|
||||
'wu_cli_params_to_remove',
|
||||
array(
|
||||
[
|
||||
'id',
|
||||
'model',
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
$params = array_filter($params, fn($param) => ! in_array($param, $params_to_remove, true));
|
||||
|
||||
foreach ($sub_commands as $sub_command => &$sub_command_data) {
|
||||
$sub_command_data['synopsis'] = array();
|
||||
$sub_command_data['synopsis'] = [];
|
||||
|
||||
if (in_array($sub_command, array('get', 'update', 'delete'), true)) {
|
||||
$sub_command_data['synopsis'][] = array(
|
||||
if (in_array($sub_command, ['get', 'update', 'delete'], true)) {
|
||||
$sub_command_data['synopsis'][] = [
|
||||
'name' => 'id',
|
||||
'type' => 'positional',
|
||||
'description' => __('The id for the resource.', 'wp-ultimo'),
|
||||
'optional' => false,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
if (in_array($sub_command, array('list', 'update', 'create'), true)) {
|
||||
if (in_array($sub_command, ['list', 'update', 'create'], true)) {
|
||||
$explanation_list = wu_rest_get_endpoint_schema($this->model_class, 'update');
|
||||
|
||||
foreach ($params as $name) {
|
||||
$explanation = wu_get_isset($explanation_list, $name, array());
|
||||
$explanation = wu_get_isset($explanation_list, $name, []);
|
||||
|
||||
$type = wu_get_isset($explanation, 'type', 'assoc');
|
||||
|
||||
$field = array(
|
||||
$field = [
|
||||
'name' => $name,
|
||||
'description' => wu_get_isset($explanation, 'description', __('No description found.', 'wp-ultimo')),
|
||||
'optional' => ! wu_get_isset($explanation, 'required'),
|
||||
'type' => 'assoc',
|
||||
);
|
||||
];
|
||||
|
||||
$options = wu_get_isset($explanation, 'options', array());
|
||||
$options = wu_get_isset($explanation, 'options', []);
|
||||
|
||||
if ($options) {
|
||||
$field['options'] = $options;
|
||||
@ -146,39 +146,39 @@ trait WP_CLI {
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($sub_command, array('create', 'update'), true)) {
|
||||
$sub_command_data['synopsis'][] = array(
|
||||
if (in_array($sub_command, ['create', 'update'], true)) {
|
||||
$sub_command_data['synopsis'][] = [
|
||||
'name' => 'porcelain',
|
||||
'type' => 'flag',
|
||||
'description' => __('Output just the id when the operation is successful.', 'wp-ultimo'),
|
||||
'optional' => true,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
if (in_array($sub_command, array('list', 'get'), true)) {
|
||||
$sub_command_data['synopsis'][] = array(
|
||||
if (in_array($sub_command, ['list', 'get'], true)) {
|
||||
$sub_command_data['synopsis'][] = [
|
||||
'name' => 'format',
|
||||
'type' => 'assoc',
|
||||
'description' => __('Render response in a particular format.', 'wp-ultimo'),
|
||||
'optional' => true,
|
||||
'default' => 'table',
|
||||
'options' => array(
|
||||
'options' => [
|
||||
'table',
|
||||
'json',
|
||||
'csv',
|
||||
'ids',
|
||||
'yaml',
|
||||
'count',
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
$sub_command_data['synopsis'][] = array(
|
||||
$sub_command_data['synopsis'][] = [
|
||||
'name' => 'fields',
|
||||
'type' => 'assoc',
|
||||
'description' => __('Limit response to specific fields. Defaults to id, name', 'wp-ultimo'),
|
||||
'optional' => true,
|
||||
'options' => array_merge(array('id'), $params),
|
||||
);
|
||||
'options' => array_merge(['id'], $params),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ trait WP_CLI {
|
||||
* @param array $args Positional arguments passed. ID expected.
|
||||
* @param array $array_assoc Assoc arguments passed.
|
||||
*/
|
||||
public function wp_cli_get_item($args, $array_assoc) {
|
||||
public function wp_cli_get_item($args, $array_assoc): void {
|
||||
|
||||
$item = $this->model_class::get_by_id($args[0]);
|
||||
|
||||
@ -256,7 +256,7 @@ trait WP_CLI {
|
||||
* @param array $args Positional arguments passed. ID expected.
|
||||
* @param array $array_assoc Assoc arguments passed.
|
||||
*/
|
||||
public function wp_cli_get_items($args, $array_assoc) {
|
||||
public function wp_cli_get_items($args, $array_assoc): void {
|
||||
|
||||
$fields = (! empty($array_assoc['fields'])) ? $array_assoc['fields'] : $this->wp_cli_get_fields();
|
||||
|
||||
@ -277,7 +277,7 @@ trait WP_CLI {
|
||||
* @param array $args Positional arguments passed. ID expected.
|
||||
* @param array $array_assoc Assoc arguments passed.
|
||||
*/
|
||||
public function wp_cli_create_item($args, $array_assoc) {
|
||||
public function wp_cli_create_item($args, $array_assoc): void {
|
||||
|
||||
$item = new $this->model_class($array_assoc);
|
||||
|
||||
@ -306,7 +306,7 @@ trait WP_CLI {
|
||||
* @param array $args Positional arguments passed. ID expected.
|
||||
* @param array $array_assoc Assoc arguments passed.
|
||||
*/
|
||||
public function wp_cli_update_item($args, $array_assoc) {
|
||||
public function wp_cli_update_item($args, $array_assoc): void {
|
||||
|
||||
$item = $this->model_class::get_by_id($args[0]);
|
||||
|
||||
@ -330,7 +330,7 @@ trait WP_CLI {
|
||||
if ($param === 'meta') {
|
||||
$item->update_meta_batch($value);
|
||||
} elseif (method_exists($item, $set_method)) {
|
||||
call_user_func(array($item, $set_method), $value);
|
||||
call_user_func([$item, $set_method], $value);
|
||||
} else {
|
||||
$error_message = sprintf(
|
||||
/* translators: 1. Object class name; 2. Set method name */
|
||||
@ -367,7 +367,7 @@ trait WP_CLI {
|
||||
*
|
||||
* @param array $args Positional arguments passed. ID expected.
|
||||
*/
|
||||
public function wp_cli_delete_item($args) {
|
||||
public function wp_cli_delete_item($args): void {
|
||||
|
||||
$item = $this->model_class::get_by_id($args[0]);
|
||||
|
||||
|
Reference in New Issue
Block a user