Creates a new access-plan.
OPTIONS OPTIONS
- [--date_created=<date_created>]
- Creation date. Format: Y-m-d H:i:s
- [--date_created_gmt=<date_created_gmt>]
- Creation date (in GMT). Format: Y-m-d H:i:s
- [--menu_order=<menu_order>]
- Creation date (in GMT). Format: Y-m-d H:i:s
---
default: 0
--- - --title=<title>
- Post title.
- [--content=<content>]
- The HTML content of the post.
- --price=<price>
- Access plan price.
- [--access_expiration=<access_expiration>]
- Access expiration type.
lifetime
provides access until cancelled or until a recurring payment fails.limited-period
provides access for a limited period as specified byaccess_length
andaccess_period
limited-date
provides access until the date specified by access_expires_date`.
---
default: lifetime
options:
– lifetime
– limited-period
– limited-date
--- - [--access_expires=<access_expires>]
- Date when access expires. Only applicable when
access_expiration
islimited-date
.Format: Y-m-d H:i:s
. - [--access_length=<access_length>]
- Determine the length of access from time of purchase. Only applicable when
access_expiration
islimited-period
.
---
default: 1
--- - [--access_period=<access_period>]
- Determine the length of access from time of purchase. Only applicable when
access_expiration
islimited-period
---
default: year
options:
– year
– month
– week
– day
--- - [--availability_restrictions=<availability_restrictions>]
- Restrict usage of this access plan to students enrolled in at least one of the specified memberships.
- [--enroll_text=<enroll_text>]
- Text of the “Purchase” button
---
default: Buy Now
--- - [--frequency=<frequency>]
- Billing frequency [0-6].
0
denotes a one-time payment.>= 1
denotes a recurring plan.
---
default: 0
--- - [--length=<length>]
- For recurring plans only. Determines the number of intervals a plan should run for.
0
denotes the plan should run until cancelled.
---
default: 0
--- - [--period=<period>]
- For recurring plans only. Determines the interval of recurring payments.
---
default: year
options:
– year
– month
– week
– day
--- - --post_id=<post_id>
- Determines the course or membership which can be accessed through the plan.
- [--redirect_forced=<redirect_forced>]
- Use this plans’s redirect settings when purchasing a Membership this plan is restricted to. Applicable only when
availability_restrictions
exist for the plan
---
default: false
--- - [--redirect_page=<redirect_page>]
- WordPress page ID to use for checkout success redirection. Applicable only when
redirect_type
is page. - [--redirect_type=<redirect_type>]
- Determines the redirection behavior of the user’s browser upon successful checkout or registration through the plan.
self
: Redirect to the permalink of the specifiedpost_id
.page
: Redirect to the permalink of the WordPress page specified byredirect_page_id
.url
: Redirect to the URL specified byredirect_url
.
---
default: self
options:
– self
– page
– url
--- - [--redirect_url=<redirect_url>]
- URL to use for checkout success redirection. Applicable only when
redirect_type
isurl
. - [--sale_date_end=<sale_date_end>]
- Used to automatically end a scheduled sale. If empty, the plan remains on sale indefinitely. Only applies when
sale_enabled
istrue
. Format:Y-m-d H:i:s
. - [--sale_date_start=<sale_date_start>]
- Used to automatically start a scheduled sale. If empty, the plan is on sale immediately. Only applies when
sale_enabled
istrue
. Format:Y-m-d H:i:s
. - [--sale_enabled=<sale_enabled>]
- Mark the plan as “On Sale” allowing for temporary price adjustments.
---
default: false
--- - [--sale_price=<sale_price>]
- Sale price. Only applies when
sale_enabled
istrue
. - [--sku=<sku>]
- External identifier
- [--trial_enabled=<trial_enabled>]
- Enable a trial period for a recurring access plan.
---
default: false
--- - [--trial_length=<trial_length>]
- Determines the length of trial access. Only applies when
trial_enabled
istrue
.
---
default: 1
--- - [--trial_period=<trial_period>]
- Determines the length of trial access. Only applies when
trial_enabled
istrue
.
---
default: week
options:
– year
– month
– week
– day
--- - [--trial_price=<trial_price>]
- Determines the price of the trial period. Only applies when
trial_enabled
istrue
.
---
default: 0
--- - [--visibility=<visibility>]
- Access plan visibility.
---
default: visible
options:
– visible
– hidden
– featured
--- - [--porcelain]
- Output just the id when the operation is successful.
GLOBAL PARAMETERS GLOBAL PARAMETERS
These global parameters have the same behavior across all commands and affect how WP-CLI interacts with WordPress.
Argument | Description |
---|---|
--path=<path> |
Path to the WordPress files. |
--url=<url> |
Pretend request came from given URL. In multisite, this argument is how the target site is specified. |
--ssh=[<scheme>:][<user>@]<host\|container>[:<port>][<path>] |
Perform operation against a remote server over SSH (or a container using scheme of “docker”, “docker-compose”, “vagrant”). |
--http=<http> |
Perform operation against a remote WordPress installation over HTTP. |
--user=<id\|login\|email> |
Set the WordPress user. |
--skip-plugins[=<plugins>] |
Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. |
--skip-themes[=<themes>] |
Skip loading all themes, or a comma-separated list of themes. |
--skip-packages |
Skip loading all installed packages. |
--require=<path> |
Load PHP file before running the command (may be used more than once). |
--exec=<php-code> |
Execute PHP code before running the command (may be used more than once). |
--[no-]color |
Whether to colorize the output. |
--debug[=<group>] |
Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help. |
--prompt[=<assoc>] |
Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. |
--quiet |
Suppress informational messages. |