+++ /dev/null
-## EXAMPLES
-
- wp cache set my_key my_value my_group 300
-
- wp cache get my_key my_group
+++ /dev/null
-## EXAMPLES
-
- # Add 'spectate' capability to 'author' role
- wp cap add 'author' 'spectate'
-
- # Add all caps from 'editor' role to 'author' role
- wp cap list 'editor' | xargs wp cap add 'author'
-
- # Remove all caps from 'editor' role that also appear in 'author' role
- wp cap list 'author' | xargs wp cap remove 'editor'
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to approve.
-
-## EXAMPLES
-
- wp comment approve 1337
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the post to count comments in
-
-## EXAMPLES
-
- wp comment count
- wp comment count 42
+++ /dev/null
-## OPTIONS
-
-* `--<field>`=<value>:
-
- Field values for the new comment. See wp_insert_comment().
-
-* `--porcelain`:
-
- Output just the new comment id.
-
-## EXAMPLES
-
- wp comment create --comment_post_ID=15 --comment_content="hello blog"
---comment_author="wp-cli"
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to delete.
-
-* `--force`:
-
- Skip the trash bin.
-
-## EXAMPLES
-
- wp comment delete 1337 --force
+++ /dev/null
-## OPTIONS
-
-* `--id`:
-
- Output just the last comment id.
-
-* `--full`:
-
- Output complete comment information.
-
-## EXAMPLES
-
- wp comment last --full
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to mark as spam.
-
-## EXAMPLES
-
- wp comment spam 1337
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to check
-
-## EXAMPLES
-
- wp comment status 1337
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to trash.
-
-## EXAMPLES
-
- wp comment trash 1337
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to unapprove.
-
-## EXAMPLES
-
- wp comment unapprove 1337
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to unmark as spam.
-
-## EXAMPLES
-
- wp comment unspam 1337
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the comment to untrash.
-
-## EXAMPLES
-
- wp comment untrash 1337
+++ /dev/null
-## OPTIONS
-
-* `--dbname`=<dbname>:
-
- Set the database name.
-
-* `--dbuser`=<dbuser>:
-
- Set the database user.
-
-* `--dbpass`=<dbpass>:
-
- Set the database user password.
-
-* `--dbhost`=<dbhost>:
-
- Set the database host. Default: 'localhost'
-
-* `--dbprefix`=<dbprefix>:
-
- Set the database table prefix. Default: 'wp_'
-
-* `--locale`=<locale>:
-
- Set the WPLANG constant. Defaults to $wp_local_package variable.
-
-* `--extra-php`:
-
- If set, the command reads additional PHP code from STDIN.
-
-## EXAMPLES
-
- # Standard wp-config.php file
- wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --locale=ro_RO
-
- # Enable WP_DEBUG and WP_DEBUG_LOG
- wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --extra-php <<PHP
- define( 'WP_DEBUG', true );
- define( 'WP_DEBUG_LOG', true );
- PHP
+++ /dev/null
-## OPTIONS
-
-* `--locale`=<locale>:
-
- Select which language you want to download. The --version parameter is
-ignored in this case.
-
-* `--version`=<version>:
-
- Select which version you want to download.
-
-* `--force`:
-
- Overwrites existing files, if present.
-
-## EXAMPLES
-
- wp core download --version=3.3
+++ /dev/null
-## OPTIONS
-
-* `<path>`:
-
- The directory in which to download the testing suite files. (Optional)
-
-* `--dbname`=<dbname>:
-
- Set the database name. **WARNING**: The database will be whipped every time
-you run the tests.
-
-* `--dbuser`=<dbuser>:
-
- Set the database user.
-
-* `--dbpass`=<dbpass>:
-
- Set the database user password.
-
-## EXAMPLE
-
- wp core init-tests ~/svn/wp-tests --dbname=wp_test --dbuser=wp_test
+++ /dev/null
-## OPTIONS
-
-* `--url`=<url>:
-
- The address of the new site.
-
-* `--title`=<site-title>:
-
- The title of the new site.
-
-* `--admin_name`=<username>:
-
- The name of the admin user. Default: 'admin'
-
-* `--admin_password`=<password>:
-
- The password for the admin user.
-
-* `--admin_email`=<email>:
-
- The email address for the admin user.
+++ /dev/null
-## EXAMPLES
-
- if ! $(wp core is-installed); then
- wp core install
- fi
+++ /dev/null
-## OPTIONS
-
-* `--title`=<site-title>:
-
- The title of the new network.
-
-* `--base`=<url-path>:
-
- Base path after the domain name that each site url will start with.
-Default: '/'
-
-* `--subdomains`:
-
- If passed, the network will use subdomains, instead of subdirectories.
+++ /dev/null
-## OPTIONS
-
-* `--url`=<url>:
-
- The address of the new site.
-
-* `--base`=<url-path>:
-
- Base path after the domain name that each site url in the network will start with.
-Default: '/'
-
-* `--subdomains`:
-
- If passed, the network will use subdomains, instead of subdirectories.
-
-* `--title`=<site-title>:
-
- The title of the new site.
-
-* `--admin_name`=<username>:
-
- The name of the admin user. Default: 'admin'
-
-* `--admin_password`=<password>:
-
- The password for the admin user.
-
-* `--admin_email`=<email>:
-
- The email address for the admin user.
+++ /dev/null
-## OPTIONS
-
-* `--version=`<new_version> [package/zip]:
-
- When passed, updates to new_version, optionally using package/zip as
-input.
-
-* `--force`:
-
- Will update even when current WP version < passed version. Use with
-caution.
-
-## EXAMPLES
-
- wp core update
-
- wp core update --version=3.4 ../latest.zip
-
- wp core update --version=3.1 --force
+++ /dev/null
-## OPTIONS
-
-* `--extra`:
-
- Show extended version information.
+++ /dev/null
-## OPTIONS
-
-* `--yes`:
-
- Answer yes to the confirmation message.
-
-* `<file>`:
-
- The name of the export file. If omitted, it will be '{dbname}.sql'
-
-* `<SQL>`:
-
- A SQL query.
-
-## EXAMPLES
-
- # execute a query stored in a file
- wp db query < debug.sql
+++ /dev/null
-## EXAMPLES
-
- wp eval-file my-code.php
+++ /dev/null
-## EXAMPLES
-
- wp eval 'echo WP_CONTENT_DIR;'
+++ /dev/null
-## OPTIONS
-
-* `--dir`=<dirname>:
-
- Full path to directory where WXR export files should be stored. Defaults
-to current working directory.
-
-* `--skip_comments`:
-
- Don't export comments.
-
-* `--file_item_count`=<count>:
-
- Break export into files with N posts.
-
-* `--verbose`:
-
- Show more information about the process on STDOUT.
-
-## FILTERS
-
-* `--start_date`=<date>:
-
- Export only posts newer than this date, in format YYYY-MM-DD.
-
-* `--end_date`=<date>:
-
- Export only posts older than this date, in format YYYY-MM-DD.
-
-* `--post_type`=<post_type>:
-
- Export only posts with this post_type.
-
-* `--post__in`=<pid>:
-
- Export all posts specified as a comma-separated list of IDs.
-
-* `--author`=<login/id>:
-
- Export only posts by this author.
-
-* `--category`=<category-id>:
-
- Export only posts in this category.
-
-* `--post_status`=<status>:
-
- Export only posts with this status.
-
-## EXAMPLES
-
- wp export --dir=/tmp/ --user=admin --post_type=post --start_date=2011-01-01 --end_date=2011-12-31
-
- wp export --dir=/tmp/ --post__in=123,124,125
+++ /dev/null
-## EXAMPLES
-
- # get help for `core` command
- wp help core
-
- # get help for `core download` subcommand
- wp help core download
+++ /dev/null
-## OPTIONS
-
-* `<file>`:
-
- Path to a valid WXR file for importing.
-
-* `--authors=<authors>`:
-
- How the author mapping should be handled. Options are 'create', 'mapping.csv', or 'skip'. The first will create any non-existent users from the WXR file. The second will read author mapping associations from a CSV, or create a CSV for editing if the file path doesn't exist. The last option will skip any author mapping.
-
-* `--skip=<data-type>`:
-
- Skip importing specific data. Supported option is 'attachment'.
+++ /dev/null
-## OPTIONS
-
-* `<file>`:
-
- Path to file or files to be imported. Supports the glob(3) capabilities of the current shell.
- If file is recognized as a URL (for example, with a scheme of http or ftp), the file will be
- downloaded to a temp file before being sideloaded.
-
-* `--post_id=<post_id>`
-
- ID of the post to attach the imported files to
-
-* `--title=<title>`
-
- Attachment title (post title field)
-
-* `--caption=<caption>`
-
- Caption for attachent (post excerpt field)
-
-* `--alt=<alt_text>`
-
- Alt text for image (saved as post meta)
-
-* `--desc=<description>`
-
- "Description" field (post content) of attachment post
-
-* `--featured_image`
-
- If set, set the imported image as the Featured Image of the post its attached to.
-
-
-## EXAMPLES
-
- # Import all jpgs in the current user's "Pictures" directory, not attached to any post
- wp media import ~/Pictures/**/*.jpg
-
- # Import a local image and set it to be the post thumbnail for a post
- wp media import ~/Downloads/image.png --post_id=123 --title="A downloaded picture" --featured_image
-
- # Import an image from the web
- wp media import http://s.wordpress.org/style/images/wp-header-logo.png --title='The WordPress logo' --alt="Semantic personal publishing"
-
-
+++ /dev/null
-## OPTIONS
-
-* `--yes`:
-
- Answer yes to the confirmation message.
-
-* `<attachment-id>`:
-
- One or more IDs of the attachments to regenerate.
-
-## EXAMPLES
-
- wp media regenerate 123 1337
-
- wp media regenerate --yes
\ No newline at end of file
+++ /dev/null
-## OPTIONS
-
-* `<id>`:
-
- The network id (usually 1).
-
-* `--format=json`:
-
- Encode/decode values as JSON.
-
-## EXAMPLES
-
- # get a list of super-admins
- wp network-meta get 1 site_admins
+++ /dev/null
-## OPTIONS
-
-* `--format=json`:
-
- Encode/decode values as JSON.
-
-## EXAMPLES
-
- wp option get siteurl
-
- wp option add my_option foobar
-
- wp option update my_option '{"foo": "bar"}' --format=json
-
- wp option delete my_option
+++ /dev/null
-## OPTIONS
-
-* `<plugin>`:
-
- The plugin to activate.
-
-* `--network`:
-
- If set, the plugin will be activated for the entire multisite network.
+++ /dev/null
-## OPTIONS
-
-* `<plugin>`:
-
- The plugin to deactivate.
-
-* `--network`:
-
- If set, the plugin will be deactivated for the entire multisite network.
+++ /dev/null
-## OPTIONS
-
-* <plugin>:
-
- The plugin to delete.
-
-## EXAMPLES
-
- wp plugin delete hello
+++ /dev/null
-## OPTIONS
-
-* <plugin|zip|url>:
-
- A plugin slug, the path to a local zip file, or URL to a remote zip file.
-
-* `--version`=<version>:
-
- If set, get that particular version from wordpress.org, instead of the
-stable version.
-
-* `--force`:
-
- If set, the command will overwrite any installed version of the plugin, without prompting
-for confirmation.
-
-* `--activate`:
-
- If set, the plugin will be activated immediately after install.
-
-## EXAMPLES
-
- # Install the latest version from wordpress.org and activate
- wp plugin install bbpress --activate
-
- # Install the development version from wordpress.org
- wp plugin install bbpress --version=dev
-
- # Install from a local zip file
- wp plugin install ../my-plugin.zip
-
- # Install from a remote zip file
- wp plugin install http://s3.amazonaws.com/bucketname/my-plugin.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
+++ /dev/null
-## OPTIONS
-
-* `--format`=<format>:
-
- Output list as table, CSV or JSON. Defaults to table.
-
-## EXAMPLES
-
- wp plugin list --format=json
+++ /dev/null
-## OPTIONS
-
-* `<plugin>`:
-
- The plugin to get the path to. If not set, will return the path to the
-plugins directory.
-
-* `--dir`:
-
- If set, get the path to the closest parent directory, instead of the
-plugin file.
-
-## EXAMPLES
-
- cd $(wp theme path)
+++ /dev/null
-## OPTIONS
-
-* `<plugin>`:
-
- A particular plugin to show the status for.
\ No newline at end of file
+++ /dev/null
-## OPTIONS
-
-* `<plugin>`:
-
- The plugin to toggle.
-
-* `--network`:
-
- If set, the plugin will be toggled for the entire multisite network.
+++ /dev/null
-## OPTIONS
-
-* <plugin>:
-
- The plugin to uninstall.
-
-* `--no-delete`:
-
- If set, the plugin files will not be deleted. Only the uninstall procedure
-will be run.
-
-## EXAMPLES
-
- wp plugin uninstall hello
+++ /dev/null
-## OPTIONS
-
-* `--dry-run`:
-
- Pretend to do the updates, to see what would happen.
-
-## EXAMPLES
-
- wp plugin update-all
+++ /dev/null
-## OPTIONS
-
-* <plugin>:
-
- The plugin to update.
-
-* `--version=dev`:
-
- If set, the plugin will be updated to the latest development version,
-regardless of what version is currently installed.
-
-## EXAMPLES
-
- wp plugin update bbpress --version=dev
+++ /dev/null
-## OPTIONS
-
-* `<filename>`:
-
- Read post content from <filename>. If this value is present, the
- `--post_content` argument will be ignored.
-
- Passing `-` as the filename will cause post content to
- be read from STDIN.
-
-* `--<field>`=<value>:
-
- Field values for the new post. See wp_insert_post().
-
-* `--edit`:
-
- Immediately open system's editor to write or edit post content.
-
- (If content is read from a file, from STDIN, or from the `--post_content`
- argument, that text will be loaded into the editor; otherwise, an empty
- file will be opened.)
-
-* `--porcelain`:
-
- Output just the new post id.
-
-## EXAMPLES
-
- wp post create --post_type=page --post_status=publish --post_title='A future post' --post-status=future --post_date='2020-12-01 07:00:00'
-
- wp post create page.txt --post_type=page --post_title='Page from file'
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the post to delete.
-
-* `--force`:
-
- Skip the trash bin.
-
-## EXAMPLES
-
- wp post delete 123 --force
-
- wp post delete $(wp post list --post_type='page' --format=ids)
+++ /dev/null
-## OPTIONS
-
-* `<id>`:
-
- The ID of the post to edit.
-
-## EXAMPLES
-
- wp post edit 123
+++ /dev/null
-## OPTIONS
-
-* `--count`=<number>:
-
- How many posts to generate. Default: 100
-
-* `--post_type`=<type>:
-
- The type of the generated posts. Default: 'post'
-
-* `--post_status`=<status>:
-
- The status of the generated posts. Default: 'publish'
-
-* `--post_author`=<login>:
-
- The author of the generated posts. Default: none
-
-* `--post_date`=<yyyy-mm-dd>:
-
- The date of the generated posts. Default: current date
-
-* `--max_depth`=<number>:
-
- For hierarchical post types, generate child posts down to a certain depth. Default: 1
-
-## EXAMPLES
-
- wp post generate --count=10 --post_type=page --post_date=1999-01-04
+++ /dev/null
-## OPTIONS
-
-* `[--format=<format>]`:
-
- The format to use when printing the post, acceptable values:
-
- **content**: Outputs only the post's content.
-
- **table**: Outputs all fields of the post as a table. Note that the
- post_content field is omitted so that the table is readable.
-
- **json**: Outputs all fields in JSON format.
-
-* `<id>`:
-
- The ID of the post to get.
-
-## EXAMPLES
-
- wp post get 12 --format=content
-
- wp post get 12 > file.txt
+++ /dev/null
-## OPTIONS
-
-* `--<field>`=<value>:
-
- One or more args to pass to WP_Query.
-
-* `--fields`=<fields>:
-
- Limit the output to specific object fields. Defaults to ID,post_title,post_name,post_date,post_status.
-
-* `--format`=<format>:
-
- Output list as table, CSV, JSON, or simply IDs. Defaults to table.
-
-## EXAMPLES
-
- wp post list --format=ids
-
- wp post list --post_type=post --posts_per_page=5 --format=json
-
- wp post list --post_type=page --fields=post_title,post_status
+++ /dev/null
-## OPTIONS
-
-* `--format=json`:
-
- Encode/decode values as JSON.
-
-## EXAMPLES
-
- wp post-meta set 123 _wp_page_template about.php
+++ /dev/null
-## OPTIONS
-
-* `<ID>`:
-
- The ID of the post to update.
-
-* `--<field>`=<value>:
-
- One or more fields to update. See wp_update_post().
-
-## EXAMPLES
-
- wp post update 123 --post_name=something --post_status=draft
+++ /dev/null
-## OPTIONS
-
-* `--format=json`:
-
- Output rules in JSON format.
+++ /dev/null
-## OPTIONS
-
-* `--soft`:
-
- Perform a soft flush - do not overwrite `.htaccess`. The default is to update
- `.htaccess` rules as well as rewrite rules in database.
-
+++ /dev/null
-## OPTIONS
-
-* <permastruct>:
-
- The new permalink structure to apply; like "/%year%/%monthnum%/%postname%".
-
-* `--category-base`=<categorybase>:
-
- Set the base for category permalinks, ie '/category/'.
-
-* `--tag-base`=<tagbase>:
-
- Set the base for tag permalinks, ie '/tag/'.
-
+++ /dev/null
-## OPTIONS
-
-* <role-key>:
-
- The internal name of the role, e.g. editor
-
-* <role-name>:
-
- The publically visible name of the role, e.g. Editor
-
-## EXAMPLES
-
- wp role create approver Approver
-
- wp role create productadmin "Product Administrator"
+++ /dev/null
-## OPTIONS
-
-* <role-key>:
-
- The internal name of the role, e.g. editor
-
-## EXAMPLES
-
- wp role delete approver
-
- wp role delete productadmin
-
+++ /dev/null
-## OPTIONS
-
-* <role-key>:
-
- The internal name of the role, e.g. editor
-
-
-##DESCRIPTION
-
-Will exit with status 0 if the role exists, 1 if it does not.
-
-
-## EXAMPLES
-
- wp role exists editor
-
+++ /dev/null
-## OPTIONS
-
-* `--fields`=<fields>:
-
- Limit the output to specific object fields. Defaults to name,role.
-
-* `--format`=<format>:
-
- Output list as table, CSV or JSON. Defaults to table.
-
-## EXAMPLES
-
- wp role list --fields=role --format=csv
+++ /dev/null
-## OPTIONS
-
-* <slug>:
-
- The slug for the new theme, used for prefixing functions.
-
-* `--activate`:
-
- Activate the newly downloaded theme.
-
-* `--theme_name=<title>`:
-
- What to put in the 'Theme Name:' header in style.css
-
-* `--author=<full name>`:
-
- What to put in the 'Author:' header in style.css
-
-* `--author_uri=<http url>`:
-
- What to put in the 'Author URI:' header in style.css
\ No newline at end of file
+++ /dev/null
-## OPTIONS
-
-* <slug>:
-
- The slug for the new child theme.
-
-* `--parent_theme=<slug>`:
-
- What to put in the 'Template:' header in style.css
-
-* `--theme_name=<title>`:
-
- What to put in the 'Theme Name:' header in style.css
-
-* `--author=<full name>`:
-
- What to put in the 'Author:' header in style.css
-
-* `--author_uri=<http url>`:
-
- What to put in the 'Author URI:' header in style.css
-
-* `--theme_uri=<http url>`:
-
- What to put in the 'Theme URI:' header in style.css
-
-* `--activate`:
-
- Activate the newly created child theme.
+++ /dev/null
-## DESCRIPTION
-
-These are the files that are generated:
-
-* `phpunit.xml` is the configuration file for PHPUnit
-* `.travis.yml` is the configuration file for Travis CI
-* `tests/bootstrap.php` is the file that makes the current plugin active when running the test suite
-* `tests/test-sample.php` is a sample file containing the actual tests
-
-## ENVIRONMENT
-
-The `tests/bootstrap.php` file looks for the WP_TESTS_DIR environment
-variable.
-
-## EXAMPLE
-
- wp scaffold plugin-tests hello
+++ /dev/null
-## OPTIONS
-
-* `--activate`:
-
- Activate the newly generated plugin.
-
-* `--plugin_name=<title>`:
-
- What to put in the 'Plugin Name:' header
+++ /dev/null
-## OPTIONS
-
-* `--label=<label>`:
-
- The text used to translate the update messages
-
-* `--textdomain=<textdomain>`:
-
- The textdomain to use for the labels.
-
-* `--theme`:
-
- Create a file in the active theme directory, instead of sending to
-STDOUT. Specify a theme with `--theme=<theme>` to have the file placed in that theme.
-
-* `--plugin=<plugin>`:
-
- Create a file in the given plugin's directory, instead of sending to
-STDOUT.
-
-* `--raw`:
-
- Just generate the `register_post_type()` call and nothing else.
+++ /dev/null
-## OPTIONS
-
-* `--post_types=<post_types>`:
-
- Post types to register for use with the taxonomy.
-
-* `--label=<label>`:
-
- The text used to translate the update messages
-
-* `--textdomain=<textdomain>`:
-
- The textdomain to use for the labels.
-
-* `--theme`:
-
- Create a file in the active theme directory, instead of sending to
-STDOUT. Specify a theme with `--theme=<theme>` to have the file placed in that theme.
-
-* `--plugin=<plugin>`:
-
- Create a file in the given plugin's directory, instead of sending to
-STDOUT.
-
-* `--raw`:
-
- Just generate the `register_taxonomy()` call and nothing else.
-
-## EXAMPLES
-
- wp scaffold taxonomy venue --post_types=event,presentation
+++ /dev/null
-## DESCRIPTION
-
-This command will go through all rows in all tables and will replace all appearances of the old string with the new one.
-
-It will correctly handle serialized values, and will not change primary key values.
-
-## OPTIONS
-
-* `--network`:
-
- Search/replace through all the tables in a multisite install.
-
-* `--skip-columns=<columns>`:
-
- Do not perform the replacement in the comma-separated columns.
-
-* `--dry-run`:
-
- Show report, but don't perform the changes.
-
-## EXAMPLES
-
- wp search-replace 'http://example.dev' 'http://example.com' --skip-columns=guid
-
- wp search-replace 'foo' 'bar' wp_posts wp_postmeta wp_terms --dry-run
+++ /dev/null
-## DESCRIPTION
-
-`wp shell` allows you to evaluate PHP statements and expressions interactively, from within a WordPress environment. This means that you have access to all the functions, classes and globals that you would have access to from inside a WordPress plugin, for example.
-
-## OPTIONS
-
-* `--basic`:
-
- Start in fail-safe mode, even if Boris is available.
+++ /dev/null
-## OPTIONS
-
-* `--slug`=<slug>:
-
- Path for the new site. Subdomain on subdomain installs, directory on subdirectory installs.
-
-* `--title`=<title>:
-
- Title of the new site. Default: prettified slug.
-
-* `--email`=<email>:
-
- Email for Admin user. User will be created if none exists. Assignement to Super Admin if not included.
-
-* `--network_id`=<network-id>:
-
- Network to associate new site with. Defaults to current network (typically 1).
-
-* `--private`:
-
- If set, the new site will be non-public (not indexed)
-
-* `--porcelain`:
-
- If set, only the site id will be output on success.
+++ /dev/null
-## OPTIONS
-
-* `<blog-id>`:
-
- The id of the blog to delete. If not provided, you must set the --slug parameter.
-
-* `--slug`=<slug>:
-
- Path of the blog to be deleted. Subdomain on subdomain installs, directory on subdirectory installs.
-
-* `--yes`:
-
- Answer yes to the confirmation message.
-
-* `--keep-tables`:
-
- Delete the blog from the list, but don't drop it's tables.
+++ /dev/null
-## OPTIONS
-
-* `--yes`:
-
- Proceed to empty the site without a confirmation prompt.
\ No newline at end of file
+++ /dev/null
-## OPTIONS
-
-* `<term>`:
-
- A name for the new term.
-
-* `<taxonomy>`:
-
- Taxonomy for the new term.
-
-* `--slug`=<slug>:
-
- A unique slug for the new term. Defaults to sanitized version of name.
-
-* `--description`=<description>:
-
- A description for the new term.
-
-* `--parent`=<term-id>:
-
- A parent for the new term.
-
-* `--porcelain`:
-
- Output just the new term id.
-
-## EXAMPLES
-
- wp term create Apple category --description="A type of fruit"
+++ /dev/null
-## OPTIONS
-
-* `<term-id>`:
-
- ID for the term to delete.
-
-* `<taxonomy>`:
-
- Taxonomy of the term to delete.
-
-## EXAMPLES
-
- wp term delete 15 category
\ No newline at end of file
+++ /dev/null
-## OPTIONS
-
-* `<taxonomy>`:
-
- List terms of a given taxonomy.
-
-* `--fields`=<fields>:
-
- Limit the output to specific object fields. Defaults to all of the term object fields.
-
-* `--format`=<format>:
-
- Output list as table, CSV, JSON, or simply IDs. Defaults to table.
-
-## EXAMPLES
-
- wp term list category --format=csv
-
- wp term list post_tag --fields=name,slug
+++ /dev/null
-## OPTIONS
-
-* `<term-id>`:
-
- ID for the term to update.
-
-* `<taxonomy>`:
-
- Taxonomy of the term to update.
-
-* `--name`=<name>:
-
- A new name for the term.
-
-* `--slug`=<slug>:
-
- A new slug for the term.
-
-* `--description`=<description>:
-
- A new description for the term.
-
-* `--parent`=<term-id>:
-
- A new parent for the term.
-
-## EXAMPLES
-
- wp term update 15 category --name=Apple
+++ /dev/null
-## OPTIONS
-
-* `<theme>`:
-
- The theme to activate.
+++ /dev/null
-## OPTIONS
-
-* `<theme>`:
-
- The theme to delete.
-
-## EXAMPLES
-
- wp theme delete twentyeleven
+++ /dev/null
-## OPTIONS
-
-* `<theme|zip|url>`:
-
- A theme slug, the path to a local zip file, or URL to a remote zip file.
-
-* `--force`:
-
- If set, the command will overwrite any installed version of the theme, without prompting
-for confirmation.
-
-* `--activate`:
-
- If set, the theme will be activated immediately after install.
-
-## EXAMPLES
-
- # Install the latest version from wordpress.org and activate
- wp theme install twentytwelve --activate
-
- # Install from a local zip file
- wp theme install ../my-theme.zip
-
- # Install from a remote zip file
- wp theme install http://s3.amazonaws.com/bucketname/my-theme.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
+++ /dev/null
-## OPTIONS
-
-* `--format`=<format>:
-
- Output list as table, CSV or JSON. Defaults to table.
-
-## EXAMPLES
-
- wp theme list --format=csv
+++ /dev/null
-## OPTIONS
-
-* `<theme>`:
-
- The theme to get the path to. If not set, will return the path to the
-themes directory.
-
-* `--dir`:
-
- If set, get the path to the closest parent directory, instead of the
-theme file.
-
-## EXAMPLES
-
- cd $(wp theme path)
+++ /dev/null
-## OPTIONS
-
-* `<theme>`:
-
- A particular theme to show the status for.
+++ /dev/null
-## OPTIONS
-
-* `--dry-run`:
-
- Pretend to do the updates, to see what would happen.
-
-## EXAMPLES
-
- wp theme update-all
+++ /dev/null
-## OPTIONS
-
-* `<theme>`:
-
- The theme to update.
-
-* `--version=dev`:
-
- If set, the theme will be updated to the latest development version,
-regardless of what version is currently installed.
-
-## EXAMPLES
-
- wp theme update twentytwelve
+++ /dev/null
-## EXAMPLES
-
- wp transient set my_key my_value 300
+++ /dev/null
-## OPTIONS
-
-* `<user>`:
-
- User ID or user login.
-
-* `<role>`:
-
- Add the specified role to the user.
-
-## EXAMPLES
-
- wp user set-role bob author
- wp user set-role 12 author
+++ /dev/null
-## OPTIONS
-
-* `<user-login>`:
-
- The login of the user to create.
-
-* `<user-email>`:
-
- The email address of the user to create.
-
-* `--role`=<role>:
-
- The role of the user to create. Default: default role
-
-* `--user_pass`=<password>:
-
- The user password. Default: randomly generated
-
-* `--user_registered`=<yyyy-mm-dd>:
-
- The date the user registered. Default: current date
-
-* `--display_name`=<name>:
-
- The display name.
-
-* `--porcelain`:
-
- Output just the new user id.
-
-## EXAMPLES
-
- wp user create bob bob@example.com --role=author
+++ /dev/null
-## OPTIONS
-
-* `<user>`:
-
- The user login or ID of the user to delete.
-
-* `--reassign`=<ID>:
-
- User to reassign the posts to.
-
-## EXAMPLES
-
- wp user delete 123 --reassign=567
+++ /dev/null
-## OPTIONS
-
-* `--count`=<number>:
-
- How many users to generate. Default: 100
-
-* `--role`=<role>:
-
- The role of the generated users. Default: default role from WP
+++ /dev/null
-## OPTIONS
-
-* `[--format=<format>]`:
-
- The format to use when printing the user; acceptable values:
-
- **table**: Outputs all fields of the user as a table.
-
- **json**: Outputs all fields in JSON format.
-
-* `<user>`:
-
- User ID or user login.
-
-## EXAMPLES
-
- wp user get 12
-
- wp user get bob --format=json > bob.json
+++ /dev/null
-## OPTIONS
-
-* `<file>`:
-
- The CSV file of users to import.
-
-## EXAMPLES
-
- wp user import-csv /path/to/users.csv
-
- Sample users.csv file:
-
- user_login,user_email,display_name,role
- bobjones,bobjones@domain.com,Bob Jones,contributor
- newuser1,newuser1@domain.com,New User,author
- existinguser,existinguser@domain.com,Existing User,administrator
+++ /dev/null
-## OPTIONS
-
-* `--role`=<role>:
-
- Only display users with a certain role.
-
-* `--fields`=<fields>:
-
- Limit the output to specific object fields. Defaults to ID,user_login,display_name,user_email,user_registered,roles
-
-* `--format`=<format>:
-
- Output list as table, CSV, JSON, or simply IDs. Defaults to table.
-
-## EXAMPLES
-
- wp user list --format=ids
-
- wp user list --role=administrator --format=csv
-
- wp user list --fields=display_name,user_email
+++ /dev/null
-## OPTIONS
-
-* `--format=json`:
-
- Encode/decode values as JSON.
-
-## EXAMPLES
-
- wp user-meta set 123 description "Mary is a WordPress developer."
+++ /dev/null
-## OPTIONS
-
-* `<user>`:
-
- User ID or user login.
-
-## EXAMPLES
-
- wp user remove-role bob
- wp user remove-role 12
+++ /dev/null
-## OPTIONS
-
-* `<user>`:
-
- User ID or user login.
-
-* `[<role>]`:
-
- Make the user have the specified role. If not passed, the default role is
-used.
-
-## EXAMPLES
-
- wp user set-role bob author
- wp user set-role 12 author
+++ /dev/null
-## OPTIONS
-
-* `<user>`:
-
- The user login or ID of the user to update.
-
-* `--<field>`=<value>:
-
- One or more fields to update. For accepted fields, see wp_update_user().
-
-## EXAMPLES
-
- wp user update 123 --user_login=mary --display_name=Mary
-
- wp user update mary --user_pass=marypass
/**
* Manage the object cache.
*
- * @package wp-cli
+ * ## EXAMPLES
+ *
+ * wp cache set my_key my_value my_group 300
+ *
+ * wp cache get my_key my_group
*/
class Cache_Command extends WP_CLI_Command {
/**
* Manage user capabilities.
*
- * @package wp-cli
+ * ## EXAMPLES
+ *
+ * # Add 'spectate' capability to 'author' role
+ * wp cap add 'author' 'spectate'
+ *
+ * # Add all caps from 'editor' role to 'author' role
+ * wp cap list 'editor' | xargs wp cap add 'author'
+ *
+ * # Remove all caps from 'editor' role that also appear in 'author' role
+ * wp cap list 'author' | xargs wp cap remove 'editor'
*/
class Capabilities_Command extends WP_CLI_Command {
/**
* Insert a comment.
*
+ * ## OPTIONS
+ *
+ * --<field>=<value>
+ * : Field values for the new comment. See wp_insert_comment().
+ *
+ * --porcelain
+ * : Output just the new comment id.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment create --comment_post_ID=15 --comment_content="hello blog" --comment_author="wp-cli"
+ *
* @synopsis --<field>=<value> [--porcelain]
*/
public function create( $args, $assoc_args ) {
/**
* Delete a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to delete.
+ *
+ * --force
+ * : Skip the trash bin.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment delete 1337 --force
+ *
* @synopsis <id> [--force]
*/
public function delete( $args, $assoc_args ) {
/**
* Trash a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to trash.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment trash 1337
+ *
* @synopsis <id>
*/
public function trash( $args, $assoc_args ) {
/**
* Untrash a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to untrash.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment untrash 1337
+ *
* @synopsis <id>
*/
public function untrash( $args, $assoc_args ) {
/**
* Spam a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to mark as spam.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment spam 1337
+ *
* @synopsis <id>
*/
public function spam( $args, $assoc_args ) {
/**
* Unspam a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to unmark as spam.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment unspam 1337
* @synopsis <id>
*/
public function unspam( $args, $assoc_args ) {
/**
* Approve a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to approve.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment approve 1337
+ *
* @synopsis <id>
*/
public function approve( $args, $assoc_args ) {
/**
* Unapprove a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to unapprove.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment unapprove 1337
+ *
* @synopsis <id>
*/
public function unapprove( $args, $assoc_args ) {
/**
* Count comments, on whole blog or on a given post.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the post to count comments in
+ *
+ * ## EXAMPLES
+ *
+ * wp comment count
+ * wp comment count 42
+ *
* @synopsis [<post-id>]
*/
public function count( $args, $assoc_args ) {
/**
* Get status of a comment.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the comment to check
+ *
+ * ## EXAMPLES
+ *
+ * wp comment status 1337
+ *
* @synopsis <id>
*/
public function status( $args, $assoc_args ) {
/**
* Get last approved comment.
*
+ * ## OPTIONS
+ *
+ * --id
+ * : Output just the last comment id.
+ *
+ * --full
+ * : Output complete comment information.
+ *
+ * ## EXAMPLES
+ *
+ * wp comment last --full
+ *
* @synopsis [--id] [--full]
*/
function last( $args = array(), $assoc_args = array() ) {
/**
* Download core WordPress files.
*
+ * ## OPTIONS
+ *
+ * --locale=<locale>
+ * : Select which language you want to download. The --version parameter is
+ * ignored in this case.
+ *
+ * --version=<version>
+ * : Select which version you want to download.
+ *
+ * --force
+ * : Overwrites existing files, if present.
+ *
+ * ## EXAMPLES
+ *
+ * wp core download --version=3.3
+ *
* @synopsis [--locale=<locale>] [--version=<version>] [--path=<path>] [--force]
*
* @when before_wp_load
/**
* Set up a wp-config.php file.
*
+ * ## OPTIONS
+ *
+ * --dbname=<dbname>
+ * : Set the database name.
+ *
+ * --dbuser=<dbuser>
+ * : Set the database user.
+ *
+ * --dbpass=<dbpass>
+ * : Set the database user password.
+ *
+ * --dbhost=<dbhost>
+ * : Set the database host. Default: 'localhost'
+ *
+ * --dbprefix=<dbprefix>
+ * : Set the database table prefix. Default: 'wp_'
+ *
+ * --locale=<locale>
+ * : Set the WPLANG constant. Defaults to $wp_local_package variable.
+ *
+ * --extra-php
+ * : If set, the command reads additional PHP code from STDIN.
+ *
+ * ## EXAMPLES
+ *
+ * # Standard wp-config.php file
+ * wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --locale=ro_RO
+ *
+ * # Enable WP_DEBUG and WP_DEBUG_LOG
+ * wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --extra-php <<PHP
+ * define( 'WP_DEBUG', true );
+ * define( 'WP_DEBUG_LOG', true );
+ * PHP
+ *
* @synopsis --dbname=<name> --dbuser=<user> [--dbpass=<password>] [--dbhost=<host>] [--dbprefix=<prefix>] [--locale=<locale>] [--extra-php]
*/
public function config( $_, $assoc_args ) {
/**
* Determine if the WordPress tables are installed.
*
+ * ## EXAMPLES
+ *
+ * if ! $(wp core is-installed); then
+ * wp core install
+ * fi
+ *
* @subcommand is-installed
*/
public function is_installed() {
/**
* Create the WordPress tables in the database.
*
+ * ## OPTIONS
+ *
+ * --url=<url>
+ * : The address of the new site.
+ *
+ * --title=<site-title>
+ * : The title of the new site.
+ *
+ * --admin_name=<username>
+ * : The name of the admin user. Default: 'admin'
+ *
+ * --admin_password=<password>
+ * : The password for the admin user.
+ *
+ * --admin_email=<email>
+ * : The email address for the admin user.
+ *
* @synopsis --url=<url> --title=<site-title> [--admin_name=<username>] --admin_email=<email> --admin_password=<password>
*/
public function install( $args, $assoc_args ) {
/**
* Transform a single-site install into a multi-site install.
*
+ * ## OPTIONS
+ *
+ * --title=<site-title>
+ * : The title of the new network.
+ *
+ * --base=<url-path>
+ * : Base path after the domain name that each site url will start with.
+ * Default: '/'
+ *
+ * --subdomains
+ * : If passed, the network will use subdomains, instead of subdirectories.
+ *
* @subcommand multisite-convert
* @alias install-network
* @synopsis [--title=<network-title>] [--base=<url-path>] [--subdomains]
/**
* Install multisite from scratch.
*
+ * ## OPTIONS
+ *
+ * --url=<url>
+ * : The address of the new site.
+ *
+ * --base=<url-path>
+ * : Base path after the domain name that each site url in the network will start with.
+ * Default: '/'
+ *
+ * --subdomains
+ * : If passed, the network will use subdomains, instead of subdirectories.
+ *
+ * --title=<site-title>
+ * : The title of the new site.
+ *
+ * --admin_name=<username>
+ * : The name of the admin user. Default: 'admin'
+ *
+ * --admin_password=<password>
+ * : The password for the admin user.
+ *
+ * --admin_email=<email>
+ * : The email address for the admin user.
+ *
* @subcommand multisite-install
* @synopsis --url=<url> --title=<site-title> [--base=<url-path>] [--subdomains] [--admin_name=<username>] --admin_email=<email> --admin_password=<password>
*/
/**
* Display the WordPress version.
*
+ * ## OPTIONS
+ *
+ * --extra
+ * : Show extended version information.
+ *
* @synopsis [--extra]
*/
public function version( $args = array(), $assoc_args = array() ) {
/**
* Update WordPress.
*
+ * ## OPTIONS
+ *
+ * --version=<new_version> [package/zip]
+ * : When passed, updates to new_version, optionally using package/zip as
+ * input.
+ *
+ * --force
+ * : Will update even when current WP version < passed version. Use with
+ * caution.
+ *
+ * ## EXAMPLES
+ *
+ * wp core update
+ *
+ * wp core update --version=3.4 ../latest.zip
+ *
+ * wp core update --version=3.1 --force
+ *
* @alias upgrade
*
* @synopsis [<zip>] [--version=<version>] [--force]
*
* @subcommand init-tests
*
+ * ## OPTIONS
+ *
+ * <path>
+ * : The directory in which to download the testing suite files. (Optional)
+ *
+ * --dbname=<dbname>
+ * : Set the database name. **WARNING**: The database will be whipped every time
+ * you run the tests.
+ *
+ * --dbuser=<dbuser>
+ * : Set the database user.
+ *
+ * --dbpass=<dbpass>
+ * : Set the database user password.
+ *
+ * ## EXAMPLE
+ *
+ * wp core init-tests ~/svn/wp-tests --dbname=wp_test --dbuser=wp_test
+ *
* @synopsis [<path>] --dbname=<name> --dbuser=<user> [--dbpass=<password>] [--dbhost=<host>]
*/
function init_tests( $args, $assoc_args ) {
/**
* Perform basic database operations.
*
- * @package wp-cli
+ * ## OPTIONS
+ *
+ * --yes
+ * : Answer yes to the confirmation message.
+ *
+ * <file>
+ * : The name of the export file. If omitted, it will be '{dbname}.sql'
+ *
+ * <SQL>
+ * : A SQL query.
+ *
+ * ## EXAMPLES
+ *
+ * # execute a query stored in a file
+ * wp db query < debug.sql
*/
class DB_Command extends WP_CLI_Command {
/**
* Load and execute a PHP file after loading WordPress.
*
+ * ## EXAMPLES
+ *
+ * wp eval-file my-code.php
+ *
* @synopsis <path>
*/
public function __invoke( $args, $assoc_args ) {
/**
* Execute arbitrary PHP code after loading WordPress.
*
+ * ## EXAMPLES
+ *
+ * wp eval 'echo WP_CONTENT_DIR;'
+ *
* @synopsis <php-code>
*/
public function __invoke( $args, $assoc_args ) {
/**
* Export content to a WXR file.
*
+ * ## OPTIONS
+ *
+ * --dir=<dirname>
+ * : Full path to directory where WXR export files should be stored. Defaults
+ * to current working directory.
+ *
+ * --skip_comments
+ * : Don't export comments.
+ *
+ * --file_item_count=<count>
+ * : Break export into files with N posts.
+ *
+ * --verbose
+ * : Show more information about the process on STDOUT.
+ *
+ * ## FILTERS
+ *
+ * --start_date=<date>
+ * : Export only posts newer than this date, in format YYYY-MM-DD.
+ *
+ * --end_date=<date>
+ * : Export only posts older than this date, in format YYYY-MM-DD.
+ *
+ * --post_type=<post_type>
+ * : Export only posts with this post_type.
+ *
+ * --post__in=<pid>
+ * : Export all posts specified as a comma-separated list of IDs.
+ *
+ * --author=<login/id>
+ * : Export only posts by this author.
+ *
+ * --category=<category-id>
+ * : Export only posts in this category.
+ *
+ * --post_status=<status>
+ * : Export only posts with this status.
+ *
+ * ## EXAMPLES
+ *
+ * wp export --dir=/tmp/ --user=admin --post_type=post --start_date=2011-01-01 --end_date=2011-12-31
+ *
+ * wp export --dir=/tmp/ --post__in=123,124,125
+ *
* @synopsis [--dir=<dir>] [--start_date=<date>] [--end_date=<date>] [--post_type=<ptype>] [--post_status=<status>] [--post__in=<pids>] [--author=<login>] [--category=<cat>] [--skip_comments] [--file_item_count=<count>] [--verbose]
*/
public function __invoke( $_, $assoc_args ) {
/**
* Get help on a certain command.
*
+ * ## EXAMPLES
+ *
+ * # get help for `core` command
+ * wp help core
+ *
+ * # get help for `core download` subcommand
+ * wp help core download
+ *
* @synopsis [<command>]
*/
function __invoke( $args, $assoc_args ) {
/**
* Import content from a WXR file.
*
+ * ## OPTIONS
+ *
+ * <file>
+ * : Path to a valid WXR file for importing.
+ *
+ * --authors=<authors>
+ * : How the author mapping should be handled. Options are 'create', 'mapping.csv', or 'skip'. The first will create any non-existent users from the WXR file. The second will read author mapping associations from a CSV, or create a CSV for editing if the file path doesn't exist. The last option will skip any author mapping.
+ *
+ * --skip=<data-type>
+ * : Skip importing specific data. Supported option is 'attachment'.
+ *
* @synopsis <file> --authors=<authors> [--skip=<data-type>]
*/
public function __invoke( $args, $assoc_args ) {
/**
* Regenerate thumbnail(s).
*
+ * ## OPTIONS
+ *
+ * --yes
+ * : Answer yes to the confirmation message.
+ *
+ * <attachment-id>
+ * : One or more IDs of the attachments to regenerate.
+ *
+ * ## EXAMPLES
+ *
+ * wp media regenerate 123 1337
+ *
+ * wp media regenerate --yes
+ *
* @synopsis <attachment-id>... [--yes]
*/
function regenerate( $args, $assoc_args = array() ) {
/**
* Create attachments from local files or from URLs.
*
+ * ## OPTIONS
+ *
+ * <file>
+ * : Path to file or files to be imported. Supports the glob(3) capabilities of the current shell.
+ * If file is recognized as a URL (for example, with a scheme of http or ftp), the file will be
+ * downloaded to a temp file before being sideloaded.
+ *
+ * --post_id=<post_id>
+ * : ID of the post to attach the imported files to
+ *
+ * --title=<title>
+ * : Attachment title (post title field)
+ *
+ * --caption=<caption>
+ * : Caption for attachent (post excerpt field)
+ *
+ * --alt=<alt_text>
+ * : Alt text for image (saved as post meta)
+ *
+ * --desc=<description>
+ * : "Description" field (post content) of attachment post
+ *
+ * --featured_image
+ * : If set, set the imported image as the Featured Image of the post its attached to.
+ *
+ *
+ * ## EXAMPLES
+ *
+ * # Import all jpgs in the current user's "Pictures" directory, not attached to any post
+ * wp media import ~/Pictures/**/*.jpg
+ *
+ * # Import a local image and set it to be the post thumbnail for a post
+ * wp media import ~/Downloads/image.png --post_id=123 --title="A downloaded picture" --featured_image
+ *
+ * # Import an image from the web
+ * wp media import http://s.wordpress.org/style/images/wp-header-logo.png --title='The WordPress logo' --alt="Semantic personal publishing"
+ *
+ *
+ *
* @synopsis <file>... [--post_id=<id>] [--title=<title>] [--caption=<caption>] [--alt=<text>] [--desc=<description>] [--featured_image]
*/
function import( $args, $assoc_args = array() ) {
/**
* Manage network custom fields.
*
- * @package wp-cli
+ * ## OPTIONS
+ *
+ * <id>
+ * : The network id (usually 1).
+ *
+ * --format=json
+ * : Encode/decode values as JSON.
+ *
+ * ## EXAMPLES
+ *
+ * # get a list of super-admins
+ * wp network-meta get 1 site_admins
*/
class Network_Meta_Command extends \WP_CLI\CommandWithMeta {
protected $meta_type = 'site';
/**
* Manage options.
*
- * @package wp-cli
+ * ## OPTIONS
+ *
+ * --format=json
+ * : Encode/decode values as JSON.
+ *
+ * ## EXAMPLES
+ *
+ * wp option get siteurl
+ *
+ * wp option add my_option foobar
+ *
+ * wp option update my_option '{"foo": "bar"}' --format=json
+ *
+ * wp option delete my_option
*/
class Option_Command extends WP_CLI_Command {
/**
* See the status of one or all plugins.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : A particular plugin to show the status for.
+ *
* @synopsis [<plugin>]
*/
function status( $args ) {
/**
* Activate a plugin.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to activate.
+ *
+ * --network
+ * : If set, the plugin will be activated for the entire multisite network.
+ *
* @synopsis <plugin> [--network]
*/
function activate( $args, $assoc_args = array() ) {
/**
* Deactivate a plugin.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to deactivate.
+ *
+ * --network
+ * : If set, the plugin will be deactivated for the entire multisite network.
+ *
* @synopsis <plugin> [--network]
*/
function deactivate( $args, $assoc_args = array() ) {
/**
* Toggle a plugin's activation state.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to toggle.
+ *
+ * --network
+ * : If set, the plugin will be toggled for the entire multisite network.
+ *
* @synopsis <plugin> [--network]
*/
function toggle( $args, $assoc_args = array() ) {
/**
* Get the path to a plugin or to the plugin directory.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to get the path to. If not set, will return the path to the
+ * plugins directory.
+ *
+ * --dir
+ * : If set, get the path to the closest parent directory, instead of the
+ * plugin file.
+ *
+ * ## EXAMPLES
+ *
+ * cd $(wp theme path)
+ *
* @synopsis [<plugin>] [--dir]
*/
function path( $args, $assoc_args ) {
/**
* Update a plugin.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to update.
+ *
+ * --version=dev
+ * : If set, the plugin will be updated to the latest development version,
+ * regardless of what version is currently installed.
+ *
+ * ## EXAMPLES
+ *
+ * wp plugin update bbpress --version=dev
+ *
* @synopsis <plugin> [--version=<version>]
*/
function update( $args, $assoc_args ) {
/**
* Update all plugins.
*
+ * ## OPTIONS
+ *
+ * --dry-run
+ * : Pretend to do the updates, to see what would happen.
+ *
+ * ## EXAMPLES
+ *
+ * wp plugin update-all
+ *
* @subcommand update-all
* @synopsis [--dry-run]
*/
/**
* Install a plugin.
*
+ * ## OPTIONS
+ *
+ * <plugin|zip|url>
+ * : A plugin slug, the path to a local zip file, or URL to a remote zip file.
+ *
+ * --version=<version>
+ * : If set, get that particular version from wordpress.org, instead of the
+ * stable version.
+ *
+ * --force
+ * : If set, the command will overwrite any installed version of the plugin, without prompting
+ * for confirmation.
+ *
+ * --activate
+ * : If set, the plugin will be activated immediately after install.
+ *
+ * ## EXAMPLES
+ *
+ * # Install the latest version from wordpress.org and activate
+ * wp plugin install bbpress --activate
+ *
+ * # Install the development version from wordpress.org
+ * wp plugin install bbpress --version=dev
+ *
+ * # Install from a local zip file
+ * wp plugin install ../my-plugin.zip
+ *
+ * # Install from a remote zip file
+ * wp plugin install http://s3.amazonaws.com/bucketname/my-plugin.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
+ *
* @synopsis <plugin|zip|url> [--version=<version>] [--force] [--activate]
*/
function install( $args, $assoc_args ) {
/**
* Uninstall a plugin.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to uninstall.
+ *
+ * --no-delete
+ * : If set, the plugin files will not be deleted. Only the uninstall procedure
+ * will be run.
+ *
+ * ## EXAMPLES
+ *
+ * wp plugin uninstall hello
+ *
* @synopsis <plugin> [--no-delete]
*/
function uninstall( $args, $assoc_args = array() ) {
/**
* Delete plugin files.
*
+ * ## OPTIONS
+ *
+ * <plugin>
+ * : The plugin to delete.
+ *
+ * ## EXAMPLES
+ *
+ * wp plugin delete hello
+ *
* @synopsis <plugin>
*/
function delete( $args, $assoc_args = array() ) {
/**
* Get a list of plugins.
*
+ * ## OPTIONS
+ *
+ * * `--format`=<format>:
+ *
+ * Output list as table, CSV or JSON. Defaults to table.
+ *
+ * ## EXAMPLES
+ *
+ * wp plugin list --format=json
+ *
* @subcommand list
* @synopsis [--format=<format>]
*/
/**
* Manage post custom fields.
*
- * @package wp-cli
+ * ## OPTIONS
+ *
+ * --format=json
+ * : Encode/decode values as JSON.
+ *
+ * ## EXAMPLES
+ *
+ * wp post-meta set 123 _wp_page_template about.php
*/
class Post_Meta_Command extends \WP_CLI\CommandWithMeta {
protected $meta_type = 'post';
/**
* Create a post.
*
+ * ## OPTIONS
+ *
+ * <filename>
+ * : Read post content from <filename>. If this value is present, the
+ * `--post_content` argument will be ignored.
+ *
+ * Passing `-` as the filename will cause post content to
+ * be read from STDIN.
+ *
+ * --<field>=<value>
+ * : Field values for the new post. See wp_insert_post().
+ *
+ * --edit
+ * : Immediately open system's editor to write or edit post content.
+ *
+ * If content is read from a file, from STDIN, or from the `--post_content`
+ * argument, that text will be loaded into the editor.
+ *
+ * --porcelain
+ * : Output just the new post id.
+ *
+ * ## EXAMPLES
+ *
+ * wp post create --post_type=page --post_status=publish --post_title='A future post' --post-status=future --post_date='2020-12-01 07:00:00'
+ *
+ * wp post create page.txt --post_type=page --post_title='Page from file'
+ *
* @synopsis [<filename>] --<field>=<value> [--edit] [--porcelain]
*/
public function create( $args, $assoc_args ) {
/**
* Update one or more posts.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the post to update.
+ *
+ * --<field>=<value>
+ * : One or more fields to update. See wp_update_post().
+ *
+ * ## EXAMPLES
+ *
+ * wp post update 123 --post_name=something --post_status=draft
+ *
* @synopsis <id>... --<field>=<value>
*/
public function update( $args, $assoc_args ) {
/**
* Launch system editor to edit post content.
*
+ * ## OPTIONS
+ *
+ * <id>
+ * : The ID of the post to edit.
+ *
+ * ## EXAMPLES
+ *
+ * wp post edit 123
+ *
* @synopsis <id>
*/
public function edit( $args, $_ ) {
/**
* Get a post's content by ID.
*
- * @synopsis [--format=<format>] <id>
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the post to get.
+ *
+ * --format=<format>
+ * : The format to use when printing the post, acceptable values:
+ *
+ * - **content**: Outputs only the post's content.
+ *
+ * - **table**: Outputs all fields of the post as a table. Note that the
+ * post_content field is omitted so that the table is readable.
+ *
+ * - **json**: Outputs all fields in JSON format.
+ *
+ * ## EXAMPLES
+ *
+ * wp post get 12 --format=content
+ *
+ * wp post get 12 > file.txt
+ *
+ * @synopsis [--format=<format>] <ID>
*/
public function get( $args, $assoc_args ) {
$assoc_args = wp_parse_args( $assoc_args, array(
/**
* Delete a post by ID.
*
+ * ## OPTIONS
+ *
+ * <ID>
+ * : The ID of the post to delete.
+ *
+ * --force
+ * : Skip the trash bin.
+ *
+ * ## EXAMPLES
+ *
+ * wp post delete 123 --force
+ *
+ * wp post delete $(wp post list --post_type='page' --format=ids)
+ *
* @synopsis <id>... [--force]
*/
public function delete( $args, $assoc_args ) {
/**
* Get a list of posts.
*
+ * ## OPTIONS
+ *
+ * --<field>=<value>
+ * : One or more args to pass to WP_Query.
+ *
+ * --fields=<fields>
+ * : Limit the output to specific object fields. Defaults to ID,post_title,post_name,post_date,post_status.
+ *
+ * --format=<format>
+ * : Output list as table, CSV, JSON, or simply IDs. Defaults to table.
+ *
+ * ## EXAMPLES
+ *
+ * wp post list --format=ids
+ *
+ * wp post list --post_type=post --posts_per_page=5 --format=json
+ *
+ * wp post list --post_type=page --fields=post_title,post_status
+ *
* @subcommand list
* @synopsis [--<field>=<value>] [--fields=<fields>] [--format=<format>]
*/
/**
* Generate some posts.
*
+ * ## OPTIONS
+ *
+ * --count=<number>
+ * : How many posts to generate. Default: 100
+ *
+ * --post_type=<type>
+ * : The type of the generated posts. Default: 'post'
+ *
+ * --post_status=<status>
+ * : The status of the generated posts. Default: 'publish'
+ *
+ * --post_author=<login>
+ * : The author of the generated posts. Default: none
+ *
+ * --post_date=<yyyy-mm-dd>
+ * : The date of the generated posts. Default: current date
+ *
+ * --max_depth=<number>
+ * : For hierarchical post types, generate child posts down to a certain depth. Default: 1
+ *
+ * ## EXAMPLES
+ *
+ * wp post generate --count=10 --post_type=page --post_date=1999-01-04
+ *
* @synopsis [--count=<number>] [--post_type=<type>] [--post_status=<status>] [--post_author=<login>] [--post_date=<yyyy-mm-dd>] [--max_depth=<number>]
*/
public function generate( $args, $assoc_args ) {
/**
* Flush rewrite rules.
*
+ * ## OPTIONS
+ *
+ * --hard
+ * : Perform a hard flush - do not overwrite `.htaccess`. The default is to update `.htaccess` rules as well as rewrite rules in database.
+ *
* @synopsis [--hard]
*/
public function flush( $args, $assoc_args ) {
/**
* Update the permalink structure.
*
+ * ## OPTIONS
+ *
+ * <permastruct>
+ * : The new permalink structure to apply.
+ *
+ * --category-base=<categorybase>
+ * : Set the base for category permalinks, i.e. '/category/'.
+ *
+ * --tag-base=<tagbase>
+ * : Set the base for tag permalinks, i.e. '/tag/'.
+ *
+ * ## EXAMPLES
+ *
+ * wp rewrite structure '/%year%/%monthnum%/%postname%'
+ *
* @synopsis <permastruct> [--category-base=<base>] [--tag-base=<base>] [--hard]
*/
public function structure( $args, $assoc_args ) {
/**
* Print current rewrite rules.
*
- * @synopsis [--json]
+ * ## OPTIONS
+ *
+ * --format=json
+ * : Output rules in JSON format.
+ *
+ * @synopsis [--format=<format>]
*/
public function dump( $args, $assoc_args ) {
-
$rules = get_option( 'rewrite_rules' );
if ( ! $rules ) {
$rules = array();
foreach ( $rules as $route => $rule )
WP_CLI::line( $route . "\t" . $rule );
}
-
}
/**
}
}
}
-
}
WP_CLI:: add_command( 'rewrite', 'Rewrite_Command' );
/**
* List all roles.
*
+ * ## OPTIONS
+ *
+ * --fields=<fields>
+ * : Limit the output to specific object fields. Defaults to name,role.
+ *
+ * --format=<format>
+ * : Output list as table, CSV or JSON. Defaults to table.
+ *
+ * ## EXAMPLES
+ *
+ * wp role list --fields=role --format=csv
+ *
* @subcommand list
* @synopsis [--fields=<fields>] [--format=<format>]
*/
/**
* Check if a role exists.
- * Will return 0 if the role exists, 1 if it does not.
+ *
+ * ##DESCRIPTION
+ *
+ * Will exit with status 0 if the role exists, 1 if it does not.
+ *
+ * ## OPTIONS
+ *
+ * * <role-key>:
+ *
+ * The internal name of the role, e.g. editor
+ *
+ * ## EXAMPLES
+ *
+ * wp role exists editor
*
* @synopsis <role-key>
*/
/**
* Create a new role.
*
+ * ## OPTIONS
+ *
+ * * <role-key>:
+ *
+ * The internal name of the role, e.g. editor
+ *
+ * * <role-name>:
+ *
+ * The publically visible name of the role, e.g. Editor
+ *
+ * ## EXAMPLES
+ *
+ * wp role create approver Approver
+ *
+ * wp role create productadmin "Product Administrator"
+ *
* @synopsis <role-key> <role-name>
*/
public function create( $args ) {
WP_CLI::error( "Role couldn't be created." );
else
WP_CLI::success( sprintf( "Role with key %s created.", $role_key ) );
-
}
/**
* Delete an existing role.
*
+ * ## OPTIONS
+ *
+ * * <role-key>:
+ *
+ * The internal name of the role, e.g. editor
+ *
+ * ## EXAMPLES
+ *
+ * wp role delete approver
+ *
+ * wp role delete productadmin
+ *
* @synopsis <role-key>
*/
public function delete( $args ) {
/**
* Generate PHP code for registering a custom post type.
*
+ * ## OPTIONS
+ *
+ * --label=<label>
+ * : The text used to translate the update messages
+ *
+ * --textdomain=<textdomain>
+ * : The textdomain to use for the labels.
+ *
+ * --theme
+ * : Create a file in the active theme directory, instead of sending to
+ * STDOUT. Specify a theme with `--theme=<theme>` to have the file placed in that theme.
+ *
+ * --plugin=<plugin>
+ * : Create a file in the given plugin's directory, instead of sending to
+ * STDOUT.
+ *
+ * --raw
+ * : Just generate the `register_post_type()` call and nothing else.
+ *
* @subcommand post-type
*
* @alias cpt
/**
* Generate PHP code for registering a custom taxonomy.
*
+ * ## OPTIONS
+ *
+ * --post_types=<post_types>
+ * : Post types to register for use with the taxonomy.
+ *
+ * --label=<label>
+ * : The text used to translate the update messages
+ *
+ * --textdomain=<textdomain>
+ * : The textdomain to use for the labels.
+ *
+ * --theme
+ * : Create a file in the active theme directory, instead of sending to
+ * STDOUT. Specify a theme with `--theme=<theme>` to have the file placed in that theme.
+ *
+ * --plugin=<plugin>
+ * : Create a file in the given plugin's directory, instead of sending to
+ * STDOUT.
+ *
+ * --raw
+ * : Just generate the `register_taxonomy()` call and nothing else.
+ *
+ * ## EXAMPLES
+ *
+ * wp scaffold taxonomy venue --post_types=event,presentation
+ *
* @subcommand taxonomy
*
* @alias tax
/**
* Generate starter code for a theme.
*
+ * ## OPTIONS
+ *
+ * <slug>
+ * : The slug for the new theme, used for prefixing functions.
+ *
+ * --activate
+ * : Activate the newly downloaded theme.
+ *
+ * --theme_name=<title>
+ * : What to put in the 'Theme Name:' header in style.css
+ *
+ * --author=<full name>
+ * : What to put in the 'Author:' header in style.css
+ *
+ * --author_uri=<http url>
+ * : What to put in the 'Author URI:' header in style.css
+ *
* @synopsis <slug> [--theme_name=<title>] [--author=<full-name>] [--author_uri=<http-url>] [--activate]
*/
function _s( $args, $assoc_args ) {
/**
* Generate empty child theme.
*
+ * ## OPTIONS
+ *
+ * <slug>
+ * : The slug for the new child theme.
+ *
+ * --parent_theme=<slug>
+ * : What to put in the 'Template:' header in style.css
+ *
+ * --theme_name=<title>
+ * : What to put in the 'Theme Name:' header in style.css
+ *
+ * --author=<full name>
+ * : What to put in the 'Author:' header in style.css
+ *
+ * --author_uri=<http url>
+ * : What to put in the 'Author URI:' header in style.css
+ *
+ * --theme_uri=<http url>
+ * : What to put in the 'Theme URI:' header in style.css
+ *
+ * --activate
+ * : Activate the newly created child theme.
+ *
* @subcommand child-theme
*
* @synopsis <slug> --parent_theme=<slug> [--theme_name=<title>] [--author=<full-name>] [--author_uri=<http-url>] [--theme_uri=<http-url>] [--activate]
/**
* Generate starter code for a plugin.
*
+ * ## OPTIONS
+ *
+ * --activate
+ * : Activate the newly generated plugin.
+ *
+ * --plugin_name=<title>
+ * : What to put in the 'Plugin Name:' header
+ *
* @synopsis <slug> [--plugin_name=<title>] [--activate]
*/
function plugin( $args, $assoc_args ) {
/**
* Generate files needed for running PHPUnit tests.
*
+ * ## DESCRIPTION
+ *
+ * These are the files that are generated:
+ *
+ * * `phpunit.xml` is the configuration file for PHPUnit
+ * * `.travis.yml` is the configuration file for Travis CI
+ * * `tests/bootstrap.php` is the file that makes the current plugin active when running the test suite
+ * * `tests/test-sample.php` is a sample file containing the actual tests
+ *
+ * ## ENVIRONMENT
+ *
+ * The `tests/bootstrap.php` file looks for the WP_TESTS_DIR environment
+ * variable.
+ *
+ * ## EXAMPLE
+ *
+ * wp scaffold plugin-tests hello
+ *
* @subcommand plugin-tests
*
* @synopsis <plugin>
/**
* Search/replace strings in the database.
*
+ * ## DESCRIPTION
+ *
+ * This command will go through all rows in all tables and will replace all appearances of the old string with the new one.
+ *
+ * It will correctly handle serialized values, and will not change primary key values.
+ *
+ * ## OPTIONS
+ *
+ * --network
+ * : Search/replace through all the tables in a multisite install.
+ *
+ * --skip-columns=<columns>
+ * : Do not perform the replacement in the comma-separated columns.
+ *
+ * --dry-run
+ * : Show report, but don't perform the changes.
+ *
+ * ## EXAMPLES
+ *
+ * wp search-replace 'http://example.dev' 'http://example.com' --skip-columns=guid
+ *
+ * wp search-replace 'foo' 'bar' wp_posts wp_postmeta wp_terms --dry-run
+ *
* @synopsis <old> <new> [<table>...] [--skip-columns=<columns>] [--dry-run] [--network]
*/
public function __invoke( $args, $assoc_args ) {
/**
* Interactive PHP console.
*
+ * ## DESCRIPTION
+ *
+ * `wp shell` allows you to evaluate PHP statements and expressions interactively, from within a WordPress environment. This means that you have access to all the functions, classes and globals that you would have access to from inside a WordPress plugin, for example.
+ *
+ * ## OPTIONS
+ *
+ * --basic
+ * : Start in fail-safe mode, even if Boris is available.
+ *
* @synopsis [--basic]
*/
public function __invoke( $_, $assoc_args ) {
/**
* Empty a site of its content (posts, comments, and terms).
*
+ * ## OPTIONS
+ *
+ * --yes
+ * : Proceed to empty the site without a confirmation prompt.
+ *
* @subcommand empty
* @synopsis [--yes]
*/
/**
* Delete a site in a multisite install.
*
+ * ## OPTIONS
+ *
+ * <blog-id>
+ * : The id of the blog to delete. If not provided, you must set the --slug parameter.
+ *
+ * --slug=<slug>
+ * : Path of the blog to be deleted. Subdomain on subdomain installs, directory on subdirectory installs.
+ *
+ * --yes
+ * : Answer yes to the confirmation message.
+ *
+ * --keep-tables
+ * : Delete the blog from the list, but don't drop it's tables.
+ *
* @synopsis [<site-id>] [--slug=<slug>] [--yes] [--keep-tables]
*/
function delete( $args, $assoc_args ) {
/**
* Create a site in a multisite install.
*
+ * ## OPTIONS
+ *
+ * --slug=<slug>
+ * : Path for the new site. Subdomain on subdomain installs, directory on subdirectory installs.
+ *
+ * --title=<title>
+ * : Title of the new site. Default: prettified slug.
+ *
+ * --email=<email>
+ * : Email for Admin user. User will be created if none exists. Assignement to Super Admin if not included.
+ *
+ * --network_id=<network-id>
+ * : Network to associate new site with. Defaults to current network (typically 1).
+ *
+ * --private
+ * : If set, the new site will be non-public (not indexed)
+ *
+ * --porcelain
+ * : If set, only the site id will be output on success.
+ *
* @synopsis --slug=<slug> [--title=<title>] [--email=<email>] [--network_id=<network-id>] [--private] [--porcelain]
*/
public function create( $_, $assoc_args ) {
/**
* List terms in a taxonomy.
*
+ * ## OPTIONS
+ *
+ * <taxonomy>
+ * : List terms of a given taxonomy.
+ *
+ * --fields=<fields>
+ * : Limit the output to specific object fields. Defaults to all of the term object fields.
+ *
+ * --format=<format>
+ * : Output list as table, CSV, JSON, or simply IDs. Defaults to table.
+ *
+ * ## EXAMPLES
+ *
+ * wp term list category --format=csv
+ *
+ * wp term list post_tag --fields=name,slug
+ *
* @subcommand list
* @synopsis <taxonomy> [--fields=<fields>] [--format=<format>]
*/
/**
* Create a term.
*
+ * ## OPTIONS
+ *
+ * <term>
+ * : A name for the new term.
+ *
+ * <taxonomy>
+ * : Taxonomy for the new term.
+ *
+ * --slug=<slug>
+ * : A unique slug for the new term. Defaults to sanitized version of name.
+ *
+ * --description=<description>
+ * : A description for the new term.
+ *
+ * --parent=<term-id>
+ * : A parent for the new term.
+ *
+ * --porcelain
+ * : Output just the new term id.
+ *
+ * ## EXAMPLES
+ *
+ * wp term create Apple category --description="A type of fruit"
+ *
* @synopsis <term> <taxonomy> [--slug=<slug>] [--description=<description>] [--parent=<term-id>] [--porcelain]
*/
public function create( $args, $assoc_args ) {
/**
* Update a term.
*
+ * ## OPTIONS
+ *
+ * <term-id>
+ * : ID for the term to update.
+ *
+ * <taxonomy>
+ * : Taxonomy of the term to update.
+ *
+ * --name=<name>
+ * : A new name for the term.
+ *
+ * --slug=<slug>
+ * : A new slug for the term.
+ *
+ * --description=<description>
+ * : A new description for the term.
+ *
+ * --parent=<term-id>
+ * : A new parent for the term.
+ *
+ * ## EXAMPLES
+ *
+ * wp term update 15 category --name=Apple
+ *
* @synopsis <term-id> <taxonomy> [--name=<name>] [--slug=<slug>] [--description=<description>] [--parent=<term-id>]
*/
public function update( $args, $assoc_args ) {
/**
* Delete a term.
*
+ * ## OPTIONS
+ *
+ * <term-id>
+ * : ID for the term to delete.
+ *
+ * <taxonomy>
+ * : Taxonomy of the term to delete.
+ *
+ * ## EXAMPLES
+ *
+ * wp term delete 15 category
+ *
* @synopsis <term-id> <taxonomy>
*/
public function delete( $args ) {
/**
* See the status of one or all themes.
*
+ * ## OPTIONS
+ *
+ * <theme>
+ * : A particular theme to show the status for.
+ *
* @synopsis [<theme>]
*/
function status( $args ) {
/**
* Activate a theme.
*
+ * ## OPTIONS
+ *
+ * <theme>
+ * : The theme to activate.
+ *
* @synopsis <theme>
*/
public function activate( $args = array() ) {
/**
* Get the path to a theme or to the theme directory.
*
+ * ## OPTIONS
+ *
+ * <theme>
+ * : The theme to get the path to. If not set, will return the path to the
+ * themes directory.
+ *
+ * --dir
+ * : If set, get the path to the closest parent directory, instead of the
+ * theme file.
+ *
+ * ## EXAMPLES
+ *
+ * cd $(wp theme path)
+ *
* @synopsis [<theme>] [--dir]
*/
function path( $args, $assoc_args ) {
/**
* Install a theme.
*
+ * ## OPTIONS
+ *
+ * <theme|zip|url>
+ * : A theme slug, the path to a local zip file, or URL to a remote zip file.
+ *
+ * --force
+ * : If set, the command will overwrite any installed version of the theme, without prompting
+ * for confirmation.
+ *
+ * --activate
+ * : If set, the theme will be activated immediately after install.
+ *
+ * ## EXAMPLES
+ *
+ * # Install the latest version from wordpress.org and activate
+ * wp theme install twentytwelve --activate
+ *
+ * # Install from a local zip file
+ * wp theme install ../my-theme.zip
+ *
+ * # Install from a remote zip file
+ * wp theme install http://s3.amazonaws.com/bucketname/my-theme.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
+ *
* @synopsis <theme|zip|url> [--version=<version>] [--force] [--activate]
*/
function install( $args, $assoc_args ) {
/**
* Update a theme.
*
+ * ## OPTIONS
+ *
+ * <theme>
+ * : The theme to update.
+ *
+ * --version=dev
+ * : If set, the theme will be updated to the latest development version,
+ * regardless of what version is currently installed.
+ *
+ * ## EXAMPLES
+ *
+ * wp theme update twentytwelve
+ *
* @synopsis <theme> [--version=<version>]
*/
function update( $args, $assoc_args ) {
/**
* Update all themes.
*
+ * ## OPTIONS
+ *
+ * --dry-run
+ * : Pretend to do the updates, to see what would happen.
+ *
+ * ## EXAMPLES
+ *
+ * wp theme update-all
+ *
* @subcommand update-all
* @synopsis [--dry-run]
*/
/**
* Delete a theme.
*
+ * ## OPTIONS
+ *
+ * <theme>
+ * : The theme to delete.
+ *
+ * ## EXAMPLES
+ *
+ * wp theme delete twentyeleven
+ *
* @synopsis <theme>
*/
function delete( $args ) {
/**
* Get a list of themes.
*
+ * ## OPTIONS
+ *
+ * * `--format`=<format>:
+ *
+ * Output list as table, CSV or JSON. Defaults to table.
+ *
+ * ## EXAMPLES
+ *
+ * wp theme list --format=csv
+ *
* @subcommand list
* @synopsis [--format=<format>]
*/
/**
* Manage transients.
*
- * @package wp-cli
+ * ## EXAMPLES
+ *
+ * wp transient set my_key my_value 300
*/
class Transient_Command extends WP_CLI_Command {
/**
* Manage user custom fields.
*
- * @package wp-cli
+ * ## OPTIONS
+ *
+ * --format=json
+ * : Encode/decode values as JSON.
+ *
+ * ## EXAMPLES
+ *
+ * wp user-meta set 123 description "Mary is a WordPress developer."
*/
class User_Meta_Command extends \WP_CLI\CommandWithMeta {
protected $meta_type = 'user';
/**
* List users.
*
+ * ## OPTIONS
+ *
+ * --role=<role>
+ * : Only display users with a certain role.
+ *
+ * --fields=<fields>
+ * : Limit the output to specific object fields. Defaults to ID,user_login,display_name,user_email,user_registered,roles
+ *
+ * --format=<format>
+ * : Output list as table, CSV, JSON, or simply IDs. Defaults to table.
+ *
+ * ## EXAMPLES
+ *
+ * wp user list --format=ids
+ *
+ * wp user list --role=administrator --format=csv
+ *
+ * wp user list --fields=display_name,user_email
+ *
* @subcommand list
* @synopsis [--role=<role>] [--fields=<fields>] [--format=<format>]
*/
/**
* Get a single user.
*
+ * ## OPTIONS
+ *
+ * <user>
+ * : User ID or user login.
+ *
+ * --format=<format>
+ * : The format to use when printing the user; acceptable values:
+ *
+ * **table**: Outputs all fields of the user as a table.
+ *
+ * **json**: Outputs all fields in JSON format.
+ *
+ * ## EXAMPLES
+ *
+ * wp user get 12
+ *
+ * wp user get bob --format=json > bob.json
+ *
* @synopsis [--format=<format>] <user>
*/
public function get( $args, $assoc_args ) {
/**
* Delete one or more users.
*
+ * ## OPTIONS
+ *
+ * <user>
+ * : The user login or ID of the user to delete.
+ *
+ * --reassign=<ID>
+ * : User to reassign the posts to.
+ *
+ * ## EXAMPLES
+ *
+ * wp user delete 123 --reassign=567
+ *
* @synopsis <user>... [--reassign=<id>]
*/
public function delete( $args, $assoc_args ) {
/**
* Create a user.
*
+ * ## OPTIONS
+ *
+ * <user-login>
+ * : The login of the user to create.
+ *
+ * <user-email>
+ * : The email address of the user to create.
+ *
+ * --role=<role>
+ * : The role of the user to create. Default: default role
+ *
+ * --user_pass=<password>
+ * : The user password. Default: randomly generated
+ *
+ * --user_registered=<yyyy-mm-dd>
+ * : The date the user registered. Default: current date
+ *
+ * --display_name=<name>
+ * : The display name.
+ *
+ * --porcelain
+ * : Output just the new user id.
+ *
+ * ## EXAMPLES
+ *
+ * wp user create bob bob@example.com --role=author
+ *
* @synopsis <user-login> <user-email> [--role=<role>] [--user_pass=<password>] [--user_registered=<yyyy-mm-dd>] [--display_name=<name>] [--porcelain]
*/
public function create( $args, $assoc_args ) {
/**
* Update a user.
*
+ * ## OPTIONS
+ *
+ * <user>
+ * : The user login or ID of the user to update.
+ *
+ * --<field>=<value>
+ * : One or more fields to update. For accepted fields, see wp_update_user().
+ *
+ * ## EXAMPLES
+ *
+ * wp user update 123 --user_login=mary --display_name=Mary
+ *
+ * wp user update mary --user_pass=marypass
+ *
* @synopsis <user>... --<field>=<value>
*/
public function update( $args, $assoc_args ) {
/**
* Generate users.
*
+ * ## OPTIONS
+ *
+ * --count=<number>
+ * : How many users to generate. Default: 100
+ *
+ * --role=<role>
+ * : The role of the generated users. Default: default role from WP
+ *
* @synopsis [--count=<number>] [--role=<role>]
*/
public function generate( $args, $assoc_args ) {
/**
* Set the user role (for a particular blog).
*
+ * ## OPTIONS
+ *
+ * <user>
+ * : User ID or user login.
+ *
+ * [<role>]
+ * : Make the user have the specified role. If not passed, the default role is
+ * used.
+ *
+ * ## EXAMPLES
+ *
+ * wp user set-role bob author
+ * wp user set-role 12 author
+ *
* @subcommand set-role
* @synopsis <user> [<role>]
*/
/**
* Add a role for a user.
*
+ * ## OPTIONS
+ *
+ * <user>
+ * : User ID or user login.
+ *
+ * <role>
+ * : Add the specified role to the user.
+ *
+ * ## EXAMPLES
+ *
+ * wp user set-role bob author
+ * wp user set-role 12 author
+ *
* @subcommand add-role
* @synopsis <user> <role>
*/
/**
* Remove a user's role.
*
+ * ## OPTIONS
+ *
+ * <user>
+ * : User ID or user login.
+ *
+ * ## EXAMPLES
+ *
+ * wp user remove-role bob
+ * wp user remove-role 12
+ *
* @subcommand remove-role
* @synopsis <user> [<role>]
*/
/**
* Import users from a CSV file.
*
+ * ## OPTIONS
+ *
+ * <file>
+ * : The CSV file of users to import.
+ *
+ * ## EXAMPLES
+ *
+ * wp user import-csv /path/to/users.csv
+ *
+ * Sample users.csv file:
+ *
+ * user_login,user_email,display_name,role
+ * bobjones,bobjones@domain.com,Bob Jones,contributor
+ * newuser1,newuser1@domain.com,New User,author
+ * existinguser,existinguser@domain.com,Existing User,administrator
+ *
* @subcommand import-csv
* @synopsis <file>
*/