diff --git a/.actrc b/.actrc deleted file mode 100644 index 99e6b7ec..00000000 --- a/.actrc +++ /dev/null @@ -1,3 +0,0 @@ -# Configuration file for nektos/act. -# See https://github.com/nektos/act#configuration --P ubuntu-latest=shivammathur/node:latest diff --git a/.bundle/config b/.bundle/config deleted file mode 100644 index 9bc01b4c..00000000 --- a/.bundle/config +++ /dev/null @@ -1,3 +0,0 @@ ---- -BUNDLE_PATH: "vendor/bundle" -BUNDLE_DISABLE_SHARED_GEMS: "true" diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 84f918ed..00000000 --- a/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# This file is for unifying the coding style for different editors and IDEs -# editorconfig.org - -# WordPress Coding Standards -# https://make.wordpress.org/core/handbook/coding-standards/ - -# From https://github.com/WordPress/wordpress-develop/blob/trunk/.editorconfig with a couple of additions. - -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = tab - -[{*.yml,*.feature,.jshintrc,*.json}] -indent_style = space -indent_size = 2 - -[*.md] -trim_trailing_whitespace = false - -[{*.txt,wp-config-sample.php}] -end_of_line = crlf diff --git a/.github/workflows/check-branch-alias.yml b/.github/workflows/check-branch-alias.yml deleted file mode 100644 index 78da6371..00000000 --- a/.github/workflows/check-branch-alias.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Check Branch Alias - -on: - release: - types: [released] - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - check-branch-alias: - uses: wp-cli/.github/.github/workflows/reusable-check-branch-alias.yml@main diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml deleted file mode 100644 index 07e4fd1f..00000000 --- a/.github/workflows/code-quality.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Code Quality Checks - -on: - pull_request: - push: - branches: - - main - - master - -jobs: - code-quality: - uses: wp-cli/.github/.github/workflows/reusable-code-quality.yml@main diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml deleted file mode 100644 index 5158ca68..00000000 --- a/.github/workflows/copilot-setup-steps.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Copilot Setup Steps" - -on: - workflow_dispatch: - push: - paths: - - .github/workflows/copilot-setup-steps.yml - pull_request: - paths: - - .github/workflows/copilot-setup-steps.yml - -jobs: - copilot-setup-steps: - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Check existence of composer.json file - id: check_composer_file - uses: andstor/file-existence-action@v3 - with: - files: "composer.json" - - - name: Set up PHP environment - if: steps.check_composer_file.outputs.files_exists == 'true' - uses: shivammathur/setup-php@v2 - with: - php-version: 'latest' - ini-values: zend.assertions=1, error_reporting=-1, display_errors=On - coverage: 'none' - tools: composer,cs2pr - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Composer dependencies & cache dependencies - if: steps.check_composer_file.outputs.files_exists == 'true' - uses: ramsey/composer-install@v3 - env: - COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }} - with: - # Bust the cache at least once a month - output format: YYYY-MM. - custom-cache-suffix: $(date -u "+%Y-%m") diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml deleted file mode 100644 index 14dffc54..00000000 --- a/.github/workflows/issue-triage.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: Issue and PR Triage - -'on': - issues: - types: [opened] - pull_request_target: - types: [opened] - workflow_dispatch: - inputs: - issue_number: - description: 'Issue/PR number to triage (leave empty to process all)' - required: false - type: string - -jobs: - issue-triage: - uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main - with: - issue_number: >- - ${{ - (github.event_name == 'workflow_dispatch' && inputs.issue_number) || - (github.event_name == 'pull_request_target' && github.event.pull_request.number) || - (github.event_name == 'issues' && github.event.issue.number) || - '' - }} diff --git a/.github/workflows/manage-labels.yml b/.github/workflows/manage-labels.yml deleted file mode 100644 index 45711bde..00000000 --- a/.github/workflows/manage-labels.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Manage Labels - -'on': - workflow_dispatch: - push: - branches: - - main - - master - paths: - - 'composer.json' - -permissions: - issues: write - contents: read - -jobs: - manage-labels: - uses: wp-cli/.github/.github/workflows/reusable-manage-labels.yml@main diff --git a/.github/workflows/regenerate-readme.yml b/.github/workflows/regenerate-readme.yml deleted file mode 100644 index c633d9d4..00000000 --- a/.github/workflows/regenerate-readme.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Regenerate README file - -on: - workflow_dispatch: - push: - branches: - - main - - master - paths-ignore: - - "features/**" - - "README.md" - -jobs: - regenerate-readme: - uses: wp-cli/.github/.github/workflows/reusable-regenerate-readme.yml@main diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml deleted file mode 100644 index 1044b798..00000000 --- a/.github/workflows/testing.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Testing - -on: - pull_request: - push: - branches: - - main - - master - schedule: - - cron: '17 1 * * *' # Run every day on a seemly random time. - -jobs: - test: - uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main diff --git a/.github/workflows/welcome-new-contributors.yml b/.github/workflows/welcome-new-contributors.yml deleted file mode 100644 index c38e033b..00000000 --- a/.github/workflows/welcome-new-contributors.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Welcome New Contributors - -on: - pull_request_target: - types: [opened] - branches: - - main - - master - -jobs: - welcome: - uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 1ff84f6d..00000000 --- a/AGENTS.md +++ /dev/null @@ -1,121 +0,0 @@ -# Instructions - -This package is part of WP-CLI, the official command line interface for WordPress. For a detailed explanation of the project structure and development workflow, please refer to the main @README.md file. - -## Best Practices for Code Contributions - -When contributing to this package, please adhere to the following guidelines: - -* **Follow Existing Conventions:** Before writing any code, analyze the existing codebase in this package to understand the coding style, naming conventions, and architectural patterns. -* **Focus on the Package's Scope:** All changes should be relevant to the functionality of the package. -* **Write Tests:** All new features and bug fixes must be accompanied by acceptance tests using Behat. You can find the existing tests in the `features/` directory. There may be PHPUnit unit tests as well in the `tests/` directory. -* **Update Documentation:** If your changes affect the user-facing functionality, please update the relevant inline code documentation. - -### Building and running - -Before submitting any changes, it is crucial to validate them by running the full suite of static code analysis and tests. To run the full suite of checks, execute the following command: `composer test`. - -This single command ensures that your changes meet all the quality gates of the project. While you can run the individual steps separately, it is highly recommended to use this single command to ensure a comprehensive validation. - -### Useful Composer Commands - -The project uses Composer to manage dependencies and run scripts. The following commands are available: - -* `composer install`: Install dependencies. -* `composer test`: Run the full test suite, including linting, code style checks, static analysis, and unit/behavior tests. -* `composer lint`: Check for syntax errors. -* `composer phpcs`: Check for code style violations. -* `composer phpcbf`: Automatically fix code style violations. -* `composer phpstan`: Run static analysis. -* `composer phpunit`: Run unit tests. -* `composer behat`: Run behavior-driven tests. - -### Coding Style - -The project follows the `WP_CLI_CS` coding standard, which is enforced by PHP_CodeSniffer. The configuration can be found in `phpcs.xml.dist`. Before submitting any code, please run `composer phpcs` to check for violations and `composer phpcbf` to automatically fix them. - -## Documentation - -The `README.md` file might be generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). In that case, changes need to be made against the corresponding part of the codebase. - -### Inline Documentation - -Only write high-value comments if at all. Avoid talking to the user through comments. - -## Testing - -The project has a comprehensive test suite that includes unit tests, behavior-driven tests, and static analysis. - -* **Unit tests** are written with PHPUnit and can be found in the `tests/` directory. The configuration is in `phpunit.xml.dist`. -* **Behavior-driven tests** are written with Behat and can be found in the `features/` directory. The configuration is in `behat.yml`. -* **Static analysis** is performed with PHPStan. - -All tests are run on GitHub Actions for every pull request. - -When writing tests, aim to follow existing patterns. Key conventions include: - -* When adding tests, first examine existing tests to understand and conform to established conventions. -* For unit tests, extend the base `WP_CLI\Tests\TestCase` test class. -* For Behat tests, only WP-CLI commands installed in `composer.json` can be run. - -### Behat Steps - -WP-CLI makes use of a Behat-based testing framework and provides a set of custom step definitions to write feature tests. - -> **Note:** If you are expecting an error output in a test, you need to use `When I try ...` instead of `When I run ...` . - -#### Given - -* `Given an empty directory` - Creates an empty directory. -* `Given /^an? (empty|non-existent) ([^\s]+) directory$/` - Creates or deletes a specific directory. -* `Given an empty cache` - Clears the WP-CLI cache directory. -* `Given /^an? ([^\s]+) (file|cache file):$/` - Creates a file with the given contents. -* `Given /^"([^"]+)" replaced with "([^"]+)" in the ([^\s]+) file$/` - Search and replace a string in a file using regex. -* `Given /^that HTTP requests to (.*?) will respond with:$/` - Mock HTTP requests to a given URL. -* `Given WP files` - Download WordPress files without installing. -* `Given wp-config.php` - Create a wp-config.php file using `wp config create`. -* `Given a database` - Creates an empty database. -* `Given a WP install(ation)` - Installs WordPress. -* `Given a WP install(ation) in :subdir` - Installs WordPress in a given directory. -* `Given a WP install(ation) with Composer` - Installs WordPress with Composer. -* `Given a WP install(ation) with Composer and a custom vendor directory :vendor_directory` - Installs WordPress with Composer and a custom vendor directory. -* `Given /^a WP multisite (subdirectory|subdomain)?\s?(install|installation)$/` - Installs WordPress Multisite. -* `Given these installed and active plugins:` - Installs and activates one or more plugins. -* `Given a custom wp-content directory` - Configure a custom `wp-content` directory. -* `Given download:` - Download multiple files into the given destinations. -* `Given /^save (STDOUT|STDERR) ([\'].+[^\'])?\s?as \{(\w+)\}$/` - Store STDOUT or STDERR contents in a variable. -* `Given /^a new Phar with (?:the same version|version "([^"]+)")$/` - Build a new WP-CLI Phar file with a given version. -* `Given /^a downloaded Phar with (?:the same version|version "([^"]+)")$/` - Download a specific WP-CLI Phar version from GitHub. -* `Given /^save the (.+) file ([\'].+[^\'])? as \{(\w+)\}$/` - Stores the contents of the given file in a variable. -* `Given a misconfigured WP_CONTENT_DIR constant directory` - Modify wp-config.php to set `WP_CONTENT_DIR` to an empty string. -* `Given a dependency on current wp-cli` - Add `wp-cli/wp-cli` as a Composer dependency. -* `Given a PHP built-in web server` - Start a PHP built-in web server in the current directory. -* `Given a PHP built-in web server to serve :subdir` - Start a PHP built-in web server in the given subdirectory. - -#### When - -* ``When /^I launch in the background `([^`]+)`$/`` - Launch a given command in the background. -* ``When /^I (run|try) `([^`]+)`$/`` - Run or try a given command. -* ``When /^I (run|try) `([^`]+)` from '([^\s]+)'$/`` - Run or try a given command in a subdirectory. -* `When /^I (run|try) the previous command again$/` - Run or try the previous command again. - -#### Then - -* `Then /^the return code should( not)? be (\d+)$/` - Expect a specific exit code of the previous command. -* `Then /^(STDOUT|STDERR) should( strictly)? (be|contain|not contain):$/` - Check the contents of STDOUT or STDERR. -* `Then /^(STDOUT|STDERR) should be a number$/` - Expect STDOUT or STDERR to be a numeric value. -* `Then /^(STDOUT|STDERR) should not be a number$/` - Expect STDOUT or STDERR to not be a numeric value. -* `Then /^STDOUT should be a table containing rows:$/` - Expect STDOUT to be a table containing the given rows. -* `Then /^STDOUT should end with a table containing rows:$/` - Expect STDOUT to end with a table containing the given rows. -* `Then /^STDOUT should be JSON containing:$/` - Expect valid JSON output in STDOUT. -* `Then /^STDOUT should be a JSON array containing:$/` - Expect valid JSON array output in STDOUT. -* `Then /^STDOUT should be CSV containing:$/` - Expect STDOUT to be CSV containing certain values. -* `Then /^STDOUT should be YAML containing:$/` - Expect STDOUT to be YAML containing certain content. -* `Then /^(STDOUT|STDERR) should be empty$/` - Expect STDOUT or STDERR to be empty. -* `Then /^(STDOUT|STDERR) should not be empty$/` - Expect STDOUT or STDERR not to be empty. -* `Then /^(STDOUT|STDERR) should be a version string (<|<=|>|>=|==|=|<>) ([+\w.{}-]+)$/` - Expect STDOUT or STDERR to be a version string comparing to the given version. -* `Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain):$/` - Expect a certain file or directory to (not) exist or (not) contain certain contents. -* `Then /^the contents of the (.+) file should( not)? match (((\/.*\/)|(#.#))([a-z]+)?)$/` - Match file contents against a regex. -* `Then /^(STDOUT|STDERR) should( not)? match (((\/.*\/)|(#.#))([a-z]+)?)$/` - Match STDOUT or STDERR against a regex. -* `Then /^an email should (be sent|not be sent)$/` - Expect an email to be sent (or not). -* `Then the HTTP status code should be :code` - Expect the HTTP status code for visiting `http://localhost:8080`. diff --git a/CNAME b/CNAME index 92366363..07dab832 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -wp-cli.org \ No newline at end of file +wp-cli.org diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 32d24cd4..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (C) 2012-2018 WP-CLI Development Group (https://github.com/wp-cli/wp-cli.github.com/contributors) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Phakefile.php b/Phakefile.php new file mode 100644 index 00000000..41aed39a --- /dev/null +++ b/Phakefile.php @@ -0,0 +1,305 @@ +render( $template, $binding ); +} + +desc( 'Generate a list of commands with all accepted arguments on STDOUT.' ); +task( 'syn-list', function( $app ) { + function generate_synopsis( $command, $path = '' ) { + $full_path = $path . ' ' . $command['name']; + + if ( !isset( $command['subcommands'] ) ) { + echo $full_path . ' ' . $command['synopsis'] . "\n"; + } else { + foreach ( $command['subcommands'] as $subcommand ) { + if ( in_array( $subcommand['name'], array( 'website', 'api-dump' ) ) ) { + continue; + } + generate_synopsis( $subcommand, $full_path ); + } + } + } + + generate_synopsis( invoke_wp_cli( 'wp --skip-packages cli cmd-dump', $app ) ); +}); + +function gen_cmd_pages( $cmd, $parent = array() ) { + $parent[] = $cmd['name']; + + $binding = $cmd; + $binding['synopsis'] = implode( ' ', $parent ); + $binding['path'] = implode( '/', $parent ); + $path = '/commands/'; + $binding['breadcrumbs'] = '[Commands](' . $path . ')'; + foreach( $parent as $i => $p ) { + $path .= $p . '/'; + if ( $i < ( count( $parent ) - 1 ) ) { + $binding['breadcrumbs'] .= " » [{$p}]({$path})"; + } else { + $binding['breadcrumbs'] .= " » {$p}"; + } + } + $binding['has-subcommands'] = isset( $cmd['subcommands'] ) ? array(true) : false; + + if ( $cmd['longdesc'] ) { + $docs = $cmd['longdesc']; + $docs = htmlspecialchars( $docs, ENT_COMPAT, 'UTF-8' ); + + // decrease header level + $docs = preg_replace( '/^## /m', '### ', $docs ); + + // escape `--` so that it doesn't get converted into `—` + $docs = preg_replace( '/^(\[?)--/m', '\1\--', $docs ); + $docs = preg_replace( '/^\s\s--/m', ' \1\--', $docs ); + + // hack to prevent double encoding in code blocks + $docs = preg_replace( '/ < /', ' < ', $docs ); + $docs = preg_replace( '/ > /', ' > ', $docs ); + $docs = preg_replace( '/ <</', ' <<', $docs ); + $docs = preg_replace( '/"/', '"', $docs ); + + // Strip global parameters -> added in footer + $docs = preg_replace( '/#?## GLOBAL PARAMETERS.+/s', '', $docs ); + + $binding['docs'] = $docs; + $binding['github_issues_link'] = 'https://github.com/wp-cli/wp-cli/issues?q=is%3Aopen+label%3A' . urlencode( 'command:' . str_replace( ' ', '-', $binding['synopsis'] ) ) . '+sort%3Aupdated-desc'; + } + + $path = __DIR__ . "/commands/" . $binding['path']; + if ( !is_dir( $path ) ) { + mkdir( $path ); + } + file_put_contents( "$path/index.md", render( 'subcmd-list.mustache', $binding ) ); + + if ( !isset( $cmd['subcommands'] ) ) + return; + + foreach ( $cmd['subcommands'] as $subcmd ) { + gen_cmd_pages( $subcmd, $parent ); + } +} + +desc( 'Update the /commands/ page.' ); +task( 'cmd-list', function( $app ) { + $wp = invoke_wp_cli( 'wp --skip-packages cli cmd-dump', $app ); + + foreach( $wp['subcommands'] as $k => $cmd ) { + if ( in_array( $cmd['name'], array( 'website', 'api-dump' ) ) ) { + unset( $wp['subcommands'][ $k ] ); + } + } + $wp['subcommands'] = array_values( $wp['subcommands'] ); + + // generate main page + file_put_contents( '_includes/cmd-list.html', render( 'cmd-list.mustache', $wp ) ); + + foreach ( $wp['subcommands'] as $cmd ) { + gen_cmd_pages( $cmd ); + } +}); + +desc( 'Update the /config/ page.' ); +task( 'param-list', function( $app ) { + $config_spec = invoke_wp_cli( 'wp cli param-dump', $app ); + + $out = ''; + + $global_args = array(); + foreach ( $config_spec as $key => $details ) { + if ( isset( $details['hidden'] ) || isset( $details['deprecated'] ) ) + continue; + + if ( false !== $details['file'] ) { + $config = "$key: " . $details['file']; + } else { + $config = ''; + } + + if ( false !== $details['runtime'] ) { + $flag = ( true === $details['runtime'] ) + ? "--[no-]$key" + : "--$key" . $details['runtime']; + } else { + $flag = ''; + } + + $default = json_encode( $details['default'] ); + + $description = ( isset( $details['desc'] ) ) ? $details['desc'] : ''; + + $out .= render( 'config.mustache', compact( 'config', 'flag', 'default', 'description' ) ); + if ( ! empty( $flag ) ) { + $global_args[] = array( + 'flag' => $flag, + 'description' => $description, + ); + } + } + + file_put_contents( '_includes/param-list.html', $out ); + file_put_contents( '_includes/global-parameters.html', render( 'global-parameters.mustache', array( 'args' => $global_args ) ) ); +}); + +desc( 'Update the /docs/internal-api/ page.' ); +task( 'internal-api-list', function( $app ) { + $apis = invoke_wp_cli( 'wp api-dump', $app ); + $categories = array( + 'Registration' => array(), + 'Output' => array(), + 'Input' => array(), + 'Execution' => array(), + 'System' => array(), + 'Misc' => array(), + ); + + $prepare_api_slug = function( $full_name ) { + $replacements = array( + '()' => '', + '::' => '-', + '_' => '-', + '\\' => '-', + ); + return strtolower( str_replace( array_keys( $replacements ), array_values( $replacements ), $full_name ) ); + }; + + $prepare_code_block = function( $description ) { + return preg_replace_callback( '#```(.+)```#Us', function( $matches ) { + return str_replace( PHP_EOL, PHP_EOL . ' ', $matches[1] ); + }, $description ); + }; + + foreach( $apis as $api ) { + + $api['api_slug'] = $prepare_api_slug( $api['full_name'] ); + $api['phpdoc']['long_description'] = $prepare_code_block( $api['phpdoc']['long_description'] ); + + if ( ! empty( $api['phpdoc']['parameters']['category'][0][0] ) + && isset( $categories[ $api['phpdoc']['parameters']['category'][0][0] ] ) ) { + $categories[ $api['phpdoc']['parameters']['category'][0][0] ][] = $api; + } else { + $categories['Misc'][] = $api; + } + } + $out = '***' . PHP_EOL . PHP_EOL; + + foreach( $categories as $name => $apis ) { + $out .= '## ' . $name . PHP_EOL . PHP_EOL; + $out .= render( 'internal-api-list.mustache', array( 'apis' => $apis ) ); + foreach( $apis as $i => $api ) { + $api['category'] = $name; + $api['related'] = $apis; + $api['phpdoc']['parameters'] = array_map( function( $parameter ){ + foreach( $parameter as $key => $values ) { + if ( isset( $values[2] ) ) { + $values[2] = str_replace( array( PHP_EOL ), array( '
' ), $values[2] ); + $parameter[ $key ] = $values; + } + } + return $parameter; + }, $api['phpdoc']['parameters'] ); + unset( $api['related'][ $i ] ); + $api['related'] = array_values( $api['related'] ); + $api['has_related'] = ! empty( $api['related'] ); + $api_doc = render( 'internal-api.mustache', $api ); + $path = "docs/internal-api/{$api['api_slug']}"; + if ( ! is_dir( $path ) ) { + mkdir( $path ); + } + file_put_contents( "$path/index.md", $api_doc ); + } + $out .= PHP_EOL . PHP_EOL; + } + + file_put_contents( '_includes/internal-api-list.html', $out ); +}); + +desc( 'Update the /docs/ page.' ); +task( 'doc-list', function( $app ){ + $docs = array( + 'Guides' => array( + 'Installing' => array(), + 'Quick start' => array(), + ), + 'References' => array( + 'Global parameters' => array( + 'path' => '/config/', + 'title' => 'Global parameters', + 'description' => 'Variables defining how a command is executed, including which WordPress user the command is run as and which WordPress instance the command is run against.', + ), + 'Built-in commands' => array( + 'path' => '/commands/', + 'title' => 'Built-in commands', + 'description' => 'Commands included in every copy of WP-CLI.', + ), + 'Package index' => array( + 'path' => '/package-index/', + 'title' => 'Package index', + 'description' => 'Commands maintained and supported by the community.', + ), + 'Internal API' => array(), + ), + 'Contributing' => array(), + 'Misc' => array(), + ); + foreach( glob( __DIR__ . '/docs/*/index.md' ) as $file ) { + $contents = file_get_contents( $file ); + $parts = explode( '---', $contents ); + $header = $parts[1]; + preg_match( '#category:\s(.+)#', $header, $matches ); + if ( ! empty( $matches[1] ) && array_key_exists( $matches[1], $docs ) ) { + $category = $matches[1]; + } else { + $category = 'Misc'; + } + preg_match( '#title:\s(.+)#', $header, $matches ); + $title = ! empty( $matches[1] ) ? $matches[1] : ''; + preg_match( '#description:\s(.+)#', $header, $matches ); + $description = ! empty( $matches[1] ) ? $matches[1] : ''; + if ( ! isset( $docs[ $category ][ $title ] ) ) { + $docs[ $category ][ $title ] = array(); + } + $docs[ $category ][ $title ]['path'] = '/docs/' . basename( dirname( $file ) ) . '/'; + $docs[ $category ][ $title ]['title'] = $title; + $docs[ $category ][ $title ]['description'] = $description; + } + $out = ''; + foreach( $docs as $category => $cat_docs ) { + if ( empty( $cat_docs ) ) { + continue; + } + $cat_slug = strtolower( $category ); + $out .= '

' . $category . '

' . PHP_EOL . PHP_EOL; + $out .= '' . PHP_EOL . PHP_EOL; + } + + file_put_contents( '_includes/doc-list.html', $out ); +}); + +desc( 'Build the site.' ); +task( 'default', 'cmd-list', 'param-list', 'internal-api-list', 'doc-list' ); + diff --git a/README.md b/README.md index 51421adb..3506b5d6 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,15 @@ -These files comprise wp-cli.org*. +These files comprise wp-cli.org*. However, all command documentation is dynamically generated from the PHPDoc for each command. If you'd like to suggest command documentation changes, please submit a pull request against the [primary repo](https://github.com/wp-cli/wp-cli). Command documentation changes are deployed to the website with each release. -All command documentation is dynamically generated from the PHPDoc for each command. If you'd like to suggest command documentation changes, please submit a pull request against the [primary repo](https://github.com/wp-cli/wp-cli). Command documentation changes are deployed to the website with each release. +### Setup -### Regenerate website +1. Install [Composer](http://getcomposer.org/). -The website uses a series of WP-CLI commands to generate its documentation: +2. Install dev dependencies with `composer install --dev` -```bash -NAME - - wp website - -SYNOPSIS - - wp website +3. Build: -SUBCOMMANDS - - generate Run all generation commands to generate full website. - generate-commands Generate the /commands/ page. - generate-config Generate the /config/ page. - generate-contributing Generate the contributing page from WP-CLI's CONTRIBUTING.md - generate-docs Generate the /docs/ page. - generate-homepage Generate the homepage from WP-CLI's README.md - generate-internal-api-docs Generate the /docs/internal-apis/ page. +```bash +vendor/bin/phake ``` ### Preview locally @@ -36,9 +22,7 @@ SUBCOMMANDS ### How to translate -1. Add your language to `[_config.yml](https://github.com/wp-cli/wp-cli.github.com/blob/main/_config.yml)`. +1. Add your language to `[_config.yml](https://github.com/wp-cli/wp-cli.github.com/blob/master/_config.yml)`. 2. Create a folder under the name of your appropriate language code (IETF language tag). e.g. ja or pt_BR -3. Copy the *English* `index.md` into your language's directory. +3. Copy `index.md` into your language's directory. 4. Translate `index.md`. - -Note: Please avoid using a language file other than the English one in the root folder as your source for translating, as it might not be up-to-date. The root `index.md` is considered to be the source of truth and is the only one guaranteed to be current. diff --git a/_config.yml b/_config.yml index 99a9a947..caeb7c8f 100644 --- a/_config.yml +++ b/_config.yml @@ -2,10 +2,8 @@ safe: true lsi: false highlighter: rouge markdown: kramdown -gems: - - jekyll-paginate - - jekyll-redirect-from -url: https://wp-cli.org +gems: [jekyll-paginate] +url: http://wp-cli.org permalink: /blog/:title.html paginate: 10 paginate_path: /blog/page:num @@ -18,15 +16,18 @@ exclude: - README.md navigation: - text: Commands - url: https://developer.wordpress.org/cli/commands/ + url: /commands/ - text: Configuration - url: https://make.wordpress.org/cli/handbook/config/ -- text: Handbook - url: https://make.wordpress.org/cli/handbook/ + url: /config/ +- text: Docs + url: /docs/ - text: Blog - url: https://make.wordpress.org/cli/ -- text: Contributing - url: https://make.wordpress.org/cli/handbook/contributing/ + url: /blog/ + layout: post +- text: Packages + url: /package-index/ +- text: RESTful WP-CLI + url: /restful/ languages: - label: English iso-alpha2: en @@ -34,9 +35,6 @@ languages: - label: Japanese iso-alpha2: ja path: /ja/ -- label: Persian (Farsi) - iso-alpha2: fa - path: /fa/ - label: Français iso-alpha2: fr path: /fr/ @@ -58,12 +56,3 @@ languages: - label: Italiano iso-alpha2: it path: /it/ -- label: Español - iso-alpha2: es - path: /es/ -- label: Română - iso-alpha2: ro - path: /ro/ -- label: 简体中文 - iso-alpha2: zh-cn - path: /zh-cn/ diff --git a/_includes/cmd-list.html b/_includes/cmd-list.html new file mode 100644 index 00000000..28437451 --- /dev/null +++ b/_includes/cmd-list.html @@ -0,0 +1,140 @@ + + cache + Manage the object cache. + + + cap + Manage user capabilities. + + + cli + Get information about WP-CLI itself. + + + comment + Manage comments. + + + core + Download, install, update and otherwise manage WordPress proper. + + + cron + Manage WP-Cron events and schedules. + + + db + Perform basic database operations. + + + eval + Execute arbitrary PHP code. + + + eval-file + Load and execute a PHP file. + + + export + Export content to a WXR file. + + + help + Get help on WP-CLI, or on a specific command. + + + import + Import content from a WXR file. + + + media + Manage attachments. + + + menu + List, create, assign, and delete menus. + + + network + + + + option + Manage options. + + + package + Manage WP-CLI packages. + + + plugin + Manage plugins. + + + post + Manage posts. + + + post-type + Manage post types. + + + rewrite + Manage rewrite rules. + + + role + Manage user roles. + + + scaffold + Generate code for post types, taxonomies, etc. + + + search-replace + Search/replace strings in the database. + + + server + Launch PHP's built-in web server for this specific WordPress installation. + + + shell + Interactive PHP console. + + + sidebar + Manage sidebars. + + + site + Perform site-wide operations. + + + super-admin + List, add, and remove super admins from a network. + + + taxonomy + Manage taxonomies. + + + term + Manage terms. + + + theme + Manage themes. + + + transient + Manage transients. + + + user + Manage users. + + + widget + Manage sidebar widgets. + diff --git a/_includes/doc-list.html b/_includes/doc-list.html new file mode 100644 index 00000000..ed7baf8d --- /dev/null +++ b/_includes/doc-list.html @@ -0,0 +1,41 @@ +

Guides

+ + + +

References

+ + + +

Contributing

+ + + +

Misc

+ + + diff --git a/_includes/footer.html b/_includes/footer.html index d643c363..e88827a9 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -5,7 +5,7 @@ {% include global-parameters.html %} {% endif %} - + {% include analytics.html %} diff --git a/_includes/global-parameters.html b/_includes/global-parameters.html index a66200ff..4c60579f 100644 --- a/_includes/global-parameters.html +++ b/_includes/global-parameters.html @@ -24,8 +24,8 @@

Global Parameters

Whether to colorize the output.

--debug[=<group>] Show all PHP errors; add verbosity to WP-CLI bootstrap.

-

--prompt[=<assoc>] - Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values.

+

--prompt + Prompt the user to enter values for all command arguments.

--quiet Suppress informational messages.

diff --git a/_includes/header.html b/_includes/header.html index cc3a7b51..afccd0ee 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,15 +1,15 @@ {% assign hreflang = 'en' %}{% for lang in site.languages %}{% if lang.path == page.url %}{% assign hreflang = lang.iso-alpha2 %}{% endif %}{% endfor %} - + - + - - + + {{ page.title }} | WP-CLI @@ -17,17 +17,22 @@ {% for lang in site.languages %} {% endfor %} - + + {% if page.display_global_parameters %} - {% elsif page.direction == 'rtl' %} - {% else %} {% endif %}
-

WP-CLI The command line interface for WordPress

+

WP-CLI

+ {% capture page_url %}{{ page.url | remove:'index.html' }}{% endcapture %} + {% if page_url == '/restful/' %} +

A RESTful command line interface for WordPress

+ {% else %} +

A command line interface for WordPress

+ {% endif %} {% include navigation.html %} {% include languages.html %} diff --git a/_includes/internal-api-list.html b/_includes/internal-api-list.html new file mode 100644 index 00000000..10a661d6 --- /dev/null +++ b/_includes/internal-api-list.html @@ -0,0 +1,134 @@ +*** + +## Registration + + + + +## Output + + + + +## Input + + + + +## Execution + +
    + + +
  • WP_CLI::launch() - Launch an arbitrary external process that takes over I/O.
  • + + +
  • WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments.
  • + + +
  • WP_CLI::run_command() - Run a given command within the current process using the same global
  • + + +
+ + +## System + + + + +## Misc + + + + diff --git a/_includes/languages.html b/_includes/languages.html index 487fc9df..2c44f118 100644 --- a/_includes/languages.html +++ b/_includes/languages.html @@ -10,7 +10,7 @@ 'use strict'; var langs = document.getElementById( 'languages' ); - // Only apply this after we set the Selected option. + // Only apply this after we set the Selected option langs.onchange = function( ev ) { if ( ev.currentTarget && ev.currentTarget.value ) { location.href = ev.currentTarget.value; @@ -25,7 +25,7 @@ count = opts.length; for ( var i = 0; i < count; i++ ){ - // Only happens if you have language path on the start of the location.pathname. + // Only happens if you have language path on the start of the location.pathname if ( 0 === window.location.pathname.indexOf( opts[ i ].value ) ) { opts[ i ].setAttribute( 'selected', 'selected' ); } diff --git a/_includes/param-list.html b/_includes/param-list.html index 856c941b..6d3fe8f6 100644 --- a/_includes/param-list.html +++ b/_includes/param-list.html @@ -156,12 +156,12 @@ - Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. + Prompt the user to enter values for all command arguments.
Default value: false - --prompt[=<assoc>] + --prompt Not available as an option diff --git a/_layouts/doc.html b/_layouts/doc.html new file mode 100644 index 00000000..cf381e81 --- /dev/null +++ b/_layouts/doc.html @@ -0,0 +1,24 @@ +{% include header.html %} + +{% capture page_url %}{{ page.url | remove:'index.html' }}{% endcapture %} + +Edit + +{% if page_url != '/docs/' %} +Docs » {{ page.category }} +{% endif %} + +

{{ page.title }}

+ +{% if page.quick_links %} +

Quick links: + {% for quick_link in page.quick_links %} + {% capture link %}{{ quick_link | slugify }}{% endcapture %} + {{quick_link}} {% if forloop.last == false %}|{% endif %} + {% endfor %} +

+{% endif %} + +{{ content }} + +{% include footer.html %} diff --git a/_posts/2012-11-05-new-home.md b/_posts/2012-11-05-new-home.md index 6db9b4e1..c617d93d 100644 --- a/_posts/2012-11-05-new-home.md +++ b/_posts/2012-11-05-new-home.md @@ -8,4 +8,4 @@ Welcome to the new website for the WP-CLI project! wp-cli already has a public [code repository](https://github.com/wp-cli/wp-cli), an [issue tracker](https://github.com/wp-cli/wp-cli/issues) and a [wiki](https://github.com/wp-cli/wp-cli/wiki). The only thing that was missing was a blog for publishing release notes and other news. -Since GitHub has built-in support for [Jekyll](https://github.com/mojombo/jekyll/wiki), I decided to use that. The code for this website is also public: [github.com/wp-cli/wp-cli.github.com](https://github.com/wp-cli/wp-cli.github.com) +Since github has built-in support for [Jekyll](https://github.com/mojombo/jekyll/wiki), I decided to use that. The code for this website is also public: [github.com/wp-cli/wp-cli.github.com](https://github.com/wp-cli/wp-cli.github.com) diff --git a/_posts/2012-11-10-wp-shell.md b/_posts/2012-11-10-wp-shell.md index 4a380785..cb478d35 100644 --- a/_posts/2012-11-10-wp-shell.md +++ b/_posts/2012-11-10-wp-shell.md @@ -21,4 +21,4 @@ Here's a contrived example session: wp> exit scribu@air:~/wp/core$ -`wp shell` will be available in the 0.7 release of WP-CLI, but if you want to try it out right now, clone the [latest version](https://github.com/wp-cli/wp-cli) from GitHub. If you have suggestions for making it better, don't hesitate to open issues and pull requests. +`wp shell` will be available in the 0.7 release of WP-CLI, but if you want to try it out right now, clone the [latest version](https://github.com/wp-cli/wp-cli) from github. If you have suggestions for making it better, don't hesitate to open issues and pull requests. diff --git a/_posts/2013-03-29-scaffolding-custom-post-types-and-taxonomies.md b/_posts/2013-03-29-scaffolding-custom-post-types-and-taxonomies.md index 62666a5c..2ad0bf25 100644 --- a/_posts/2013-03-29-scaffolding-custom-post-types-and-taxonomies.md +++ b/_posts/2013-03-29-scaffolding-custom-post-types-and-taxonomies.md @@ -20,7 +20,7 @@ wp scaffold post-type zombie The following command generates the code for registering the taxonomy to the zombie post type: ~~~bash -wp scaffold taxonomy zombie-speed --post_types=zombie +wp scaffold taxonomy zombie-speed --post-type=zombie ~~~ ### But I only want the registration of the post-type... diff --git a/_posts/2013-06-15-version-0.10.1.md b/_posts/2013-06-15-version-0.10.1.md index ef0f4e46..121168f2 100644 --- a/_posts/2013-06-15-version-0.10.1.md +++ b/_posts/2013-06-15-version-0.10.1.md @@ -17,4 +17,4 @@ Internals: * show warning if a URL redirect is attempted while using WP-CLI -You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=11&state=closed) on GitHub. +You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=11&state=closed) on Github. diff --git a/_posts/2013-06-26-version-0.10.2.md b/_posts/2013-06-26-version-0.10.2.md index 28a59aec..207b3378 100644 --- a/_posts/2013-06-26-version-0.10.2.md +++ b/_posts/2013-06-26-version-0.10.2.md @@ -16,4 +16,4 @@ Internals: * fix required version for php-cli-tools package -You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=12&state=closed) on GitHub. +You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=12&state=closed) on Github. diff --git a/_posts/2013-08-05-version-0.11.md b/_posts/2013-08-05-version-0.11.md index 9356b9e2..3499643a 100644 --- a/_posts/2013-08-05-version-0.11.md +++ b/_posts/2013-08-05-version-0.11.md @@ -51,6 +51,6 @@ Internals: * support passing `--require=` multiple times * deprecated `WP_CLI::add_man_dir()` -You can also browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=10&state=closed) on GitHub. +You can also browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=10&state=closed) on Github. Contributors to this release: [dangardner](https://github.com/dangardner), [danielbachhuber](https://github.com/danielbachhuber), [eugeneware](https://github.com/eugeneware), [jmslbam](https://github.com/jmslbam), [johnbillion](https://github.com/johnbillion), [MiteshShah](https://github.com/MiteshShah), [om4james](https://github.com/om4james), [scribu](https://github.com/scribu), [twratajczak](https://github.com/twratajczak), [Veered](https://github.com/Veered). diff --git a/_posts/2013-08-08-version-0.11.1.md b/_posts/2013-08-08-version-0.11.1.md index fd6d60bb..a85f8253 100644 --- a/_posts/2013-08-08-version-0.11.1.md +++ b/_posts/2013-08-08-version-0.11.1.md @@ -20,6 +20,6 @@ Internals: * fixed synopsis parser bug where arguments with vertical bars would be ignored * added support for `WP_CLI_PHP_ARGS` environment variable -You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=15&state=closed) on GitHub. +You can also browse the list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=15&state=closed) on Github. Contributors to this release: [c10b10](https://github.com/c10b10), [jmslbam](https://github.com/jmslbam), [scribu](https://github.com/scribu). diff --git a/_posts/2013-10-04-version-0.12.md b/_posts/2013-10-04-version-0.12.md index af9d9043..bd5f180b 100644 --- a/_posts/2013-10-04-version-0.12.md +++ b/_posts/2013-10-04-version-0.12.md @@ -33,7 +33,7 @@ This nifty little parameter changes the behaviour of commands when required argu ### Phar archives are back -They were originally introduced in [version 0.9](https://wp-cli.org/blog/version-0.9.html) and... ahem, naively abandoned in the next release with the introduction of the installer script. +They were originally introduced in [version 0.9](http://wp-cli.org/blog/version-0.9.html) and... ahem, naively abandoned in the next release with the introduction of the installer script. The installer uses Composer, which has its own environmental requirements, but, more importantly, it has to fetch all of the packages WP-CLI depends on, which is both less reliable and slower than downloading a single file that contains everything. @@ -60,7 +60,7 @@ So, phar archives can be downloaded from the [wp-cli/builds](https://github.com/ * `wp plugin is-installed` and `wp theme is-installed` * `wp user add-cap`, `wp user remove-cap` and `wp user list-caps` -You can browse the full list of [resolved issues](https://github.com/WP-CLI/WP-CLI/issues?milestone=14&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/WP-CLI/WP-CLI/issues?milestone=14&state=closed) on Github. [1]: https://github.com/wp-cli/wp-cli/issues/792#issuecomment-25376430 [2]: https://github.com/wp-cli/wp-cli/pull/786 diff --git a/_posts/2013-10-11-version-0.12.1.md b/_posts/2013-10-11-version-0.12.1.md index 2c15fc59..e78eff00 100644 --- a/_posts/2013-10-11-version-0.12.1.md +++ b/_posts/2013-10-11-version-0.12.1.md @@ -11,6 +11,6 @@ Hot on the heels of the [0.12 release](/blog/version-0.12.html) comes a minor re * made the `--post__in=` parameter in `wp post list` work * added `--match=` argument for `wp rewrite list` + other improvements -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=18&page=1&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=18&page=1&state=closed) on Github. Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber), [mattes](https://github.com/mattes), [scribu](https://github.com/scribu) diff --git a/_posts/2013-10-24-how-wp-cli-loads-wordpress.md b/_posts/2013-10-24-how-wp-cli-loads-wordpress.md index 21ab3374..bd8ee44a 100644 --- a/_posts/2013-10-24-how-wp-cli-loads-wordpress.md +++ b/_posts/2013-10-24-how-wp-cli-loads-wordpress.md @@ -15,7 +15,7 @@ She figures that if she manages to load the WP environment from a CLI script, th Shelly is pleased; her script even works on multisite installs. Both the host name and the path to the WordPress install are hardcoded, but she can figure ways around that later. -With her geeky curiosity satisfied, she lazily types in a Google search, to check if anyone else has solved this problem. The first result is a project called WP-CLI. She installs it and tries out a few commands - it seems to work pretty well. +With her geeky curiosity satisfied, she lazily types in a google search, to check if anyone else has solved this problem. The first result is a project called WP-CLI. She installs it and tries out a few commands - it seems to work pretty well. She then goes to the WP-CLI source and searches for 'wp-load.php', to see how it handles the WordPress bootstrapping - 0 results. Puzzled, she starts going through the first file that gets executed and eventually reaches one called `wp-setting-cli.php`. This strikes Shelly as peculiar, since she encountered a similar file in WordPress Core. She signs into the project's IRC channel. diff --git a/_posts/2013-11-30-version-0.13.md b/_posts/2013-11-30-version-0.13.md index 1a46306f..332f2390 100644 --- a/_posts/2013-11-30-version-0.13.md +++ b/_posts/2013-11-30-version-0.13.md @@ -32,7 +32,7 @@ We have simplified the process of [setting up and running plugin tests](https:// It fetches the test library from the new `develop.svn.wordpress.org` repository. -Also, the Travis build no longer depends on the GitHub mirror of WordPress. +Also, the Travis build no longer depends on the Github mirror of WordPress. ### Improved downloads @@ -72,6 +72,6 @@ Misc: * removed `wp core init-tests` command ([context](https://github.com/wp-cli/wp-cli/pull/885)) * renamed `WP_CLI::add_action()` to `WP_CLI::add_hook()` ([context](https://github.com/wp-cli/wp-cli/pull/845)) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=19&page=1&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=19&page=1&state=closed) on Github. Contributors to this release: [BoiteAWeb](https://github.com/BoiteAWeb), [ctayloroomphinc](https://github.com/ctayloroomphinc), [danielbachhuber](https://github.com/danielbachhuber), [dd32](https://github.com/dd32), [francescolaffi](https://github.com/francescolaffi), [jonathanbardo](https://github.com/jonathanbardo), [Kevinlearynet](https://github.com/Kevinlearynet), [leewillis77](https://github.com/leewillis77), [nickdaugherty](https://github.com/nickdaugherty), [QWp6t](https://github.com/QWp6t), [rodrigoprimo](https://github.com/rodrigoprimo), [ryanduff](https://github.com/ryanduff), [scribu](https://github.com/scribu), [simonwheatley](https://github.com/simonwheatley), [tiagohillebrandt](https://github.com/tiagohillebrandt), [tlovett1](https://github.com/tlovett1), [wojsmol](https://github.com/wojsmol). diff --git a/_posts/2014-02-06-version-0.14.md b/_posts/2014-02-06-version-0.14.md index c3d1ae32..1005954b 100644 --- a/_posts/2014-02-06-version-0.14.md +++ b/_posts/2014-02-06-version-0.14.md @@ -16,7 +16,7 @@ To make this not-common-enough scenario work, we had to once again call upon the ### Protection against running as root -If you try to run a WP-CLI command as the superuser, WP-CLI will refuse to run. In production environments, most of the commands should actually be run under the same user as the web server. But, in general, running commands as root is a bad idea. +If you try to run a WP-CLI command as the superuser, WP-CLI will refuse to run. In production environemnts, most of the commands should actually be run under the same user as the web server. But, in general, running commands as root is a bad idea. For example, if you run `wp media regenerate` as `root`, then the newly created thumbnail files will naturally be owned by `root`. If the web server is running under the `www-data` user, it won't be able to change these files (unless they're globally writable, which is less secure). So, the correct command would be `sudo -u www-data wp media regenerate`. @@ -60,7 +60,7 @@ You can also skip only particular plugins: `wp --skip-plugins=admin-blocker,comp * fixed issue with progress bar calling `tput` too often * execution is now aborted if too many positional parameters are passed or if an unknown associative parameter is passed -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=20&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=20&state=closed) on Github.
diff --git a/_posts/2014-04-15-version-0.15.md b/_posts/2014-04-15-version-0.15.md index 220146a3..4fa24565 100644 --- a/_posts/2014-04-15-version-0.15.md +++ b/_posts/2014-04-15-version-0.15.md @@ -50,7 +50,7 @@ Note that after updating `wp-cli.phar`, you will also have to update the [wp-com * `wp post create`: fixed handling of `--post_category=` parameter * `wp eval-file`: allow passing arbitrary arguments to the file -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=21&page=1&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=21&page=1&state=closed) on Github. Contributors to this release: [clemens-tolboom](https://github.com/clemens-tolboom), [danielbachhuber](https://github.com/danielbachhuber), [francescolaffi](https://github.com/francescolaffi), [itsananderson](https://github.com/itsananderson), [johnpbloch](https://github.com/johnpbloch), [mattheu](https://github.com/mattheu), [nyordanov](https://github.com/nyordanov), [Rarst](https://github.com/Rarst), [robertboloc](https://github.com/robertboloc), [rodrigoprimo](https://github.com/rodrigoprimo), [sboisvert](https://github.com/sboisvert), [scribu](https://github.com/scribu), [szepeviktor](https://github.com/szepeviktor), [trepmal](https://github.com/trepmal). diff --git a/_posts/2014-04-29-survey-results.md b/_posts/2014-04-29-survey-results.md index 9bb793c8..6a897566 100644 --- a/_posts/2014-04-29-survey-results.md +++ b/_posts/2014-04-29-survey-results.md @@ -16,20 +16,20 @@ Many thanks to the 56 people who took our first user survey. We appreciate your Even with its variety of commands, WP-CLI is largely used to install and update. 37.5% of respondents reported using WP-CLI to install WordPress (with 30.36% using it to update WordPress), and 32.14% reported using it to update plugins and themes. -After code management, WP-CLI is popularly used (23.21%) to perform migrations. Respondents reported using [`wp db export`](https://wp-cli.org/commands/db/export/) and [`wp db import`](https://wp-cli.org/commands/db/import/) in conjunction with [`wp search-replace`](https://wp-cli.org/commands/search-replace/), or [`wp export`](https://wp-cli.org/commands/export/) and [`wp import`](https://wp-cli.org/commands/import/). +After code management, WP-CLI is popularly used (23.21%) to perform migrations. Respondents reported using [`wp db export`](http://wp-cli.org/commands/db/export/) and [`wp db import`](http://wp-cli.org/commands/db/import/) in conjunction with [`wp search-replace`](http://wp-cli.org/commands/search-replace/), or [`wp export`](http://wp-cli.org/commands/export/) and [`wp import`](http://wp-cli.org/commands/import/). A subset of respondents reported using WP-CLI to perform specialized tasks, including: -* Creating users with [`wp user create`](https://wp-cli.org/commands/user/create/) and [`wp user import-csv`](https://wp-cli.org/commands/user/import-csv/). -* [Deleting options](https://wp-cli.org/commands/option/delete/). -* [Resizing images](https://wp-cli.org/commands/media/regenerate/). -* [Creating posts / pages](https://wp-cli.org/commands/post/create/). -* Quick code execution via [`wp eval`](https://wp-cli.org/commands/eval/), [`wp eval-file`](https://wp-cli.org/commands/eval-file/), and [`wp shell`](https://wp-cli.org/commands/shell/). +* Creating users with [`wp user create`](http://wp-cli.org/commands/user/create/) and [`wp user import-csv`](http://wp-cli.org/commands/user/import-csv/). +* [Deleting options](http://wp-cli.org/commands/option/delete/). +* [Resizing images](http://wp-cli.org/commands/media/regenerate/). +* [Creating posts / pages](http://wp-cli.org/commands/post/create/). +* Quick code execution via [`wp eval`](http://wp-cli.org/commands/eval/), [`wp eval-file`](http://wp-cli.org/commands/eval-file/), and [`wp shell`](http://wp-cli.org/commands/shell/). * [Writing custom commands](https://github.com/wp-cli/wp-cli/wiki/Commands-Cookbook). **Only 38% have used community packages** -WP-CLI now has 24 community packages listed in its [Package Index](https://wp-cli.org/package-index/). A good 62% percent of respondents will have the good fortune in the future to discover a helpful community package. +WP-CLI now has 24 community packages listed in its [Package Index](http://wp-cli.org/package-index/). A good 62% percent of respondents will have the good fortune in the future to discover a helpful community package. ### Feature requests diff --git a/_posts/2014-05-14-version-0.15.1.md b/_posts/2014-05-14-version-0.15.1.md index d31cdd2f..f1347a49 100644 --- a/_posts/2014-05-14-version-0.15.1.md +++ b/_posts/2014-05-14-version-0.15.1.md @@ -15,6 +15,6 @@ The longer 0.15 soaked, the more bug fixes it saw. It's finally time to get them * use WordPress' `_n()` instead of `ngettext()` * fix segmentation fault in PHP 5.5.11/12 (and probably other 5.5.x versions) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=24&page=1&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=24&page=1&state=closed) on Github. Contributors to this release: [boonebgorges](https://github.com/boonebgorges), [danielbachhuber](https://github.com/danielbachhuber), [jmslbam](https://github.com/jmslbam), [mboynes](https://github.com/mboynes), [szepeviktor](https://github.com/szepeviktor), [westonruter](https://github.com/westonruter) diff --git a/_posts/2014-06-30-version-0.16.md b/_posts/2014-06-30-version-0.16.md index 7f714ce7..fdc0598b 100644 --- a/_posts/2014-06-30-version-0.16.md +++ b/_posts/2014-06-30-version-0.16.md @@ -61,7 +61,7 @@ If any core files have been modified, you'll see something like this: ### A new look -[WP-CLI.org](https://wp-cli.org) received a much-appreciated fresh coat of paint. [Share the love on Twitter](https://twitter.com/intent/tweet?text=Love%20the%20fresh%20coat%20of%20paint%2C%20%40wpcli%21%20Check%20it%20out%3A%20http%3A%2F%2Fwp-cli.org) (or report any bugs in the [issue tracker](https://github.com/wp-cli/wp-cli/issues/new)). +[WP-CLI.org](http://wp-cli.org) received a much-appreciated fresh coat of paint. [Share the love on Twitter](https://twitter.com/intent/tweet?text=Love%20the%20fresh%20coat%20of%20paint%2C%20%40wpcli%21%20Check%20it%20out%3A%20http%3A%2F%2Fwp-cli.org) (or report any bugs in the [issue tracker](https://github.com/wp-cli/wp-cli/issues/new)). ### Other changes @@ -83,6 +83,6 @@ Fixes: * Autocompletion file works properly for both bash and ZSH * `wp core update`: can update directly from a ZIP file -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=23&page=1&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=23&page=1&state=closed) on Github. Contributors to this release: [boonebgorges](https://github.com/boonebgorges), [danielbachhuber](https://github.com/danielbachhuber), [jmslbam](https://github.com/jmslbam), [johnbillion](https://github.com/johnbillion), [joshlevinson](https://github.com/joshlevinson), [mboynes](https://github.com/mboynes), [rodrigoprimo](https://github.com/rodrigoprimo), [ryanduff](https://github.com/ryanduff), [scribu](https://github.com/scribu), [szepeviktor](https://github.com/szepeviktor), [westonruter](https://github.com/westonruter) diff --git a/_posts/2014-09-11-version-0.17.md b/_posts/2014-09-11-version-0.17.md index 9a515d8e..c94e3214 100644 --- a/_posts/2014-09-11-version-0.17.md +++ b/_posts/2014-09-11-version-0.17.md @@ -105,6 +105,6 @@ Fixes: * GUIDs are escaped as URLs for `wp export`. * Thanks to improvements in php-cli-tools, long strings in tables will be wrapped, instead of breaking output. See in action with `wp theme get twentyfourteen`. -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.17.0+is%3Aclosed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.17.0+is%3Aclosed) on Github. Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber), [dlh01](https://github.com/dlh01), [jeichorn](https://github.com/jeichorn), [johnbillion](https://github.com/johnbillion), [lkwdwrd](https://github.com/lkwdwrd), [mattheu](https://github.com/mattheu), [nschoenholtz](https://github.com/nschoenholtz), [phh](https://github.com/phh), [rodrigoprimo](https://github.com/rodrigoprimo), [santagada](https://github.com/santagada), [scribu](https://github.com/scribu), [szepeviktor](https://github.com/szepeviktor), [tddewey](https://github.com/tddewey), [tollmanz](https://github.com/tollmanz), [trepmal](https://github.com/trepmal), [willmot](https://github.com/willmot). diff --git a/_posts/2014-11-18-version-0.17.1.md b/_posts/2014-11-18-version-0.17.1.md index 9da1aa59..a4d0da4a 100644 --- a/_posts/2014-11-18-version-0.17.1.md +++ b/_posts/2014-11-18-version-0.17.1.md @@ -17,6 +17,6 @@ Consider yourself lucky there were less bugs in 0.17 than sugar ants in our kitc * Adds error handling to `Core_Command::_read()`, for when WordPress.org returns bad responses. * php-cli-tools v0.10.2: Fixes supplying empty array to `cli\Table`, and incorrect lengths for colorized strings in `cli\Table` -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=27&page=1&state=closed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=27&page=1&state=closed) on Github. Contributors to this release: [borekb](https://github.com/borekb), [danielbachhuber](https://github.com/danielbachhuber), [szepeviktor](https://github.com/szepeviktor), [wturrell](https://github.com/wturrell) diff --git a/_posts/2015-06-20-version-0.19.2.md b/_posts/2015-06-20-version-0.19.2.md index 62ee0222..d9b3134b 100644 --- a/_posts/2015-06-20-version-0.19.2.md +++ b/_posts/2015-06-20-version-0.19.2.md @@ -4,7 +4,7 @@ author: danielbachhuber title: Version 0.19.2 released --- -Embarrassingly, [WP-CLI v0.19.1](https://wp-cli.org/blog/version-0.19.1.html) introduced another bug related to scaffolding plugin tests. More embarrassingly, it took me a full month to get around to fixing it. My apologies if you were bit by it. +Embarrassingly, [WP-CLI v0.19.1](http://wp-cli.org/blog/version-0.19.1.html) introduced another bug related to scaffolding plugin tests. More embarrassingly, it took me a full month to get around to fixing it. My apologies if you were bit by it. You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?milestone=31&page=1&state=closed) on Github. diff --git a/_posts/2015-08-26-version-0.20.0.md b/_posts/2015-08-26-version-0.20.0.md index ca759760..3e6285b4 100644 --- a/_posts/2015-08-26-version-0.20.0.md +++ b/_posts/2015-08-26-version-0.20.0.md @@ -36,7 +36,7 @@ Use `wp core verify-checksums` to make sure a given WordPress install has the co ### WP-API CLI -We [released v0.19.0](https://wp-cli.org/blog/version-0.19.0.html) with this statement: +We [released v0.19.0](http://wp-cli.org/blog/version-0.19.0.html) with this statement: > WP-API is days away from 2.0-beta1, and brings with it a powerful new interface to WordPress. In the near future, we’ll start exploring how WP-CLI can use WP-API internally. If all goes well, WP-CLI could see just one more 0.x.0 release before the big 1.0.0. @@ -48,7 +48,7 @@ There were a couple issues opened for "how do I do X?", which you might find hel # List plugins on each site in a network wp site list --field=url | xargs -n 1 -I % wp plugin list --url=% - + # Delete inactive plugins wp plugin delete $(wp plugin list --status=inactive --field=name) diff --git a/_posts/2015-10-14-version-0.20.2.md b/_posts/2015-10-14-version-0.20.2.md index 0ea6b0be..ead5ff9a 100644 --- a/_posts/2015-10-14-version-0.20.2.md +++ b/_posts/2015-10-14-version-0.20.2.md @@ -8,6 +8,6 @@ Since the beginning, `install-wp-tests.sh` (the setup script for plugin unit tes We've updated `install-wp-tests.sh` provided by WP-CLI to use an appropriately-tagged version of the WordPress testing framework. However, because `install-wp-tests.sh` is added to a plugin during the scaffolding process, plugin authors will need to update the plugin copy of the script to fix failing tests. We weren't able to get to the entire internet, but here are some plugins that have already been updated: [pantheon-systems/wp-native-php-sessions](https://github.com/pantheon-systems/wp-native-php-sessions/pull/20), [washingtonstateuniversity/WSUWP-Plugin-Color-Palette](https://github.com/washingtonstateuniversity/WSUWP-Plugin-Color-Palette/pull/5), [ethymos/delibera](https://github.com/ethymos/delibera/pull/45) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aclosed+milestone%3A0.20.2) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aclosed+milestone%3A0.20.2) on Github. Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber), [torounit](https://github.com/torounit) diff --git a/_posts/2015-10-30-version-0.20.3.md b/_posts/2015-10-30-version-0.20.3.md index c568503c..e7d3c987 100644 --- a/_posts/2015-10-30-version-0.20.3.md +++ b/_posts/2015-10-30-version-0.20.3.md @@ -4,12 +4,12 @@ author: danielbachhuber title: Version 0.20.3 released --- -WordPress 4.4 loads a few new files in `wp-settings.php` relating to oEmbed and the REST API. Because WP-CLI has a custom `wp-settings-cli.php` ([background](https://wp-cli.org/blog/how-wp-cli-loads-wordpress.html)), WP-CLI v0.20.3 is a compatibility release to load these new files. +WordPress 4.4 loads a few new files in `wp-settings.php` relating to oEmbed and the REST API. Because WP-CLI has a custom `wp-settings-cli.php` ([background](http://wp-cli.org/blog/how-wp-cli-loads-wordpress.html)), WP-CLI v0.20.3 is a compatibility release to load these new files. **Importantly, due to the nature of these changes, WP-CLI versions prior to 0.20.3 will be incompatible with WordPress 4.4.** -Stay tuned next week for WP-CLI v0.21.0 (which is also compatible with WordPress 4.4), the results of the [user survey](https://wp-cli.org/blog/user-survey-2015.html), and a special announcement. +Stay tuned next week for WP-CLI v0.21.0 (which is also compatible with WordPress 4.4), the results of the [user survey](http://wp-cli.org/blog/user-survey-2015.html), and a special announcement. -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aclosed+milestone%3A0.20.2) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aclosed+milestone%3A0.20.2) on Github. Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber), [kraftbj](https://github.com/kraftbj), [rmccue](https://github.com/rmccue) diff --git a/_posts/2015-11-04-version-0.21.0.md b/_posts/2015-11-04-version-0.21.0.md index 342b1195..f8e2e3ab 100644 --- a/_posts/2015-11-04-version-0.21.0.md +++ b/_posts/2015-11-04-version-0.21.0.md @@ -11,7 +11,7 @@ As many of you are aware of, I launched a Kickstarter campaign Monday night: [A But, I have an even more **important note** about supported WordPress versions: * WP-CLI v0.22.0 (the next release) will bump the minimum supported WordPress version from 3.5 to 3.7 ([background](https://github.com/wp-cli/wp-cli/issues/2134)). -* WP-CLI versions prior to 0.20.3 will be incompatible with WordPress 4.4 ([background](https://wp-cli.org/blog/version-0.20.3.html)). +* WP-CLI versions prior to 0.20.3 will be incompatible with WordPress 4.4 ([background](http://wp-cli.org/blog/version-0.20.3.html)). This important note may apply to you in some way -- please take action accordingly. @@ -24,7 +24,7 @@ For a while now, you've been able to run a WP-CLI command before WordPress loads See how `wp eval` makes use of `WP_CLI::get_runner()->load_wordpress()`: class Eval_Command extends WP_CLI_Command { - + /** * Execute arbitrary PHP code. * @@ -84,7 +84,7 @@ Make your own commands more helpful by including `WP_CLI::debug( $debug_message Enhancements: * Use `wp core update-db --network` to upgrade databases across an entire network; also improves verbosity for this command by providing the `from` and `to` database versions. -* Adds a `wp comment recount` command for recalculating a post's comment count. +* Adds a `wp comment recount` command for recalcuating a post's comment count. * Includes `wp taxonomy list`, `wp taxonomy get`, `wp post-type list` and `wp post-type get` for getting details about registered taxonomies and post types. * Use `--defer-term-counting` with `wp post update` or `wp post delete` to recalculate term count at the end of the operation for increased performance. * Returns a more useful error message when running `wp scaffold plugin-tests` with an invalid plugin slug. diff --git a/_posts/2015-11-23-versions-0.21.1-and-0.20.4.md b/_posts/2015-11-23-versions-0.21.1-and-0.20.4.md index 0be51db5..d4f3a492 100644 --- a/_posts/2015-11-23-versions-0.21.1-and-0.20.4.md +++ b/_posts/2015-11-23-versions-0.21.1-and-0.20.4.md @@ -4,7 +4,7 @@ author: danielbachhuber title: Versions 0.21.1 and 0.20.4 released --- -WordPress 4.4 loads a few new files even more files in `wp-settings.php`. Because WP-CLI has a custom `wp-settings-cli.php` ([background](https://wp-cli.org/blog/how-wp-cli-loads-wordpress.html)), WP-CLI v0.21.1 and v0.20.4 are compatibility releases to load these new files. +WordPress 4.4 loads a few new files even more files in `wp-settings.php`. Because WP-CLI has a custom `wp-settings-cli.php` ([background](http://wp-cli.org/blog/how-wp-cli-loads-wordpress.html)), WP-CLI v0.21.1 and v0.20.4 are compatibility releases to load these new files. **Importantly, due to the nature of these changes, WP-CLI versions prior to 0.20.4 will be incompatible with WordPress 4.4.** diff --git a/_posts/2015-12-01-survey-results-2015.md b/_posts/2015-12-01-survey-results-2015.md index 4d8b639f..78400f1c 100644 --- a/_posts/2015-12-01-survey-results-2015.md +++ b/_posts/2015-12-01-survey-results-2015.md @@ -4,9 +4,9 @@ author: danielbachhuber title: What the survey said, 2015 edition --- -Many thanks to the 206 (!!!) people who took our [second user survey](https://wp-cli.org/blog/user-survey-2015.html). We appreciate your time in helping us to understand how WP-CLI is being adopted by the community. +Many thanks to the 206 (!!!) people who took our [second user survey](http://wp-cli.org/blog/user-survey-2015.html). We appreciate your time in helping us to understand how WP-CLI is being adopted by the community. -Curious as to how the numbers have changed? Take a look at the [summary of the first user survey](https://wp-cli.org/blog/survey-results.html) from April 2014. +Curious as to how the numbers have changed? Take a look at the [summary of the first user survey](http://wp-cli.org/blog/survey-results.html) from April 2014. ### By the numbers @@ -65,6 +65,6 @@ Feel like contributing to WP-CLI over the holidays? Here's a grab bag of enhance * Add option to exclude specific tables in `wp search-replace`. * Provide a way to log in with a one-time link. -If you can't find an [existing GitHub issue](https://github.com/wp-cli/wp-cli/issues), please create one and we can begin discussing implementation. +If you can't find an [existing Github issue](https://github.com/wp-cli/wp-cli/issues), please create one and we can begin discussing implementation. Thanks again to everyone who took the time to complete our user survey! May WP-CLI continue to be a shining light for your WordPress development needs. diff --git a/_posts/2016-01-07-version-0.22.0.md b/_posts/2016-01-07-version-0.22.0.md index 1f913b24..f707d89e 100644 --- a/_posts/2016-01-07-version-0.22.0.md +++ b/_posts/2016-01-07-version-0.22.0.md @@ -100,4 +100,4 @@ Bug fixes across the board: Contributors to this release: [2ndkauboy](https://github.com/2ndkauboy), [coreyworrell](https://github.com/coreyworrell), [danielbachhuber](https://github.com/danielbachhuber), [davidleach](https://github.com/davidleach), [duncanjbrown](https://github.com/duncanjbrown), [ernilambar](https://github.com/ernilambar), [fjarrett](https://github.com/fjarrett), [gilbitron](https://github.com/gilbitron), [greg-1-anderson](https://github.com/greg-1-anderson), [iandunn](https://github.com/iandunn), [jjeaton](https://github.com/jjeaton), [modelm](https://github.com/modelm), [rodrigoprimo](https://github.com/rodrigoprimo), [ryanshoover](https://github.com/ryanshoover), [stevector](https://github.com/stevector), [szepeviktor](https://github.com/szepeviktor), [tristanpenman](https://github.com/tristanpenman), [x1024](https://github.com/x1024) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.22.0+is%3Aclosed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.22.0+is%3Aclosed) on Github. diff --git a/_posts/2016-02-04-restful-wp-cli-update-2.md b/_posts/2016-02-04-restful-wp-cli-update-2.md index 0c331103..f052b813 100644 --- a/_posts/2016-02-04-restful-wp-cli-update-2.md +++ b/_posts/2016-02-04-restful-wp-cli-update-2.md @@ -55,7 +55,7 @@ Wait, `wp package install`. What in the? That's right, WP-CLI now has package management. Using `wp cli update --nightly`, you now can: -* `wp package browse` to browse [packages available for installation](https://wp-cli.org/package-index/). +* `wp package browse` to browse [packages available for installation](http://wp-cli.org/package-index/). * `wp package install` to install a given package. * `wp package list` to list packages installed locally. * `wp package uninstall` to uninstall a given package. @@ -124,7 +124,7 @@ I'd much prefer: wp @wpapi tag create -In the example preceding, `@wpapi` is an alias for both the target and authentication. +In the example preceeding, `@wpapi` is an alias for both the target and authentication. In this hypothetical universe, aliases would also be injected into the WP-CLI runtime: @@ -145,4 +145,4 @@ In this hypothetical universe, aliases would also be injected into the WP-CLI ru There's a bit of thinking to do, and code to write, to get from here to there, though. -Feeling inspired? I want to hear from you! Particularly if you've written custom endpoints I can test against. Please [open a GitHub issue](https://github.com/danielbachhuber/wp-rest-cli/issues) with questions, feedback, and violent dissent, or [email me directly](mailto:daniel@handbuilt.co). +Feeling inspired? I want to hear from you! Particularly if you've written custom endpoints I can test against. Please [open a Github issue](https://github.com/danielbachhuber/wp-rest-cli/issues) with questions, feedback, and violent dissent, or [email me directly](mailto:daniel@handbuilt.co). diff --git a/_posts/2016-03-22-version-0.23.0.md b/_posts/2016-03-22-version-0.23.0.md index 7bcf7522..3519507e 100644 --- a/_posts/2016-03-22-version-0.23.0.md +++ b/_posts/2016-03-22-version-0.23.0.md @@ -9,11 +9,11 @@ It's hard to believe the last WP-CLI release was only two months ago because thi If you don't make it all of the way through, here's what you absolutely need to know about WP-CLI v0.23.0: * This release includes WordPress 4.5 compatibility. Older WP-CLI versions are incompatible with WordPress 4.5. If you're planning to use WordPress 4.5 in the future, you'll need to upgrade before you do. -* You can now browse [available packages](https://wp-cli.org/package-index/) with `wp package browse`, and install them with `wp package install`. Try `wp package install runcommand/db-ack`. -* There are many new tools for registering commands. Ain't no more need to extend `WP_CLI_Command`. See the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) to learn more. -* All of the wiki pages moved to a [documentation portal on the website](https://wp-cli.org/docs/), including new pages documenting [internal APIs](https://wp-cli.org/docs/internal-api/) you can use in your own commands. Pull requests encouraged. +* You can now browse [available packages](http://wp-cli.org/package-index/) with `wp package browse`, and install them with `wp package install`. Try `wp package install runcommand/db-ack`. +* There are many new tools for registering commands. Ain't no more need to extend `WP_CLI_Command`. See the [commands cookbook](http://wp-cli.org/docs/commands-cookbook/) to learn more. +* All of the wiki pages moved to a [documentation portal on the website](http://wp-cli.org/docs/), including new pages documenting [internal APIs](http://wp-cli.org/docs/internal-api/) you can use in your own commands. Pull requests encouraged. -Now that I've given away all of the surprises, let's get on with the release post. +Now that I've given away all of the surpises, let's get on with the release post. Oh darn, I forgot two more things: @@ -24,7 +24,7 @@ And now, the release post. ### WordPress 4.5 compatibility -WordPress 4.5 loads yet another file in `wp-settings.php`. Because WP-CLI has a custom wp-settings-cli.php ([background](https://wp-cli.org/blog/how-wp-cli-loads-wordpress.html)), WP-CLI v0.23.0 is the only release compatible with WordPress 4.5. +WordPress 4.5 loads yet another file in `wp-settings.php`. Because WP-CLI has a custom wp-settings-cli.php ([background](http://wp-cli.org/blog/how-wp-cli-loads-wordpress.html)), WP-CLI v0.23.0 is the only release compatible with WordPress 4.5. **Importantly, due to the nature of these changes, WP-CLI versions prior to 0.23.0 will be incompatible with WordPress 4.5.** @@ -46,7 +46,7 @@ If you had to complete this task using the WordPress network admin, it would tak WP-CLI also generally follows the 80/20 rule when deciding whether to introduce a new feature. If the feature could be useful to most people, then maybe; otherwise, probably not. Those 20% shouldn't be left with the short stick though, particularly when it comes to the really helpful commands. -Today, I'm proud to reintroduce the [Package Index](https://wp-cli.org/package-index/), a directory of community-maintained WP-CLI packages. Browse available packages to install with `wp package browse` ([doc](https://wp-cli.org/commands/package/browse/)). Once you've found the solution you're looking for, install it with `wp package install` ([doc](https://wp-cli.org/commands/package/install/)): +Today, I'm proud to reintroduce the [Package Index](http://wp-cli.org/package-index/), a directory of community-maintained WP-CLI packages. Browse available packages to install with `wp package browse` ([doc](http://wp-cli.org/commands/package/browse/)). Once you've found the solution you're looking for, install it with `wp package install` ([doc](http://wp-cli.org/commands/package/install/)): $ wp package install runcommand/find-unused-themes Installing runcommand/find-unused-themes (dev-master) @@ -86,7 +86,7 @@ Relevant pull requests for `wp package` include [#2442](https://github.com/wp-cl Ever wonder why, when writing your own command, you had to extend `WP_CLI_Command`? Well, you didn't need to, actually. -In fact, `WP_CLI::add_command()` ([doc](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) now supports registering any arbitrary callable as a WP-CLI command. For instance, here's a closure command to reset the passwords of one or more users ([runcommand/reset-passwords](https://github.com/runcommand/reset-passwords)): +In fact, `WP_CLI::add_command()` ([doc](http://wp-cli.org/docs/internal-api/wp-cli-add-command/)) now supports registering any arbitrary callable as a WP-CLI command. For instance, here's a closure command to reset the passwords of one or more users ([runcommand/reset-passwords](https://github.com/runcommand/reset-passwords)): /** * Reset passwords for one or more WordPress users. @@ -146,14 +146,14 @@ Note the `default` argument attribute for `format`. WP-CLI accepts `default` and */ $hook_command = function( $args, $assoc_args ) { -Check out the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) for a deep dive into command registration. Relevant pull requests for these improvements to `WP_CLI::add_command()` include [#2373](https://github.com/wp-cli/wp-cli/pull/2373), [#2389](https://github.com/wp-cli/wp-cli/pull/2389), [#2398](https://github.com/wp-cli/wp-cli/pull/2398), [#2409](https://github.com/wp-cli/wp-cli/pull/2409), [#2556](https://github.com/wp-cli/wp-cli/pull/2556), [#2559](https://github.com/wp-cli/wp-cli/pull/2559). +Check out the [commands cookbook](http://wp-cli.org/docs/commands-cookbook/) for a deep dive into command registration. Relevant pull requests for these improvements to `WP_CLI::add_command()` include [#2373](https://github.com/wp-cli/wp-cli/pull/2373), [#2389](https://github.com/wp-cli/wp-cli/pull/2389), [#2398](https://github.com/wp-cli/wp-cli/pull/2398), [#2409](https://github.com/wp-cli/wp-cli/pull/2409), [#2556](https://github.com/wp-cli/wp-cli/pull/2556), [#2559](https://github.com/wp-cli/wp-cli/pull/2559). ### More, better, easier to find documentation It's actually hard to imagine how people got around previously. Here's what's changed in documentationland: -* The wiki has been reincarnated as the [documentation portal](https://wp-cli.org/docs/) on the website. I spent time cleaning up the pages as I moved them over; hopefully you find the new [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) quite helpful. -* Internal APIs you can use in your own commands are now [publicly documented](https://wp-cli.org/docs/internal-api/). The internal API pages are generated from the codebase, which should greatly help maintenance efforts. +* The wiki has been reincarnated as the [documentation portal](http://wp-cli.org/docs/) on the website. I spent time cleaning up the pages as I moved them over; hopefully you find the new [commands cookbook](http://wp-cli.org/docs/commands-cookbook/) quite helpful. +* Internal APIs you can use in your own commands are now [publicly documented](http://wp-cli.org/docs/internal-api/). The internal API pages are generated from the codebase, which should greatly help maintenance efforts. * On each command page, there's a "Github issues" link to make it easier to find both open and closed issues for a given command. For instance, here are [all of the outstanding issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aopen+label%3Acommand%3Apackage+sort%3Aupdated-desc) for `wp package` and its subcommands. Keep in mind this isn't necessarily exact, because I didn't go back through and label all issues of all time. This feature will become more useful as time goes forward. Relevant pull requests include [#2454](https://github.com/wp-cli/wp-cli/pull/2454), [#2487](https://github.com/wp-cli/wp-cli/pull/2487), [#2494](https://github.com/wp-cli/wp-cli/pull/2494), [#2499](https://github.com/wp-cli/wp-cli/pull/2499), [#2507](https://github.com/wp-cli/wp-cli/pull/2507), [#2513](https://github.com/wp-cli/wp-cli/pull/2513), [#2515](https://github.com/wp-cli/wp-cli/pull/2515). @@ -220,4 +220,4 @@ Bug fixes across the board: Contributors to this release: [anantshri](https://github.com/anantshri), [danielbachhuber](https://github.com/danielbachhuber), [edueo](https://github.com/edueo), [GaryJones](https://github.com/GaryJones), [gilbitron](https://github.com/gilbitron), [hina](https://github.com/hina), [hinoue-work](https://github.com/hinoue-work), [jacobischwartz](https://github.com/jacobischwartz), [marco-c](https://github.com/marco-c), [markjaquith](https://github.com/markjaquith), [markkimsal](https://github.com/markkimsal), [mbovel](https://github.com/mbovel), [ottok](https://github.com/ottok), [rodrigoprimo](https://github.com/rodrigoprimo), [sourcerer-mike](https://github.com/sourcerer-mike), [staude](https://github.com/staude), [szepeviktor](https://github.com/szepeviktor), [za-creature](https://github.com/za-creature) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.23.0+is%3Aclosed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.23.0+is%3Aclosed) on Github. diff --git a/_posts/2016-04-14-restful-wp-cli-update-3.md b/_posts/2016-04-14-restful-wp-cli-update-3.md index 94f919de..162132f5 100644 --- a/_posts/2016-04-14-restful-wp-cli-update-3.md +++ b/_posts/2016-04-14-restful-wp-cli-update-3.md @@ -4,7 +4,7 @@ author: danielbachhuber title: RESTful WP-CLI - What I've been hacking on --- -Let me just say — Thursday, February 4th was [pretty darn demoralizing](https://twitter.com/Krogsgard/status/695634320401285121). I spent a huge amount of time in January towards the WP REST API in preparation for what I wanted to do on the command line, and a lot of momentum / inspiration / general good feelings were destroyed in that meeting. As such, I spent much of February and March working on WP-CLI features unrelated to the WP REST API (e.g. [package management](https://wp-cli.org/commands/package/)). +Let me just say — Thursday, February 4th was [pretty darn demoralizing](https://twitter.com/Krogsgard/status/695634320401285121). I spent a huge amount of time in January towards the WP REST API in preparation for what I wanted to do on the command line, and a lot of momentum / inspiration / general good feelings were destroyed in that meeting. As such, I spent much of February and March working on WP-CLI features unrelated to the WP REST API (e.g. [package management](http://wp-cli.org/commands/package/)). But, I'm back in the saddle. Because I'm 2/3 of the way through one of those fancy WP REST API + React WordPress applications, I'm running into dozens of ways I want to be able to make WordPress more efficiently. And of course, this means doing it on the command line. @@ -74,7 +74,7 @@ Profiling works for any CRUD operation. Debug (rest): REST command executed 31 queries in 0.023309 seconds. Use --debug=rest to see all queries. (1.634s) Success: Updated post. -Hopefully this feature becomes an invaluable part of your REST endpoint development process, as it has mine. Hit me with feedback on [its GitHub issue](https://github.com/danielbachhuber/wp-rest-cli/issues/42). +Hopefully this feature becomes an invaluable part of your REST endpoint development process, as it has mine. Hit me with feedback on [its Github issue](https://github.com/danielbachhuber/wp-rest-cli/issues/42). ### Use `wp rest * edit` to edit a resource in your system editor @@ -130,4 +130,4 @@ I'd love your input on the dozens of ideas I have for a more RESTful WP-CLI: * Introduce `wp rest * diff` to be able to diff the state of two different WordPresses, a la [Dictator](https://github.com/danielbachhuber/dictator) [[#56](https://github.com/danielbachhuber/wp-rest-cli/issues/56)]. * Figure out an elegant aliases implementation, so `--http=http://daniel:daniel@wordpress-develop.dev` becomes `@wpdev` [[#2039](https://github.com/wp-cli/wp-cli/issues/2039)] -And I want to hear your ideas too! As well as any feedback, questions, or violent dissent. [Let's chat on GitHub](https://github.com/danielbachhuber/wp-rest-cli/issues). +And I want to hear your ideas too! As well as any feedback, questions, or violent dissent. [Let's chat on Github](https://github.com/danielbachhuber/wp-rest-cli/issues). diff --git a/_posts/2016-04-28-version-0.23.1.md b/_posts/2016-04-28-version-0.23.1.md index 3e128300..9ed1225e 100644 --- a/_posts/2016-04-28-version-0.23.1.md +++ b/_posts/2016-04-28-version-0.23.1.md @@ -10,4 +10,4 @@ If you're using the Phar distribution of WP-CLI, you *should* `wp cli update`, b Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.23.1+is%3Aclosed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.23.1+is%3Aclosed) on Github. diff --git a/_posts/2016-06-23-future-wp-cli.md b/_posts/2016-06-23-future-wp-cli.md index 6f62578b..7fc79034 100644 --- a/_posts/2016-06-23-future-wp-cli.md +++ b/_posts/2016-06-23-future-wp-cli.md @@ -6,7 +6,7 @@ title: The future of WP-CLI As you might be aware, WP-CLI is an indispensable tool for many individuals and companies. We very much appreciate our community of users (although we have no idea how many of you there actually are), and want to ensure our relationship is strong for the years to come. -Just over a month ago, I [started a GitHub issue](https://github.com/wp-cli/wp-cli/issues/2743) with this question: +Just over a month ago, I [started a Github issue](https://github.com/wp-cli/wp-cli/issues/2743) with this question: > how do I reduce WP-CLI's bus factor, and more generally lay a foundation for WP-CLI's long-term organizational stability? @@ -16,7 +16,7 @@ Based on our conversation, we think the most important task is to reduce WP-CLI' * Documentation - Help ensure WP-CLI's documentation is world-class. * Marketing / community management - Help spread the word about WP-CLI. -* Support - Help WP-CLI users where they're asking questions, let it be GitHub, WordPress.org, Stack Exchange, or elsewhere. +* Support - Help WP-CLI users where they're asking questions, let it be Github, WordPress.org, Stack Exchange, or elsewhere. Contributions in these areas will always be welcome. Maintainership is a longer-term commitment to the project, focused on ongoing improvements to the specific area. WP-CLI expects its maintainers to commit a few hours per week to the project. diff --git a/_posts/2016-07-27-version-0.24.0.md b/_posts/2016-07-27-version-0.24.0.md index 99ea9a4e..e934a746 100644 --- a/_posts/2016-07-27-version-0.24.0.md +++ b/_posts/2016-07-27-version-0.24.0.md @@ -13,7 +13,7 @@ As I [mentioned in my WordCamp Europe talk](https://runcommand.io/2016/06/26/my- In this model, WP-CLI becomes the common interface, and supporting application layer, to a rich ecosystem of features. Doing so opens more frontiers for innovation, which leads to a greater selection of ideas to choose from. And because more people are involved in authoring packages, WP-CLI benefits from a larger contributor pool. -With this model, my focus shifts towards designing a world-class experience for WP-CLI package authorship. Read through the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) for a thorough introduction to creating a WP-CLI command. Check out `wp scaffold package` [[repo](https://github.com/wp-cli/scaffold-package-command)] for the easiest way to generate the boilerplate for your new WP-CLI package. Weigh in with your thoughts on [how we should evolve the WP-CLI package index](https://github.com/wp-cli/wp-cli/issues/3197). And [follow @runcommand](https://twitter.com/runcommand) as I explore commercializing WP-CLI products and services — I hope that [runcommand](https://runcommand.io) is just the first of several WP-CLI-based businesses. +With this model, my focus shifts towards designing a world-class experience for WP-CLI package authorship. Read through the [commands cookbook](http://wp-cli.org/docs/commands-cookbook/) for a thorough introduction to creating a WP-CLI command. Check out `wp scaffold package` [[repo](https://github.com/wp-cli/scaffold-package-command)] for the easiest way to generate the boilerplate for your new WP-CLI package. Weigh in with your thoughts on [how we should evolve the WP-CLI package index](https://github.com/wp-cli/wp-cli/issues/3197). And [follow @runcommand](https://twitter.com/runcommand) as I explore commercializing WP-CLI products and services — I hope that [runcommand](https://runcommand.io) is just the first of several WP-CLI-based businesses. One last ask: if you care about the WP-CLI release cycle, or dependencies and backwards compatibility, please [let me know how often you think WP-CLI should be released](https://github.com/wp-cli/wp-cli/issues/3198). @@ -23,7 +23,7 @@ Let's get on with the show. Use `wp cli update` to install v0.24.0, representing Every application has a bootstrap file which loads all of the requisite utilities needed to serve a request. In WordPress, this is called `wp-settings.php`. -Since v0.8.0 [[#261](https://github.com/wp-cli/wp-cli/pull/261)], WP-CLI has used a forked version of this bootstrap file, called `wp-settings-cli.php`, to give it more control over the load process, providing features like `--skip-plugins`. But, because WordPress can require new files from `wp-settings.php`, maintaining a forked version has the unfortunate side effect of WP-CLI [regularly breaking when a new version of WordPress is released](https://wp-cli.org/blog/versions-0.21.1-and-0.20.4.html). +Since v0.8.0 [[#261](https://github.com/wp-cli/wp-cli/pull/261)], WP-CLI has used a forked version of this bootstrap file, called `wp-settings-cli.php`, to give it more control over the load process, providing features like `--skip-plugins`. But, because WordPress can require new files from `wp-settings.php`, maintaining a forked version has the unfortunate side effect of WP-CLI [regularly breaking when a new version of WordPress is released](http://wp-cli.org/blog/versions-0.21.1-and-0.20.4.html). Thanks to coordinated changes in the WordPress project, WP-CLI v0.24.0 returns to loading `wp-settings.php` for WordPress 4.6 and higher [[#2278](https://github.com/wp-cli/wp-cli/issues/2278)]. Doing so should make WP-CLI more future proof against new versions of WordPress. @@ -32,8 +32,8 @@ Thanks to coordinated changes in the WordPress project, WP-CLI v0.24.0 returns t Thanks to tireless efforts by a solid group of contributors, WP-CLI now has more documentation in more languages. * Dozens of commands have improved examples for reference. -* We have a new [CONTRIBUTING.md](https://github.com/wp-cli/wp-cli/blob/master/CONTRIBUTING.md), which also has a [page on the website](https://wp-cli.org/docs/contributing/). -* Our new [README.md](https://github.com/wp-cli/wp-cli/blob/master/README.md) powers the [WP-CLI homepage](https://wp-cli.org/), and is available in [Japanese](https://wp-cli.org/ja/), [Français](https://wp-cli.org/fr/), [Português (Brasil)](https://wp-cli.org/br/), [Türkçe](https://wp-cli.org/tr/), [Deutsch](https://wp-cli.org/de/), [नेपाली](https://wp-cli.org/ne/), and [ελληνικά](https://wp-cli.org/gr/). +* We have a new [CONTRIBUTING.md](https://github.com/wp-cli/wp-cli/blob/master/CONTRIBUTING.md), which also has a [page on the website](http://wp-cli.org/docs/contributing/). +* Our new [README.md](https://github.com/wp-cli/wp-cli/blob/master/README.md) powers the [WP-CLI homepage](http://wp-cli.org/), and is available in [Japanese](http://wp-cli.org/ja/), [Français](http://wp-cli.org/fr/), [Português (Brasil)](http://wp-cli.org/br/), [Türkçe](http://wp-cli.org/tr/), [Deutsch](http://wp-cli.org/de/), [नेपाली](http://wp-cli.org/ne/), and [ελληνικά](http://wp-cli.org/gr/). Want to get involved with WP-CLI's documentation? Check out the [Github issues labeled "scope:documentation"](https://github.com/wp-cli/wp-cli/issues?q=is%3Aopen+sort%3Aupdated-desc+label%3Ascope%3Adocumentation). @@ -143,7 +143,7 @@ Bug fixes across the board: * Fixes listing user meta associated with a given username [[#2700](https://github.com/wp-cli/wp-cli/pull/2700)]. * Differentiates output when moving comments to trash from output when deleting comments [[#2701](https://github.com/wp-cli/wp-cli/pull/2701)]. * Prevents runaway memory usage from `wp export` by clearing object cache after each file [[#2716](https://github.com/wp-cli/wp-cli/pull/2716)]. -* Ignores ambiguous empty plugin and theme slugs when installing [[#2715](https://github.com/wp-cli/wp-cli/pull/2715)]. +* Ignores ambigious empty plugin and theme slugs when installing [[#2715](https://github.com/wp-cli/wp-cli/pull/2715)]. * Takes all digits when running commands that use the comment id [[#2714](https://github.com/wp-cli/wp-cli/pull/2714), [#2901](https://github.com/wp-cli/wp-cli/pull/2901)]. * Only displays packages directory path when it exists [[#2773](https://github.com/wp-cli/wp-cli/pull/2773)]. * Bails early in theme commands if theme is broken or has error [[#2798](https://github.com/wp-cli/wp-cli/pull/2798)]. @@ -158,6 +158,6 @@ Bug fixes across the board: Contributors to this release: [andyexeter](https://github.com/andyexeter), [bordoni](https://github.com/bordoni), [danielbachhuber](https://github.com/danielbachhuber), [diggy](https://github.com/diggy), [enrico-sorcinelli](https://github.com/enrico-sorcinelli), [ernilambar](https://github.com/ernilambar), [geo4orce](https://github.com/geo4orce), [gedex](https://github.com/gedex), [gilbitron](https://github.com/gilbitron), [hideokamoto](https://github.com/hideokamoto), [apertureless](https://github.com/apertureless), [JRGould](https://github.com/JRGould), [johnbillion](https://github.com/johnbillion), [kkoppenhaver](https://github.com/kkoppenhaver), [kouratoras](https://github.com/kouratoras), [markjaquith](https://github.com/markjaquith), [miya0001](https://github.com/miya0001), [mustafauysal](https://github.com/mustafauysal), [NateWr](https://github.com/NateWr), [Nikschavan](https://github.com/Nikschavan), [ocean90](https://github.com/ocean90), [petenelson](https://github.com/petenelson), [phh](https://github.com/phh), [rachelbaker](https://github.com/rachelbaker), [PatelUtkarsh](https://github.com/PatelUtkarsh), [PeterDaveHello](https://github.com/PeterDaveHello), [robhenley](https://github.com/robhenley) [rodrigoprimo](https://github.com/rodrigoprimo), [roelveldhuizen](https://github.com/roelveldhuizen), [ShinichiNishikawa](https://github.com/ShinichiNishikawa), [shulard](https://github.com/shulard), [stephenharris](https://github.com/stephenharris), [stevenkword](https://github.com/stevenkword), [swissspidy](https://github.com/swissspidy), [taianunes](https://github.com/taianunes), [villevuor](https://github.com/villevuor), [voldemortensen](https://github.com/voldemortensen), [wesm87](https://github.com/wesm87), [8bitodyssey](https://github.com/8bitodyssey) -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.24.0+is%3Aclosed) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.24.0+is%3Aclosed) on Github. Back to work! diff --git a/_posts/2016-08-09-support-policy.md b/_posts/2016-08-09-support-policy.md index 6142fd6a..e59f4cde 100644 --- a/_posts/2016-08-09-support-policy.md +++ b/_posts/2016-08-09-support-policy.md @@ -10,7 +10,7 @@ Have a question about something related to WP-CLI? You might find an answer in o - [Common issues and their fixes](https://wp-cli.org/docs/common-issues/) - [Documentation portal](https://wp-cli.org/docs/) -- [Open or closed issues on GitHub](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [Open or closed issues on Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) - [runcommand Excerpts](https://runcommand.io/excerpts/) - [WordPress StackExchange forums](http://wordpress.stackexchange.com/questions/tagged/wp-cli) diff --git a/_posts/2016-08-09-version-0.24.1.md b/_posts/2016-08-09-version-0.24.1.md index 917b549c..3f0d5c91 100644 --- a/_posts/2016-08-09-version-0.24.1.md +++ b/_posts/2016-08-09-version-0.24.1.md @@ -8,6 +8,6 @@ Curious as to why you're getting a warning message when updating an option? Or w These two bugs, regressions from v0.24.0, are fixed in v0.24.1. -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aclosed+milestone%3A0.24.1) on GitHub. +You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aclosed+milestone%3A0.24.1) on Github. Contributors to this release: [danielbachhuber](https://github.com/danielbachhuber) diff --git a/_posts/2016-10-25-version-0.25.0.md b/_posts/2016-10-25-version-0.25.0.md deleted file mode 100644 index 7982485c..00000000 --- a/_posts/2016-10-25-version-0.25.0.md +++ /dev/null @@ -1,155 +0,0 @@ ---- -layout: post -author: danielbachhuber -title: Version 0.25.0 released ---- - -Happy release day! - -Today, I'm excited to bring you WP-CLI v0.25.0. Check out the [newly published roadmap](/docs/roadmap/) for details on upcoming releases and product focus (hint: there's a future where WP-CLI no longer supports PHP 5.3). - -Let's dive in. - -### Compatibility with WordPress 4.7 - -WordPress 4.7 introduces a new `WP_Hook` implementation for registering and executing actions and filters. Because WP-CLI has its own `WP_CLI::add_wp_hook()` that was erroneously accessing the `$wp_filter` global even when the `add_filter()` function was available, WP-CLI could fatal in certain circumstances. WP-CLI now appropriately calls `add_filter()` when it's available. - -**Importantly, due to the nature of these changes, WP-CLI versions prior to 0.25.0 will be incompatible with WordPress 4.7.** - -Inspect the change in [this pull request](https://github.com/wp-cli/wp-cli/pull/3384). - -### New packages in the Package Index - -The WP-CLI community has been quite active in creating new tools for you to use (and contribute back to): - -* [aaemnnosttv/wp-cli-login-command](https://github.com/aaemnnosttv/wp-cli-login-command) - Log in to WordPress with secure passwordless magic links. -* [alessandrotesoro/wp-cli-helpscout-docs-parser](https://github.com/alessandrotesoro/wp-cli-helpscout-docs-parser) - Extract helpscout docs articles and categories to build an offline documentation. -* [alessandrotesoro/wp-usergen-cli](https://github.com/alessandrotesoro/wp-usergen-cli) - Generate random users for testing purposes. -* [anhskohbo/wp-cli-themecheck](https://github.com/anhskohbo/wp-cli-themecheck) - Run Themecheck in WP-CLI. -* [BeAPI/wp-cli-light-db-export](https://github.com/BeAPI/wp-cli-light-db-export) - Allows you to export big databases with all the tables but not all the data. -* [binarygary/db-checkpoint](https://github.com/binarygary/db-checkpoint) - Treat your DB like a save point in a video game. -* [brightoak/wp-cli-envoyer](https://github.com/brightoak/wp-cli-envoyer) - Invoke an Envoyer deployment via WP-CLI. -* [getshifter/wp-cli-shifter](https://github.com/getshifter/wp-cli-shifter) - Enables you to import/export your WordPress site for the Shifter. -* [eriktorsner/wp-checksum](https://github.com/eriktorsner/wp-checksum) - Verify checksums for themes and plugins. -* [iandunn/wp-cli-plugin-active-on-sites](https://github.com/iandunn/wp-cli-plugin-active-on-sites) - List all sites in a multisite network that have activated a given plugin. -* [markri/wp-sec](https://github.com/markri/wp-sec) - Checks for WordPress CVE security issues at wpvulndb.com. -* [mattgrshaw/wp-installer](https://github.com/mattgrshaw/wp-installer) - Simple commands to install and uninstall WordPress. -* [pressbooks/pb-cli](https://github.com/pressbooks/pb-cli) - A suite of wp-cli commands for Pressbooks. -* [runcommand/assign-featured-images](https://github.com/runcommand/assign-featured-images) - Assign featured images to posts that support thumbnails. -* [runcommand/manifest](https://github.com/runcommand/manifest) - Produces an overview of WordPress' configuration for a high-level understanding of what's going on inside of WordPress. -* [rxnlabs/wp-composer](https://github.com/rxnlabs/wp-composer) - Manage your WordPress site dependencies using the power of Composer. -* [trendwerk/faker](https://github.com/trendwerk/faker) - Fake post data with WP-CLI. -* [trepmal/blog-extractor](https://github.com/trepmal/blog-extractor) - Extract a single blog from multisite. -* [trepmal/wp-revisions-cli](https://github.com/trepmal/wp-revisions-cli) - Manage revisions. -* [welaika/wp-cli-db2utf8](https://github.com/welaika/wp-cli-db2utf8) - Downgrade db encoding of a new WP installation to UTF8. - -Install any one of these with `wp package install ` (where `` is typically the `/`). When you do, go say thanks to the author! - -### More ways to install WP-CLI packages - -Although we'd love to see your package listed in the Package Index, we realize there are reasons you might not be able to do so. `wp package install` now supports installing an arbitrary Git URL [[#3482](https://github.com/wp-cli/wp-cli/pull/3482)], `.zip` file [[#3485](https://github.com/wp-cli/wp-cli/pull/3485)], or directory path [[#3484](https://github.com/wp-cli/wp-cli/pull/3484)] as a package. - - $ wp package install git@github.com:runcommand/doctor.git - $ wp package install https://github.com/runcommand/doctor.zip - $ wp package install doctor - -(doctor is the [second premium WP-CLI command from runcommand](https://runcommand.io/wp/doctor/)) - -It's worth noting Composer's behavior is slightly different for each package type: - -* Git URLs are treated as VCS repositories, and cloned to `~/.wp-cli/packages/vendor`. -* ZIP archives (remote and local) are extracted to `~/.wp-cli/packages/local`, and added as path repositories. -* Local directory paths are added as path repositories, which means Composer creates a symlink to the existing directory path. If the directory you've provided is removed, then the installation will break. - -### Everything else in 0.25.0 - -New commands: - -* `wp db check` - Runs `mysqlcheck` with the default `--check` option [[#3332](https://github.com/wp-cli/wp-cli/pull/3332)]. -* `wp site option *` - CRUD commands for managing WordPress site options [[#3386](https://github.com/wp-cli/wp-cli/pull/3386)]. -* `wp user session *` - CRUD commands for managing user sessions [[#3307](https://github.com/wp-cli/wp-cli/pull/3307)]. - -Command improvements: - -* `wp cli update`: - * Introduces `--stable` to install or reinstall the latest stable version [[#3430](https://github.com/wp-cli/wp-cli/pull/3430)]. -* `wp core config`: - * Adds comments to generated `wp-config.php` to better match the one provided by WordPress core [[#3312](https://github.com/wp-cli/wp-cli/pull/3312)]. -* `wp core download`: - * Preserves case for `--version` argument to properly handle release candidates [[#3283](https://github.com/wp-cli/wp-cli/pull/3283)]. - * Ensures `wp core download --version=latest` produces correctly-versioned cache key [[#3467](https://github.com/wp-cli/wp-cli/pull/3467)]. -* `wp core language update`: - * Fixes strict standard error about variable reference [[#3380](https://github.com/wp-cli/wp-cli/pull/3380)]. - * Permits updating language packs even when `en_US` is set as locale [[#3397](https://github.com/wp-cli/wp-cli/pull/3397)]. -* `wp core multisite-(install|convert)`: - * Warns when multisite constants can't be inserted into `wp-config.php`, instead of erroneously inserting at the end [[#3272](https://github.com/wp-cli/wp-cli/pull/3272)]. - * Includes adequate vertical spacing around inserted constants [[#3267](https://github.com/wp-cli/wp-cli/pull/3267)]. -* `wp core update-db`: - * Ensures `wp core update-db --network --dry-run` is actually dry [[#3347](https://github.com/wp-cli/wp-cli/pull/3347)]. -* `wp core version`: - * Displays default core language in `wp core version --extra` [[#3221](https://github.com/wp-cli/wp-cli/pull/3221)]. -* `wp import`: - * Indicates current file in WXR import progress indicator to communicate the total count is of the current file, not all files [[#3270](https://github.com/wp-cli/wp-cli/pull/3270)]. -* `wp media regenerate`: - * Adds a simple progress indicator [[#3407](https://github.com/wp-cli/wp-cli/pull/3407)]. -* `wp option list`: - * Adds `--no-transients` flag to ignore transients [[#3452](https://github.com/wp-cli/wp-cli/pull/3452)]. - * Adds `--exclude=` argument to list options excluding a specific pattern [[#3455](https://github.com/wp-cli/wp-cli/pull/3455)]. -* `wp package install` - * Displays package dependency details when installing a package with a dependency [[#3418](https://github.com/wp-cli/wp-cli/pull/3418), [#3425](https://github.com/wp-cli/wp-cli/pull/3425)]. -* `wp package uninstall` - * Removes a package's dependencies when the package is removed [[#3343](https://github.com/wp-cli/wp-cli/pull/3343)]. - * Properly assigns `$composer_backup` when uninstalling [[#3399](https://github.com/wp-cli/wp-cli/pull/3399)]. -* `wp plugin install`: - * Removes branch names from directories created for Github-based ZIPs [[#3314](https://github.com/wp-cli/wp-cli/pull/3314), [#3451](https://github.com/wp-cli/wp-cli/pull/3451)]. -* `wp scaffold plugin-tests`: - * Uses PHP version specific to Trusty on CircleCI [[#3359](https://github.com/wp-cli/wp-cli/pull/3359)]. - * Uses correct default user for MySQL on CircleCI [[#3457](https://github.com/wp-cli/wp-cli/pull/3457)]. - * Uses the latest version of PHPUnit on Travis, depending on PHP version [[#3463](https://github.com/wp-cli/wp-cli/pull/3463)]. - * Adds WordPress Coding Standards to newly-scaffolded plugins [[#3472](https://github.com/wp-cli/wp-cli/pull/3472)]. -* `wp search-replace`: - * Ensures tables are quoted to support all permitted characters [[#3318](https://github.com/wp-cli/wp-cli/pull/3318)]. - * Prevents error notice when `export_insert_size` isn't defined [[#3357](https://github.com/wp-cli/wp-cli/pull/3357)]. - * Fails back to PHP if SQL triggers an error for some reason [[#3387](https://github.com/wp-cli/wp-cli/pull/3387)]. -* `wp server`: - * Supports passing a custom `.ini` file to configure the server [[#3330](https://github.com/wp-cli/wp-cli/pull/3330)]. -* `wp site create`: - * Use `get_blog_details()` for the site URL when creating a new site to ensure the correct URL is displayed [[#3416](https://github.com/wp-cli/wp-cli/pull/3416)]. -* `wp site empty`: - * Ensures the entire uploads directory is empty [[#3400](https://github.com/wp-cli/wp-cli/pull/3400)]. -* `wp theme install`: - * Correctly installs parent theme when installing a child theme [[#3301](https://github.com/wp-cli/wp-cli/pull/3301)]. -* `wp transient`: - * Consolidates `wp transient delete-all` and `wp transient delete-expired` to flags of `wp transient delete` [[#3389](https://github.com/wp-cli/wp-cli/pull/3389)]. -* `wp user create`: - * Prevents email notifications when users are created because email notifications should only be sent when `--send-email` is provided [[#3331](https://github.com/wp-cli/wp-cli/pull/3331)]. - -Framework enhancements: - -* Updates Composer-based dependencies to latest [[#3257](https://github.com/wp-cli/wp-cli/pull/3257), [#3429](https://github.com/wp-cli/wp-cli/pull/3429), [#3460](https://github.com/wp-cli/wp-cli/pull/3460), [#3468](https://github.com/wp-cli/wp-cli/pull/3468)]. -* Properly handles registering an instantiated object as a command [[#3269](https://github.com/wp-cli/wp-cli/pull/3269)]. -* Splits the `ProcessRun` class out to its own file [[#3377](https://github.com/wp-cli/wp-cli/pull/3377), [#3422](https://github.com/wp-cli/wp-cli/pull/3422)]. -* Permits running test suite with `WP_VERSION` env variable [[#3383](https://github.com/wp-cli/wp-cli/pull/3383), [#3392](https://github.com/wp-cli/wp-cli/pull/3392)]. -* Prevents error notice when using `Utils\get_named_sem_ver()` with WP versions [[#3404](https://github.com/wp-cli/wp-cli/pull/3404)]. -* Fixes fatal error for failed early database connection by handling `dead_db()` error on `nocache_headers` filter [[#3440](https://github.com/wp-cli/wp-cli/pull/3440)]. -* Assigns a default `$_SERVER['SERVER_NAME']` to prevent uncaught exception when `wp_mail()` is used [[#3449](https://github.com/wp-cli/wp-cli/pull/3449)]. -* Ignores `url:` in `wp-cli.yml` when alias is used, because aliases completely override user, url, path, ssh, and http [[#3450](https://github.com/wp-cli/wp-cli/pull/3450)]. -* Warns when `WP_CLI::launch()` ends up with `return_code=-1`, which could be caused by a custom compiled version of PHP that uses the `--enable-sigchild` option [[#3458](https://github.com/wp-cli/wp-cli/pull/3458)]. -* Provides more verbosity in `wp_die()` handler to give the end user more detail when a database connection fails [[#3459](https://github.com/wp-cli/wp-cli/pull/3459)]. -* Supports passing arguments to `WP_CLI::do_hook()` [[#3470](https://github.com/wp-cli/wp-cli/pull/3470)]. -* Logs the current alias when executing an alias group [[#3471](https://github.com/wp-cli/wp-cli/pull/3471)]. -* Only checks `options` for a positional argument when a value is present [[#3481](https://github.com/wp-cli/wp-cli/pull/3481)]. -* Variety of bash completion improvements [[#3490](https://github.com/wp-cli/wp-cli/pull/3490), [#3491](https://github.com/wp-cli/wp-cli/pull/3491), [#3492](https://github.com/wp-cli/wp-cli/pull/3492)]. - -Bug fixes across the board: - -* Defines all requisite dependencies for PHP 7 on Debian-based systems [[#3208](https://github.com/wp-cli/wp-cli/pull/3208)]. -* Ensures `site --site_id= -> site --network_id=` backwards compat shim only affects `wp site create` [[#3227](https://github.com/wp-cli/wp-cli/pull/3227)]. -* Catches exceptions thrown by `RecursiveDirectoryIterator` when verifying core checksums [[#3266](https://github.com/wp-cli/wp-cli/pull/3266)]. -* Passes slashed data in meta commands [[#3274](https://github.com/wp-cli/wp-cli/pull/3274)]. -* Ensures appropriate WP-CLI package index URL is used in the `composer.json` [[#3276](https://github.com/wp-cli/wp-cli/pull/3276)]. -* Corrects reference of `WP_CLI` to use global namespace in `WP_CLI\Utils\get_temp_dir()` [[#3369](https://github.com/wp-cli/wp-cli/pull/3369)]. - -Contributors to this release (pull requests, documentation, and package authors): [2ndkauboy](https://github.com/2ndkauboy), [aaemnnosttv](https://github.com/aaemnnosttv), [alessandrotesoro](https://github.com/alessandrotesoro), [anhskohbo](https://github.com/anhskohbo), [balbuf](https://github.com/balbuf), [BeAPI](https://github.com/BeAPI), [binarygary](https://github.com/binarygary), [bradp](https://github.com/bradp), [brightoak](https://github.com/brightoak), [danielbachhuber](https://github.com/danielbachhuber), [danilomaccioni](https://github.com/danilomaccioni), [diggy](https://github.com/diggy), [getshifter](https://github.com/getshifter), [eriktorsner](https://github.com/eriktorsner), [ernilambar](https://github.com/ernilambar), [fisele](https://github.com/fisele), [grappler](https://github.com/grappler), [guillaumemolter](https://github.com/guillaumemolter), [iandunn](https://github.com/iandunn), [johnbillion](https://github.com/johnbillion), [jorgeatorres](https://github.com/jorgeatorres), [kouratoras](https://github.com/kouratoras), [markri](https://github.com/markri), [mattgrshaw](https://github.com/mattgrshaw), [miya0001](https://github.com/miya0001), [mustafauysal](https://github.com/mustafauysal), [nyordanov](https://github.com/nyordanov), [ocean90](https://github.com/ocean90), [petenelson](https://github.com/petenelson), [polevaultweb](https://github.com/polevaultweb), [pressbooks](https://github.com/pressbooks), [rahulsprajapati](https://github.com/rahulsprajapati), [runcommand](https://github.com/runcommand), [rxnlabs](https://github.com/rxnlabs), [shulard](https://github.com/shulard), [swissspidy](https://github.com/swissspidy), [szepeviktor](https://github.com/szepeviktor), [taianunes](https://github.com/taianunes), [tnorthcutt](https://github.com/tnorthcutt), [trendwerk](https://github.com/trendwerk), [trepmal](https://github.com/trepmal), [veganista](https://github.com/veganista), [welaika](https://github.com/welaika) - -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A0.25.0+is%3Aclosed) on GitHub. diff --git a/_posts/2016-11-29-version-1.0.0.md b/_posts/2016-11-29-version-1.0.0.md deleted file mode 100644 index 0dd8ba7d..00000000 --- a/_posts/2016-11-29-version-1.0.0.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -layout: post -author: danielbachhuber -title: Version 1.0.0 released ---- - -Woohoo! - -Over the course of 5+ years, hundreds of contributors have worked to bring you WP-CLI v1.0.0, which I'm proud to announce today. - -This release represents a level of maturity few open source projects achieve. It also marks a moment of transition. The WP-CLI project will shift its focus to the WP-CLI package ecosystem, where it will enable innovation by building and encouraging new features as standalone packages. We hope this approach will promote faster iteration and more creativity, and more sustainably distribute the maintenance burden. As these community packages find success, we'll bring their learnings back into WP-CLI, alongside bug fixes and minor enhancements. - -Now that the issue backlog is [down to zero](https://twitter.com/danielbachhuber/status/802951083354009600), I'm personally looking forward to getting more ideas cooking for [runcommand](https://runcommand.io/), my own WP-CLI innovation studio. - -Headed to Philly this week? I'll be at Post Status Publish and WCUS (although only until mid-afternoon Friday). Say hello - I'm [@danielbachhuber](https://twitter.com/danielbachhuber) on Twitter. - -On with the show... - -### Introducing `WP_CLI::runcommand()` - -`WP_CLI::runcommand()` ([doc](/docs/internal-api/wp-cli-runcommand/)) is the new best way to run WP-CLI commands from within your WP-CLI command. It's as though `WP_CLI::run_command()` and `WP_CLI::launch_self()` grew up, married, and had the perfect child. - -With `WP_CLI::runcommand()`, you can: - -* Launch a new child process (default), or reuse the existing process. -* Optionally prevent the process from exiting on error. -* Return STDOUT generated by the command, or all command execution details (STDOUT, STDERR, return_code) as an object. -* Optionally parse captured STDOUT as JSON. - -Relevant pull requests include: [#3605](https://github.com/wp-cli/wp-cli/pull/3605), [#3619](https://github.com/wp-cli/wp-cli/pull/3619), [#3621](https://github.com/wp-cli/wp-cli/pull/3621). - -### Breaking change: Uses return code 1 when batch operation partially fails - -Some commands support performing the same operation against multiple resources (e.g. updating two or more plugins with `wp plugin update akismet hello`). Previously, if one of the operations failed (e.g. a plugin update failed to be downloaded), WP-CLI would display a warning, continue on, and exit with return code 0. Beginning in v1.0.0, WP-CLI uses return code 1 when one or more operations fails. - -See [this issue](https://github.com/wp-cli/wp-cli/issues/3577) for more background and rationale. - -Affected commands include: - -* `wp media (regenerate|import)` -* `wp menu delete` -* `wp menu item delete` -* `wp plugin (install|activate|update|toggle|deactivate|uninstall|delete)` -* `wp super-admin add` -* `wp theme (install|update)` -* `wp term delete` -* `wp widget (delete|deactivate|reset)` - -Use `WP_CLI\Utils\report_batch_operation_results()` ([doc](/docs/internal-api/wp-cli-utils-report-batch-operation-results/)) in your custom WP-CLI commands to more easily support this behavior. - -Relevant pull requests include: [#3584](https://github.com/wp-cli/wp-cli/pull/3584), [#3583](https://github.com/wp-cli/wp-cli/pull/3583), [#3582](https://github.com/wp-cli/wp-cli/pull/3582), [#3585](https://github.com/wp-cli/wp-cli/pull/3585), [#3586](https://github.com/wp-cli/wp-cli/pull/3586), [#3588](https://github.com/wp-cli/wp-cli/pull/3588). - -### Everything else in 1.0.0 - -New commands: - -* `wp package update` - Update all installed WP-CLI packages to their latest version. -* `wp scaffold theme-tests` - Scaffold PHPUnit tests for themes. - -Command improvements: - -* `wp cache type`: - * Supports WP LCache as a cache type [[#3504](https://github.com/wp-cli/wp-cli/pull/3504)]. -* `wp cli aliases`: - * Adds `alias` to subcommand for easier access [[#3512](https://github.com/wp-cli/wp-cli/pull/3512)]. -* `wp cli update`: - * Verifies release hash when updating [[#3515](https://github.com/wp-cli/wp-cli/pull/3515)]. - * No longer requires `--allow--root` flag when running as root [[#3576](https://github.com/wp-cli/wp-cli/pull/3576)]. -* `wp core config`: - * Ensures WordPress Coding Standards are applied to the generated wp-config [[#3496](https://github.com/wp-cli/wp-cli/pull/3496)]. -* `wp core (install|multisite-install)` - * Defaults to a randomly generated password for `--admin_password=`, which is now optional [[#3535](https://github.com/wp-cli/wp-cli/pull/3535), [#3573](https://github.com/wp-cli/wp-cli/pull/3573)]. -* `wp core language (install|update)`: - * Caches language pack downloads [[#3595](https://github.com/wp-cli/wp-cli/pull/3595)]. -* `wp core update`: - * Uses global namespace for `WP_Error` in `CoreUpgrader` class [[#3593](https://github.com/wp-cli/wp-cli/pull/3593)]. -* `wp core update-db`: - * Sets the `WP_INSTALLING` constant for the update process [[#3503](https://github.com/wp-cli/wp-cli/pull/3503)]. -* `wp package install`: - * Uses supplied version in package composer.json, instead of "dev-master" [[#3519](https://github.com/wp-cli/wp-cli/pull/3519)]. - * Adds WP-CLI version to package manager's `composer.json`, to gracefully handle WP-CLI version constraints [[#3603](https://github.com/wp-cli/wp-cli/pull/3603)]. -* `wp package list`: - * Indicates when a package has an update available [[#3611](https://github.com/wp-cli/wp-cli/pull/3611), [#3612](https://github.com/wp-cli/wp-cli/pull/3612)]. -* `wp post delete`: - * Correctly indicates revisions are deleted immediately in success message [[#3524](https://github.com/wp-cli/wp-cli/pull/3524)]. -* `wp scaffold plugin`: - * Ignores distribution archive files in `.gitignore` and `.distignore` [[#3520](https://github.com/wp-cli/wp-cli/pull/3520)]. - * Ignores `circle.yml`, `.gitlab-ci.yml` and `behat.yml` in `.distignore` [[#3599](https://github.com/wp-cli/wp-cli/pull/3599)]. -* `wp scaffold plugin-tests`: - * Checks out the data directory in `install-wp-tests.sh` to prevent notices in WP 4.7 [[#3571](https://github.com/wp-cli/wp-cli/pull/3571)]. - -Framework enhancements: - -* Updates Composer-based dependencies to latest [[#3498](https://github.com/wp-cli/wp-cli/pull/3498), [#3525](https://github.com/wp-cli/wp-cli/pull/3525)]. -* Introduces `--prompt=` to prompt for specific associative args, which lets users avoid exposing secure data in bash history [[#3531](https://github.com/wp-cli/wp-cli/pull/3531)]. -* Adds support for the version of PHP that comes with Cygwin [[#3591](https://github.com/wp-cli/wp-cli/pull/3591)]. - -Contributors to this release (pull requests, documentation, and package authors): [abea](https://github.com/abea), [anttiviljami](https://github.com/anttiviljami), [cobyan](https://github.com/cobyan), [danielbachhuber](https://github.com/danielbachhuber), [diggy](https://github.com/diggy), [ernilambar](https://github.com/ernilambar), [franz-josef-kaiser](https://github.com/franz-josef-kaiser), [greatislander](https://github.com/greatislander), [itspriddle](https://github.com/itspriddle), [miya0001](https://github.com/miya0001), [mmcev106](https://github.com/mmcev106), [mopquill](https://github.com/mopquill), [ocean90](https://github.com/ocean90), [pj-dave](https://github.com/pj-dave), [pkarjala](https://github.com/pkarjala), [richardbuff](https://github.com/richardbuff), [sommarnatt](https://github.com/sommarnatt), [szepeviktor](https://github.com/szepeviktor), [torounit](https://github.com/torounit) - -You can browse the full list of [resolved issues](https://github.com/wp-cli/wp-cli/issues?q=milestone%3A1.0.0+is%3Aclosed) on GitHub. diff --git a/_posts/2016-12-12-the-big-question.md b/_posts/2016-12-12-the-big-question.md deleted file mode 100644 index 461b6eda..00000000 --- a/_posts/2016-12-12-the-big-question.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -layout: post -author: danielbachhuber -title: How much is WP-CLI worth to you? ---- - -**[Update 2 12/15:](https://twitter.com/wpcli/status/809352614580080640)** Undecided on how much WP-CLI is worth to you? The experiment ends Dec 28th — please make a decision by then :) - -**[Update 1 (12/13):](https://twitter.com/wpcli/status/808687676010287105)** Up to 17 subscribers so far. If we can get to 50, I'll launch a members-only forum. - -Last week, I [tweeted](https://twitter.com/danielbachhuber/status/806539537610481664): - -> At a decision point with @wpcli: it’s too large for me to voluntarily maintain. Have an opinion on its future? I’d love to chat. - -Last February, I started a business, [runcommand](https://runcommand.io/), as an indirect way of being able to invest my time into WP-CLI. The business is doing alright, not great but not horrible. What I've come to realize, though, is that my time is zero-sum. I'm incentivized to spend time on runcommand, when I'd rather spend it on WP-CLI. - -Ultimately, the challenge I'm running into is opportunity cost. I'd *love* to be able to invest more into WP-CLI, but doing so comes at the cost of other business pursuits. Because WP-CLI is such a large project, the several hours I volunteer each week are basically enough to fight entropy — not make headway on larger initiatives. - -The response to my tweet has been overwhelmingly supportive. One future I'm considering is directly commercializing WP-CLI, through patreon-esque membership, advertising on the website, and other ideas to be determined. - -So, dear reader, a question: how much is WP-CLI worth to you? - -* [$7,500/year](https://runcommand.memberful.com/checkout?plan=17529) -* [$4,000/year](https://runcommand.memberful.com/checkout?plan=17577) -* [$1,500/year](https://runcommand.memberful.com/checkout?plan=17528) -* [$750/year](https://runcommand.memberful.com/checkout?plan=17553) -* [$250/year](https://runcommand.memberful.com/checkout?plan=17552) -* [$100/year](https://runcommand.memberful.com/checkout?plan=17526) - -Or, phrased another way, how much time does WP-CLI save you? - -If the experiment goes well, then we're in business! Your purchase will support ongoing maintenance of WP-CLI, as well as development of new commands like [wp doctor](https://runcommand.io/wp/doctor/) and [wp profile](https://runcommand.io/wp/profile/), [improvements to the website and package index](https://wp-cli.org/docs/wish-list/), and so on. - -If the experiment doesn't go well, then at least I can say I tried :) To avoid any risk with the investment above, a full refund will be made available to you should the campaign not reach its goal, before we look at other approaches to help with maintaining the project. - -Happy to take any questions you might have: [daniel@runcommand.io](mailto:daniel@runcommand.io). I'll keep the list below updated as new questions come in. - -*** - -*Have you tried crowdfunding?* - -Yep! See the post I wrote, "[Using Kickstarter to fund open source](https://poststatus.com/kickstarter-open-source-project/)". Nadia Eghbal has a [series of great articles on open source sustainability](http://nadiaeghbal.com/oss) as well. - -*How much money do you want to see to consider this a success?* - -I have a number, but I'm not going to share it. I want to see if this is a viable approach for funding a for-profit business. - -*What if I want to pay a different amount?* - -[Email me](mailto:daniel@runcommand.io), and I'll create a purchase link for you. - -*Do I get anything special for paying the amount I paid?* - -Potentially, but nothing to announce at this point. - -I do have some ideas in mind for offerings at different levels (e.g. members-only support forum, feature prioritization, etc.). - -*Do I need to keep paying after I pay the first time?* - -Well, if everyone cancels, then the business will tank :) - -All levels are billed annually unless you disable automatic renewal. - -*What if I'm an existing runcommand customer?* - -If the experiment goes well, then `wp doctor` and `wp profile` will become completely open source. I'll reach out about the other aspects of your purchase. - -*What about scribu and Andreas?* - -I've been talking with them a bit. We're all very interested to see how this plays out. diff --git a/_posts/2016-12-28-supporting-the-future-of-wp-cli.md b/_posts/2016-12-28-supporting-the-future-of-wp-cli.md deleted file mode 100644 index 41613db4..00000000 --- a/_posts/2016-12-28-supporting-the-future-of-wp-cli.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -layout: post -author: m -title: Supporting the Future of wp-cli ---- - -*This post [originally appeared on make/core](https://make.wordpress.org/core/2016/12/28/supporting-the-future-of-wp-cli/).* - -wp-cli is a command-line interface that is deployed and relied upon by almost every major user of WordPress out there. As we head into 2017, I wanted to make that its future is certain for everyone who builds on it, and that the major contributors to the project, chiefly Daniel Bachhuber, are able to work on it even more in the coming year. - -To that end there are two big announcements: - -1. The website of wp-cli.org, the code / GitHub, Twitter, and such are all coming in under the WordPress.org umbrella and there will be a CLI Make site with a P2 and all of the resources that used to be under wp-cli.org. There is already #cli on Slack and that will continue. (Will live at [https://make.wordpress.org/cli](https://make.wordpress.org/cli).) - -2. I’m going to be bringing together a number of companies in the WordPress ecosystem to solidify their financial support of runcommand so that Daniel and others can devote more time to making wp-cli better and better through 2017. This is a continuation of [the fundraising started a few weeks ago](https://wp-cli.org/blog/the-big-question.html). - -This will all happen the first part of January, and I’m looking to a full and exciting year for wp-cli. Also big thanks to everyone who has chipped in, whether time or money, to support the project in the past. It has been one of the highest impact developments for WP in many years. - -Many of the logistics are yet to be determined. Feel free to weigh in with questions, feedback, etc. in the comments, or join #cli on Slack. We’ll do our best to keep everyone in the loop as things develop. diff --git a/_templates/cmd-list.mustache b/_templates/cmd-list.mustache new file mode 100644 index 00000000..0fc2e3e9 --- /dev/null +++ b/_templates/cmd-list.mustache @@ -0,0 +1,6 @@ +{{#subcommands}} + + {{name}} + {{description}} + +{{/subcommands}} diff --git a/_templates/internal-api-list.mustache b/_templates/internal-api-list.mustache new file mode 100644 index 00000000..ec56d775 --- /dev/null +++ b/_templates/internal-api-list.mustache @@ -0,0 +1,9 @@ +
    + +{{#apis}} + +
  • {{full_name}}() - {{phpdoc.short_description}}
  • + +{{/apis}} + +
diff --git a/_templates/internal-api.mustache b/_templates/internal-api.mustache new file mode 100644 index 00000000..4be04f9c --- /dev/null +++ b/_templates/internal-api.mustache @@ -0,0 +1,61 @@ +--- +layout: default +title: {{full_name}}() +description: "{{phpdoc.short_description}}" +--- + +Docs » Internal API » {{category}} + +## {{full_name}}() + +{{phpdoc.short_description}} + +*** + +### Usage + + {{signature}} + +
+{{#phpdoc.parameters.param}} +{{1}} ({{0}}) {{{2}}}
+{{/phpdoc.parameters.param}} +{{#phpdoc.parameters.return}} +@return ({{0}}) {{2}}
+{{/phpdoc.parameters.return}} +
+ +{{#phpdoc.long_description}} + +*** + +### Notes + +{{{phpdoc.long_description}}} + +{{/phpdoc.long_description}} + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + +{{#has_related}} + +*** + +### Related + +
    + +{{/has_related}} + +{{#related}} + +
  • {{full_name}}() - {{phpdoc.short_description}}
  • + +{{/related}} + +{{#has_related}} + +
+ +{{/has_related}} + diff --git a/_templates/subcmd-list.mustache b/_templates/subcmd-list.mustache new file mode 100644 index 00000000..0a7ca364 --- /dev/null +++ b/_templates/subcmd-list.mustache @@ -0,0 +1,36 @@ +--- +layout: default +title: 'wp {{synopsis}}' +display_global_parameters: true +--- + +{{{breadcrumbs}}} + +`wp {{synopsis}}` - {{description}} + +Quick links: Github issues + +
+ +{{{docs}}} + +{{#has-subcommands}} +### SUBCOMMANDS + + + + + + + + + + {{#subcommands}} + + + + + {{/subcommands}} + +
NameDescription
{{name}}{{description}}
+{{/has-subcommands}} diff --git a/assets/css/stylesheet.css b/assets/css/stylesheet.css index eac55b43..b1e56edc 100644 --- a/assets/css/stylesheet.css +++ b/assets/css/stylesheet.css @@ -103,7 +103,7 @@ nav ul li:before { } blockquote { - color: #888; + color: #aaa; padding-left: 10px; border-left: 1px dotted #666; } @@ -274,39 +274,44 @@ img { */ header { - background: #000; + background: #292929; width: 100%; padding: 20px 0 10px 0; margin: 0 0 30px 0; } header h1 { - font-size: 17px; + font-size: 30px; + color: #fff; + line-height: 1.5; + margin: 0 0 0 -40px; + letter-spacing: 5px; + text-transform: uppercase; font-weight: 300; - color: #f5f5f5; - margin-top: 10px; - margin-bottom: 20px; } -@media (max-width: 970px) { - header h1 { - margin-left: 0; - } +header h1 a { + color: #fff; + text-decoration: none } -@media (max-width: 690px) { - /* Avoid collision with the language selector */ - header h1 { - padding-top: 40px; - } +header h1 a:hover, +header h1 a:active { + color: #F7F7F7; } -header h1 img { - vertical-align: middle; +header h1:before { + content: ". / "; + + letter-spacing: 1px; } -header h1 span { - margin-left: 10px; +header h2 { + font-size: 17px; + font-weight: 300; + color: #f5f5f5; + margin-top: 10px; + margin-bottom: 20px; } footer { @@ -346,7 +351,7 @@ footer { color: #b5e853; } -.main-nav ul li:nth-child(5) a { +.main-nav ul li:nth-child(6) a { background-color: rgba(122, 208, 58, 0.5); color: white; border-radius: 5px; @@ -451,13 +456,6 @@ body.display-global-parameters #main_content { -webkit-font-smoothing: antialiased; } -@media (max-width: 970px) { - #main_content { - padding: 0; /* parent .container will provide needed spacement */ - margin: 0; - } -} - #main_content h1 { font-size: 30px; } @@ -595,6 +593,9 @@ body.configuration .global-parameters{ } + + + /* Blog */ .hentry + .hentry { @@ -661,7 +662,7 @@ hr:after, padding-bottom: 1em; } -/* Announcement within posts */ +/* Accouncement within posts */ .announcement { padding: 0.3em 1em 0.5em 1em; margin-bottom: 1em; @@ -727,8 +728,14 @@ hr:after, } } +@media (max-width: 970px) { + header h1 { + margin-left: 0; + } +} + @media (max-width: 690px) { - .main-nav li:not(:nth-child(5)) a { + .main-nav li a { padding-left: 0; } diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico new file mode 100644 index 00000000..558a8d43 Binary files /dev/null and b/assets/img/favicon.ico differ diff --git a/assets/img/favicon.jpg b/assets/img/favicon.jpg deleted file mode 100644 index 4f3163e1..00000000 Binary files a/assets/img/favicon.jpg and /dev/null differ diff --git a/assets/img/wp-cli-logo-inverted.png b/assets/img/wp-cli-logo-inverted.png deleted file mode 100644 index 86d13b54..00000000 Binary files a/assets/img/wp-cli-logo-inverted.png and /dev/null differ diff --git a/assets/img/wp-cli-logo.png b/assets/img/wp-cli-logo.png deleted file mode 100644 index e922c05f..00000000 Binary files a/assets/img/wp-cli-logo.png and /dev/null differ diff --git a/behat-data/audio-with-400x300-cover.mp3 b/behat-data/audio-with-400x300-cover.mp3 deleted file mode 100644 index bb6922c7..00000000 Binary files a/behat-data/audio-with-400x300-cover.mp3 and /dev/null differ diff --git a/behat-data/audio-with-no-cover.mp3 b/behat-data/audio-with-no-cover.mp3 deleted file mode 100644 index 5f8ba9c4..00000000 Binary files a/behat-data/audio-with-no-cover.mp3 and /dev/null differ diff --git a/behat-data/minimal-us-letter.pdf b/behat-data/minimal-us-letter.pdf deleted file mode 100644 index 7e7b75b8..00000000 Binary files a/behat-data/minimal-us-letter.pdf and /dev/null differ diff --git a/behat-data/test.pdf b/behat-data/test.pdf deleted file mode 100644 index 79b26dc6..00000000 Binary files a/behat-data/test.pdf and /dev/null differ diff --git a/behat-data/video-400x300-with-cover.mp4 b/behat-data/video-400x300-with-cover.mp4 deleted file mode 100644 index 13a9073f..00000000 Binary files a/behat-data/video-400x300-with-cover.mp4 and /dev/null differ diff --git a/behat-data/video-400x300-with-no-cover.mp4 b/behat-data/video-400x300-with-no-cover.mp4 deleted file mode 100644 index 63e0ff9e..00000000 Binary files a/behat-data/video-400x300-with-no-cover.mp4 and /dev/null differ diff --git a/behat-data/white-150-square.jpg b/behat-data/white-150-square.jpg deleted file mode 100644 index eb600922..00000000 Binary files a/behat-data/white-150-square.jpg and /dev/null differ diff --git a/behat-data/white-160-square.bmp b/behat-data/white-160-square.bmp deleted file mode 100644 index 047b941c..00000000 Binary files a/behat-data/white-160-square.bmp and /dev/null differ diff --git a/br/index.md b/br/index.md index cda05582..75a6421c 100644 --- a/br/index.md +++ b/br/index.md @@ -1,159 +1,135 @@ --- layout: default -title: Interface para linha de comando para o WordPress -direction: ltr +title: Interface para linha de comando em WordPress --- -[WP-CLI](https://wp-cli.org/) é a interface em linha de comando para o [WordPress](https://br.wordpress.org/). Você pode atualizar plugins, configurar instalações multisite e muito mais, sem utilizar um navegador web. +[WP-CLI](https://wp-cli.org/) é um conjunto de linhas de comando para gerenciar instalações [WordPress](https://wordpress.org/). Você pode atualizar plugins, configurar instalações multisite e muito mais, sem utilizar um navegador web. -A manutenção contínua é possível graças aos seguintes patrocinadores: +Para manter-se atualizado, siga [@wpcli no Twitter](https://twitter.com/wpcli) ou [inscreva-se em nossa newsletter](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). - - - - - - +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Tempo médio para resolver um issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Percentual de issues ainda abertos") -A versão estável mais recente é a [2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). Para manter-se atualizado, siga [@wpcli no Twitter](https://twitter.com/wpcli) ou [assine nossa newsletter](https://make.wordpress.org/cli/subscribe/). [Leia nosso plano de ação](https://make.wordpress.org/cli/handbook/roadmap/) para uma visão geral do que está sendo planejado para próximas versões. +
-[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Tempo médio para resolver um issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentual de issues ainda abertos") +

O projeto "WP-CLI mais RESTful" visa proporcionar todo o potencial da linha de comando para a WP REST API e é apoiado por Pressed, Chris Lema, Human Made, Pagely, Pantheon e muitos outros. Saiba mais →

+
-Links rápidos: [Usando](#usando) | [Instalando](#instalando) | [Suporte](#suporte) | [Estendendo](#estendendo) | [Contribuindo](#contribuindo) | [Créditos](#créditos) +Links rápidos: [Usando](#usando) | [Instalando](#instalando) | [Suporte](#suporte) | [Extendendo](#extendendo) | [Contribuindo](#contribuindo) | [Créditos](#creditos) ## Usando -O objetivo da WP-CLI é fornecer uma interface em linha de comando para muitas das ações que você pode executar na administração do WordPress. Por exemplo, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) permite a instalação e ativação de um plugin WordPress: +O objetivo da WP-CLI é fornecer uma interface em linha de comando para qualquer ação que você queira executar na administração do WordPress. Por exemplo `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) permite a instação e ativação de um plugin WordPress: -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... +``` +$ wp plugin install rest-api --activate +Installing WordPress REST API (Version 2) (2.0-beta13) +Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. +Activating 'rest-api'... +Success: Plugin 'rest-api' activated. ``` -A WP-CLI também inclui muitos comandos para ações que não são possíveis através da administração do WordPress. Por exemplo, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) permite excluir um ou todos os transients: +WP-CLI também inclui muitos comandos para ações que não são possíveis através da administração do WordPress. Por exemplo, `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) permite deletar uma ou todas as transients: -```bash -$ wp transient delete --all +``` +$ wp transient delete-all Success: 34 transients deleted from the database. ``` -Para uma introdução mais completa sobre como usar a WP-CLI, leia o [Guia rápido](https://make.wordpress.org/cli/handbook/quick-start/). Veja também os [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) para saber mais sobre utilitários de linha de comando. +Para uma introdução mais completa sobre como usar a WP-CLI, leia o [Guia rápido](https://wp-cli.org/docs/quick-start/). -Já se sente confortável com o básico? Vá para a [lista completa de comandos](https://developer.wordpress.org/cli/commands/) para informações detalhadas sobre gerenciamento de temas e plugins, importação e exportação de dados, operações de busca e substituição no banco de dados e muito mais. +Já se sente confortável com o básico? Vá para a [lista completa de comandos](https://wp-cli.org/commands/) para obter informações detalhadas na gestão de temas e plugins, importação e exportação de dados, operações de busca e substituição no banco de dados e muito mais. ## Instalando -Baixar o arquivo Phar é o método de instalação que recomendamos para a maioria dos usuários. Caso precise, veja também a documentação sobre [métodos alternativos de instalação](https://make.wordpress.org/cli/handbook/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)). +Realizar o download do arquivo Phar é o método de instalação que recomendamos. Caso precise, nossa documentação para [métodos alternativos de instação](https://wp-cli.org/docs/installing/). -Antes de instalar a WP-CLI, tenha certeza de que seu ambiente cumpre os requisitos mínimos: +Antes instalar a WP-CLI, certifique-se que seu ambiente possua os requesitos mínimos: - Ambiente UNIX-like (OS X, Linux, FreeBSD, Cygwin); suporte limitado para ambientes Windows -- PHP 5.6 ou superior -- WordPress 3.7 ou superior. Versões do WordPress anteriores à mais recente podem ter funcionalidade reduzida +- PHP 5.3.29 ou superior +- WordPress 3.7 ou superior -Após verificar os requisitos, baixe o arquivo [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) usando `wget` ou `curl`: +Após verificar os requesitos, faça o download do arquivo [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) usando `wget` ou `curl`: -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` +$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` -Em seguida, verifique se o arquivo phar está funcionando: +Em seguida, verifique se está funcionando: -```bash -php wp-cli.phar --info +``` +$ php wp-cli.phar --info ``` -Para usar a WP-CLI na linha de comando usando apenas `wp`, torne o arquivo executável e mova-o para algum diretório presente em sua variável de ambiente PATH. Por exemplo: +Digite `wp` para utilizar WP-CLI a partir da linha de comando, torne o arquivo executável e mova-o para algum diretório presente em sua variável de ambiente PATH. For example: -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp +``` +$ chmod +x wp-cli.phar +$ sudo mv wp-cli.phar /usr/local/bin/wp ``` -Se a WP-CLI foi instalada corretamente, ao executar `wp --info` você deverá ver algo como: +Se WP-CLI foi instalado com sucesso, ao executar `wp --info` você deverá ver algo como: -```bash +``` $ wp --info -OS: Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 -Shell: /usr/bin/zsh -PHP binary: /usr/bin/php -PHP version: 8.0.5 -php.ini used: /etc/php/8.0/cli/php.ini -MySQL binary: /usr/bin/mysql -MySQL version: mysql Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) -SQL modes: -WP-CLI root dir: /home/wp-cli/ -WP-CLI vendor dir: /home/wp-cli/vendor -WP_CLI phar path: +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: -WP-CLI project config: /home/wp-cli/wp-cli.yml -WP-CLI version: 2.12.0 +WP-CLI global config: /home/wp-cli/.wp-cli/config.yml +WP-CLI project config: +WP-CLI version: 0.23.0 ``` ### Atualizando -WP-CLI pode ser atualizada com `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)) ou repetindo os passos da instalação. - -Se o proprietário do arquivo da WP-CLI for root ou outro usuário do sistema, será necessário executar `sudo wp cli update`. +WP-CLI pode ser atualizado com `wp cli update` ([doc](https://wp-cli.org/commands/cli/update/)), ou repetindo os passos da instalação. -Quer viver no limite? Execute `wp cli update --nightly` para usar a última compilação de desenvolvimento da WP-CLI. Essa versão é estável o suficiente para ser usada em seu ambiente de desenvolvimento e sempre inclui as melhores e mais recentes funcionalidades da WP-CLI. +_Quer viver a vida no limite?_ Execute `wp cli update --nightly` para usar a última compilação de desenvolvimento da WP-CLI. Essa versão é bastante estável para utilizar em seu ambiente de desenvolvimento, e sempre inclui as melhores e mais atuais funcionalidades da WP-CLI. -### Autocompletar com tab +### Auto-completar -A WP-CLI também possui scripts de autocompletar para Bash ou ZSH. Baixe [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) e carregue-o através do `~/.bash_profile`: +WP-CLI também acompanha scripts de auto-completar para Bash ou ZSH. Faça o download [wp-completion.bash](https://github.com/wp-cli/wp-cli/raw/master/utils/wp-completion.bash) e carregue o arquivo para `~/.bash_profile`: -```bash +``` source /FULL/PATH/TO/wp-completion.bash ``` Não se esqueça de executar `source ~/.bash_profile` em seguida. -Se estiver usando zsh como shell, pode ser necessário carregar e iniciar `bashcompinit` antes de carregá-lo. Inclua o seguinte no seu `.zshrc`: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - ## Suporte -Os responsáveis e os colaboradores da WP-CLI possuem disponibilidade limitada para atender a questões gerais de suporte. A [versão atual da WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) é a única com suporte oficial. - -Ao procurar por suporte, pesquise primeiro por sua dúvida nas fontes abaixo: +Os colaboradores do projeto WP-CLI fazem seu melhor para rsponder a todos os problemas assim que possível. Para que possamos fazer melhor uso do tempo dos voluntários, verifique se já existe uma resposta para sua pergunta em umas das fontes abaixo: -* [Questões comuns e suas respostas](https://make.wordpress.org/cli/handbook/common-issues/) -* [Manual da WP-CLI](https://make.wordpress.org/cli/handbook/) -* [Questões abertas ou fechadas no GitHub da WP-CLI](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* [Tópicos com a tag 'WP-CLI' no fórum de suporte do WordPress.org](https://wordpress.org/support/topic-tag/wp-cli/) -* [Questões com a tag 'WP-CLI' no WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) +- [Questões comuns e suas respostas](https://wp-cli.org/docs/common-issues/) +- [Melhores práticas para informar um problema](https://wp-cli.org/docs/bug-reports/) +- [Portal de documentação](https://wp-cli.org/docs/) +- [Questões abertas ou fechadas no Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [Forum WordPress no StackExchange](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -Se você não encontrou uma resposta em nenhum dos endereços acima, você pode: +Caso não encontre uma resposta na fontes existentes, fique a vontade para [abrir uma questão](https://github.com/wp-cli/wp-cli/issues/new) com sua dúvida. -* Entrar para o canal `#cli` no [Slack Internacional do WordPress.org](https://make.wordpress.org/chat/) para conversar com quem estiver disponível no momento. Esta opção é a melhor para perguntas rápidas. -* [Criar um novo tópico](https://wordpress.org/support/forum/wp-advanced/#new-post) no fórum internacional do WordPress.org e colocar a tag 'WP-CLI' para que ele seja encontrado pela comunidade. +Se você possui uma conta WordPress.org, considere se inscrever no canal `#cli` no [Slack do WordPress.org](https://make.wordpress.org/chat/). -Issues do GitHub são usadas para acompanhar melhorias e erros dos comandos existentes, não para suporte em geral. Antes de informar um erro, veja [nossas boas práticas](https://make.wordpress.org/cli/handbook/bug-reports/) para que o problema possa ser resolvido em tempo hábil. +## Extendendo -Não faça perguntas de suporte no Twitter. O Twitter não é um lugar aceitável para suporte porque: 1) é difícil conversar com apenas 280 caracteres e 2) o Twitter não é um lugar onde alguém com a mesma pergunta possa procurar por uma resposta de uma conversa anterior. +Um **commando** é uma unidade singular de uma funcionalidade WP-CLI. `wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) é um comando. `wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) é outro. -Lembre-se: libre != gratis; A licença do código aberto dá para você a liberdade de usar e modificar, mas não gera compromissos com o tempo dos outros. Seja respeitoso e regule suas expectativas. +A WP-CLI suporta o registro de qualquer classe ou função como um comando, lendo os detalhes de uso através de _PHPdoc Callback_. `WP_CLI::add_command()` ([doc](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) é utilizado para registo de comandos internos e de terceiros. -## Estendendo -Um **comando** é a unidade atômica de funcionalidade da WP-CLI. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) é um comando. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) é outro. - -A WP-CLI suporta o registro de qualquer classe ou função como um comando. Ela lê os detalhes de uso através do callback do PHPdoc. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) é usado para registo de comandos internos e de terceiros. - -```php +``` /** * Delete an option from the database. * @@ -181,31 +157,36 @@ $delete_option_cmd = function( $args ) { WP_CLI::add_command( 'option delete', $delete_option_cmd ); ``` -A WP-CLI vem com vários comandos. Criar um comando personalizado para WP-CLI é mais fácil do que parece. Leia o [livro de receitas de comandos](https://make.wordpress.org/cli/handbook/commands-cookbook/) para saber mais. Navegue pela [documentação de API interna](https://make.wordpress.org/cli/handbook/internal-api/) para descobrir umaa variedade de funções úteis que você pode utilizar no seu comando personalizado para WP-CLI. +WP-CLI vem com muitos comandos. Criar um comando personalizado para WP-CLi é mais fácil do que parece. Leia o [livro de receitas de comandos](https://wp-cli.org/docs/commands-cookbook/) para aprender mais. Procure a [documentação de API interna](https://wp-cli.org/docs/internal-api/) para descobrir a variedade de funcionalidades úteis que você pode utilizar no seu comando personalizado para WP-CLI. ## Contribuindo -Nós agradecemos sua iniciativa em contribuir com a WP-CLI. É por sua causa, e pela comunidade à sua volta, que a WP-CLI é um projeto tão legal. +Seja bem vindo e obrigado! + +Nós agradecemos sua iniciativa em contribuir com a WP-CLI. É por sua causa e a comunidade a sua volta, que a WP-CLI se tornou um grande projeto. -**Contribuir não é limitado somente a código.** Nós encorajamos você a contribuir da maneira que melhor se encaixar em suas habilidades, escrevendo tutoriais, com demonstrações em meetups locais, ajudando outros usuários respondendo suas dúvidas no fórum ou revisando nossa documentação. +**Contribuir não é limitado a somente código.** Te encorajamos a contribuir da maneira que melhor se encaixe em suas habilidades, escrevendo tutoriais, com demonstrações em palestras locais, ajudar outros usuários respondendo suas dúvidas no suporte, ou revisando nossa documentação. -No manual, dê uma olhada nas nossas [diretrizes para contribuir](https://make.wordpress.org/cli/handbook/contributing/) para uma introdução completa sobre como participar. Seguir esses passos ajuda a passar a ideia de que você respeita o tempo dos outros colaboradores. Por sua vez, eles farão o melhor para retribuir esse respeito ao trabalhar com você, nos diferentes fusos horários, em todo o mundo. +De uma olhada com atenção [nesse guia](https://wp-cli.org/docs/contributing/). Seguindo esses passos você estará respeitando o tempo dos outros colaboradoes. Por sua vez, eles farão o melhor para retribuir esse respeito no trabalho com você, nos diferentes fusos horários e em todo o mundo. -## Liderança +## Criadores e liderança -A WP-CLI tem um responsável pelo projeto: [schlessera](https://github.com/schlessera). +WP-CLI foi criado e mantido por: -Quando necessário, [damos permissão de escrita para colaboradores](https://make.wordpress.org/cli/handbook/committers-credo/) que demonstraram sua capacidade durante algum tempo e que se esforçaram para levar o projeto adiante. +* [Daniel Bachhuber](https://github.com/danielbachhuber/) - Líder atual +* [Cristi Burcă](https://github.com/scribu) - Líder anterior +* [Andreas Creten](https://github.com/andreascreten) - Criador -Leia o [documento sobre governança no manual](https://make.wordpress.org/cli/handbook/governance/) para mais detalhes operacionais do projeto. +Saiba mais sobre os projetos de [governança](https://wp-cli.org/docs/governance/) e veja a [lista completa dos colaboradores](https://github.com/wp-cli/wp-cli/contributors). ## Créditos + -Além das bibliotecas especificadas em [composer.json](/composer.json), usamos código ou ideias dos projetos abaixos: +Além das bibliotecas especificadas em [composer.json](/composer.json), utilizamos o código ou idéias dos projetos abaixos: -* [Drush](https://github.com/drush-ops/drush) para... muitas coisas -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) para `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) para `wp media regenerate` +* [Drush](http://drush.ws/) para... muitas coisas +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) para `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) para `wp media regenerate` * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) para `wp search-replace` * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) para `wp export` * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) para `wp import` diff --git a/command.php b/command.php index a99bbe70..fd4d7cd3 100644 --- a/command.php +++ b/command.php @@ -2,24 +2,13 @@ namespace WP_CLI_Org; use WP_CLI; -use Mustache_Engine; /** * WP-CLI commands for generating the docs */ /** - * Run all generation commands to generate full website. - * - * @when before_wp_load - */ -function generate() { - generate_homepage(); -} -WP_CLI::add_command( 'website generate', 'WP_CLI_Org\generate' ); - -/** - * Generate the homepage from WP-CLI's README.md + * Generate the homepage from the repo's README.md * * @when before_wp_load */ @@ -55,15 +44,192 @@ function generate_homepage() { } WP_CLI::add_command( 'website generate-homepage', '\WP_CLI_Org\generate_homepage' ); -function invoke_wp_cli( $cmd ) { - ob_start(); - system( "WP_CLI_CONFIG_PATH=/dev/null $cmd", $return_code ); - $json = ob_get_clean(); +/** + * Generate the contributing page from the repo's CONTRIBUTING.md + * + * @when before_wp_load + */ +function generate_contributing() { + $ret = trim( shell_exec( 'which wp' ) ); + if ( empty( $ret ) ) { + WP_CLI::error( 'Could not find path to wp executable.' ); + } + if ( 'link' === filetype( $ret ) ) { + $ret = readlink( $ret ); + } - if ( $return_code ) { - echo "WP-CLI returned error code: $return_code\n"; - exit(1); + $contributing_path = dirname( dirname( $ret ) ) . '/CONTRIBUTING.md'; + if ( ! is_file( $contributing_path ) ) { + WP_CLI::error( 'Could not find CONTRIBUTING.md in wp executable PATH. Please make sure wp executable points to git clone.' ); } - return json_decode( $json, true ); + $contents = file_get_contents( $contributing_path ); + $search = <<getDocComment(); + if ( false === stripos( $phpdoc, '@access public' ) ) { + continue; + } + $apis[] = get_simple_representation( $reflection ); + } + $classes = get_declared_classes(); + foreach( $classes as $class ) { + if ( false === stripos( $class, 'WP_CLI' ) ) { + continue; + } + $reflection = new \ReflectionClass( $class ); + foreach( $reflection->getMethods() as $method ) { + $method_reflection = new \ReflectionMethod( $method->class, $method->name ); + $phpdoc = $method_reflection->getDocComment(); + if ( false === stripos( $phpdoc, '@access public' ) ) { + continue; + } + $apis[] = get_simple_representation( $method_reflection ); + } + } + echo json_encode( $apis ); +} +\WP_CLI::add_command( 'api-dump', '\WP_CLI_Org\api_dump' ); + +/** + * Get a simple representation of a function or method + * + * @param Reflection + * @return array + */ +function get_simple_representation( $reflection ) { + $signature = $reflection->getName(); + $parameters = array(); + foreach( $reflection->getParameters() as $parameter ) { + $parameter_signature = '$' . $parameter->getName(); + if ( $parameter->isOptional() ) { + $default_value = $parameter->getDefaultValue(); + if ( false === $default_value ) { + $parameter_signature .= ' = false'; + } else if ( array() === $default_value ) { + $parameter_signature .= ' = array()'; + } else if ( '' === $default_value ) { + $parameter_signature .= " = ''"; + } else if ( null === $default_value ) { + $parameter_signature .= ' = null'; + } else if ( true === $default_value ) { + $parameter_signature .= ' = true'; + } else { + $parameter_signature .= ' = ' . $default_value; + } + } + $parameters[] = $parameter_signature; + } + if ( ! empty( $parameters ) ) { + $signature = $signature . '( ' . implode( ', ', $parameters ) . ' )'; + } else { + $signature = $signature . '()'; + } + $phpdoc = $reflection->getDocComment(); + $type = strtolower( str_replace( 'Reflection', '', get_class( $reflection ) ) ); + $class = ''; + switch ( $type ) { + case 'function': + $full_name = $reflection->getName(); + break; + case 'method': + $separator = $reflection->isStatic() ? '::' : '->'; + $class = $reflection->class; + $full_name = $class . $separator . $reflection->getName(); + $signature = $class . $separator . $signature; + break; + } + return array( + 'phpdoc' => parse_docblock( $phpdoc ), + 'type' => $type, + 'signature' => $signature, + 'short_name' => $reflection->getShortName(), + 'full_name' => $full_name, + 'class' => $class, + ); +} + +/** + * Parse PHPDoc into a structured representation + */ +function parse_docblock( $docblock ) { + $ret = array( + 'description' => '', + 'parameters' => array(), + ); + $extra_line = ''; + $in_param = false; + foreach( preg_split("/(\r?\n)/", $docblock ) as $line ){ + if ( preg_match('/^(?=\s+?\*[^\/])(.+)/', $line, $matches ) ) { + $info = trim( $matches[1] ); + $info = preg_replace( '/^(\*\s+?)/', '', $info ); + if ( $in_param ) { + list( $param, $key ) = $in_param; + $ret['parameters'][ $param_name ][ $key ][2] .= PHP_EOL . $info; + if ( '}' === substr( $info, -1 ) ) { + $in_param = false; + } + } else if ( $info[0] !== "@" ) { + $ret['description'] .= PHP_EOL . "{$extra_line}{$info}"; + } else { + preg_match( '/@(\w+)/', $info, $matches ); + $param_name = $matches[1]; + $value = str_replace( "@$param_name ", '', $info ); + if ( ! isset( $ret['parameters'][ $param_name ] ) ) { + $ret['parameters'][ $param_name ] = array(); + } + $ret['parameters'][ $param_name ][] = preg_split( '/[\s]+/', $value, 3 ); + end( $ret['parameters'][ $param_name ] ); + $key = key( $ret['parameters'][ $param_name ] ); + reset( $ret['parameters'][ $param_name ] ); + if ( ! empty( $ret['parameters'][ $param_name ][ $key ][ 2 ] ) + && '{' === substr( $ret['parameters'][ $param_name ][ $key ][ 2 ] , -1 ) ) { + $in_param = array( $param_name, $key ); + } + } + $extra_line = ''; + } else { + $extra_line .= PHP_EOL; + } + } + $ret['description'] = str_replace( '\/', '/', trim( $ret['description'], PHP_EOL ) ); + $bits = explode( PHP_EOL, $ret['description'] ); + $ret['short_description'] = array_shift( $bits ); + $long_description = trim( implode( PHP_EOL, $bits ), PHP_EOL ); + $ret['long_description'] = $long_description; + return $ret; } diff --git a/commands/blog/create/index.md b/commands/blog/create/index.md index 3502b1a0..6309a190 100644 --- a/commands/blog/create/index.md +++ b/commands/blog/create/index.md @@ -1,4 +1,5 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/create/ ---- \ No newline at end of file +layout: default +title: 'wp blog create' +--- +The `wp blog create` command has been renamed to [wp site create](/commands/site/create) in WP-CLI 0.11. diff --git a/commands/blog/delete/index.md b/commands/blog/delete/index.md index 312f171c..e0bd27f4 100644 --- a/commands/blog/delete/index.md +++ b/commands/blog/delete/index.md @@ -1,4 +1,5 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/delete/ ---- \ No newline at end of file +layout: default +title: 'wp blog delete' +--- +The `wp blog delete` command has been renamed to [wp site delete](/commands/site/delete) in WP-CLI 0.11. diff --git a/commands/blog/empty/index.md b/commands/blog/empty/index.md index 3017c434..e6219d29 100644 --- a/commands/blog/empty/index.md +++ b/commands/blog/empty/index.md @@ -1,4 +1,5 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/empty/ ---- \ No newline at end of file +layout: default +title: 'wp blog empty' +--- +The `wp blog empty` command has been renamed to [wp site empty](/commands/site/empty) in WP-CLI 0.11. diff --git a/commands/blog/index.md b/commands/blog/index.md index 39ca96ed..eaf889a0 100644 --- a/commands/blog/index.md +++ b/commands/blog/index.md @@ -1,4 +1,5 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/ ---- \ No newline at end of file +layout: default +title: 'wp blog' +--- +The `wp blog` command has been renamed to [wp site](/commands/site) in WP-CLI 0.11. diff --git a/commands/cache/add/index.md b/commands/cache/add/index.md index 8e39e41b..2c5688d5 100644 --- a/commands/cache/add/index.md +++ b/commands/cache/add/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/add/ ---- \ No newline at end of file +layout: default +title: 'wp cache add' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » add + +`wp cache add` - Add a value to the object cache. + +Quick links: Github issues + +
+ +If a value already exists for the key, the value isn't added. + +### OPTIONS + +<key> +: Cache key. + +<value> +: Value to add to the key. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +[<expiration>] +: Define how long to keep the value, in seconds. `0` means as long as possible. +\--- +default: 0 +\--- + +### EXAMPLES + + # Add cache. + $ wp cache add my_key my_group my_value 300 + Success: Added object 'my_key' in group 'my_value'. + + + diff --git a/commands/cache/decr/index.md b/commands/cache/decr/index.md index 2601c83f..d3f694c0 100644 --- a/commands/cache/decr/index.md +++ b/commands/cache/decr/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/decr/ ---- \ No newline at end of file +layout: default +title: 'wp cache decr' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » decr + +`wp cache decr` - Decrement a value in the object cache. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Cache key. + +[<offset>] +: The amount by which to decrement the item's value. Default is 1. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +### EXAMPLES + + # Decrease cache value. + $ wp cache decr my_key 2 my_group + 48 + + + diff --git a/commands/cache/delete/index.md b/commands/cache/delete/index.md index 2b321377..5071c756 100644 --- a/commands/cache/delete/index.md +++ b/commands/cache/delete/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/delete/ ---- \ No newline at end of file +layout: default +title: 'wp cache delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » delete + +`wp cache delete` - Remove a value from the object cache. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Cache key. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +### EXAMPLES + + # Delete cache. + $ wp cache delete my_key my_group + Success: Object deleted. + + + diff --git a/commands/cache/flush/index.md b/commands/cache/flush/index.md index 7063e12c..4144dff4 100644 --- a/commands/cache/flush/index.md +++ b/commands/cache/flush/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/flush/ ---- \ No newline at end of file +layout: default +title: 'wp cache flush' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » flush + +`wp cache flush` - Flush the object cache. + +Quick links: Github issues + +
+ +For sites using a persistent object cache, because WordPress Multisite simply adds a blog id +to the cache key, flushing cache is typically a global operation. + +### EXAMPLES + + # Flush cache. + $ wp cache flush + Success: The cache was flushed. + + + diff --git a/commands/cache/get/index.md b/commands/cache/get/index.md index 5fcfebff..5b84a6ae 100644 --- a/commands/cache/get/index.md +++ b/commands/cache/get/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/get/ ---- \ No newline at end of file +layout: default +title: 'wp cache get' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » get + +`wp cache get` - Get a value from the object cache. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Cache key. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +### EXAMPLES + + # Get cache. + $ wp cache get my_key my_group + my_value + + + diff --git a/commands/cache/incr/index.md b/commands/cache/incr/index.md index 3cc26adc..d926f2ce 100644 --- a/commands/cache/incr/index.md +++ b/commands/cache/incr/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/incr/ ---- \ No newline at end of file +layout: default +title: 'wp cache incr' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » incr + +`wp cache incr` - Increment a value in the object cache. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Cache key. + +[<offset>] +: The amount by which to increment the item's value. Default is 1. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +### EXAMPLES + + # Increase cache value. + $ wp cache incr my_key 2 my_group + 50 + + + diff --git a/commands/cache/index.md b/commands/cache/index.md index a08cf894..357e9557 100644 --- a/commands/cache/index.md +++ b/commands/cache/index.md @@ -1,4 +1,76 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/ ---- \ No newline at end of file +layout: default +title: 'wp cache' +display_global_parameters: true +--- + +[Commands](/commands/) » cache + +`wp cache` - Manage the object cache. + +Quick links: Github issues + +
+ +Note: Persistent Object Caching is needed for these commands. + +### EXAMPLES + + # Set cache. + $ wp cache set my_key my_value my_group 300 + Success: Set object 'my_key' in group 'my_group'. + + # Get cache. + $ wp cache get my_key my_group + my_value + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a value to the object cache.
decrDecrement a value in the object cache.
deleteRemove a value from the object cache.
flushFlush the object cache.
getGet a value from the object cache.
incrIncrement a value in the object cache.
replaceReplace a value in the object cache, if the value already exists.
setSet a value to the object cache, regardless of whether it already exists.
typeAttempts to determine which object cache is being used.
diff --git a/commands/cache/replace/index.md b/commands/cache/replace/index.md index 920bf711..aa531cd1 100644 --- a/commands/cache/replace/index.md +++ b/commands/cache/replace/index.md @@ -1,4 +1,39 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/replace/ ---- \ No newline at end of file +layout: default +title: 'wp cache replace' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » replace + +`wp cache replace` - Replace a value in the object cache, if the value already exists. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Cache key. + +<value> +: Value to replace. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +[<expiration>] +: Define how long to keep the value, in seconds. `0` means as long as possible. +\--- +default: 0 +\--- + +### EXAMPLES + + # Replace cache. + $ wp cache replace my_key new_value my_group + Success: Replaced object 'my_key' in group 'my_group'. + + + diff --git a/commands/cache/set/index.md b/commands/cache/set/index.md index 28c99103..de3e6967 100644 --- a/commands/cache/set/index.md +++ b/commands/cache/set/index.md @@ -1,4 +1,39 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/set/ ---- \ No newline at end of file +layout: default +title: 'wp cache set' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » set + +`wp cache set` - Set a value to the object cache, regardless of whether it already exists. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Cache key. + +<value> +: Value to set on the key. + +[<group>] +: Method for grouping data within the cache which allows the same key to be used across groups. + +[<expiration>] +: Define how long to keep the value, in seconds. `0` means as long as possible. +\--- +default: 0 +\--- + +### EXAMPLES + + # Set cache. + $ wp cache set my_key my_value my_group 300 + Success: Set object 'my_key' in group 'my_group'. + + + diff --git a/commands/cache/type/index.md b/commands/cache/type/index.md index 0ed8cc83..588ed9ad 100644 --- a/commands/cache/type/index.md +++ b/commands/cache/type/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cache/type/ ---- \ No newline at end of file +layout: default +title: 'wp cache type' +display_global_parameters: true +--- + +[Commands](/commands/) » [cache](/commands/cache/) » type + +`wp cache type` - Attempts to determine which object cache is being used. + +Quick links: Github issues + +
+ +Note that the guesses made by this function are based on the WP_Object_Cache classes +that define the 3rd party object cache extension. Changes to those classes could render +problems with this function's ability to determine which object cache is being used. + +### EXAMPLES + + # Check cache type. + $ wp cache type + Default + + + diff --git a/commands/cap/add/index.md b/commands/cap/add/index.md index 9ec05e62..d5afff25 100644 --- a/commands/cap/add/index.md +++ b/commands/cap/add/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cap/add/ ---- \ No newline at end of file +layout: default +title: 'wp cap add' +display_global_parameters: true +--- + +[Commands](/commands/) » [cap](/commands/cap/) » add + +`wp cap add` - Add capabilities to a given role. + +Quick links: Github issues + +
+ +### OPTIONS + +<role> +: Key for the role. + +<cap>... +: One or more capabilities to add. + +### EXAMPLES + + # Add 'spectate' capability to 'author' role + $ wp cap add author spectate + Success: Added 1 capabilities to 'author' role. + + + diff --git a/commands/cap/index.md b/commands/cap/index.md index 9a3cd08f..0c278915 100644 --- a/commands/cap/index.md +++ b/commands/cap/index.md @@ -1,4 +1,54 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cap/ ---- \ No newline at end of file +layout: default +title: 'wp cap' +display_global_parameters: true +--- + +[Commands](/commands/) » cap + +`wp cap` - Manage user capabilities. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Add 'spectate' capability to 'author' role + $ wp cap add 'author' 'spectate' + Success: Added 1 capabilities to 'author' role. + + # Add all caps from 'editor' role to 'author' role + $ wp cap list 'editor' | xargs wp cap add 'author' + Success: Added 24 capabilities to 'author' role. + + # Remove all caps from 'editor' role that also appear in 'author' role + $ wp cap list 'author' | xargs wp cap remove 'editor' + Success: Removed 34 capabilities from 'editor' role. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd capabilities to a given role.
listList capabilities for a given role.
removeRemove capabilities from a given role.
diff --git a/commands/cap/list/index.md b/commands/cap/list/index.md index cadf22f5..022a4e8d 100644 --- a/commands/cap/list/index.md +++ b/commands/cap/list/index.md @@ -1,4 +1,44 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cap/list/ ---- \ No newline at end of file +layout: default +title: 'wp cap list' +display_global_parameters: true +--- + +[Commands](/commands/) » [cap](/commands/cap/) » list + +`wp cap list` - List capabilities for a given role. + +Quick links: Github issues + +
+ +### OPTIONS + +<role> +: Key for the role. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: list +options: + - list + - table + - csv + - json + - count + - yaml +\--- + +### EXAMPLES + + # Display alphabetical list of Contributor capabilities + $ wp cap list 'contributor' | sort + delete_posts + edit_posts + level_0 + level_1 + read + + + diff --git a/commands/cap/remove/index.md b/commands/cap/remove/index.md index a88a4f31..80c4548c 100644 --- a/commands/cap/remove/index.md +++ b/commands/cap/remove/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cap/remove/ ---- \ No newline at end of file +layout: default +title: 'wp cap remove' +display_global_parameters: true +--- + +[Commands](/commands/) » [cap](/commands/cap/) » remove + +`wp cap remove` - Remove capabilities from a given role. + +Quick links: Github issues + +
+ +### OPTIONS + +<role> +: Key for the role. + +<cap>... +: One or more capabilities to remove. + +### EXAMPLES + + # Remove 'spectate' capability from 'author' role + $ wp cap remove author spectate + Success: Removed 1 capabilities from 'author' role. + + + diff --git a/commands/cli/alias/index.md b/commands/cli/alias/index.md index 9a2df749..99e5b488 100644 --- a/commands/cli/alias/index.md +++ b/commands/cli/alias/index.md @@ -1,4 +1,32 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/alias/ ---- \ No newline at end of file +layout: default +title: 'wp cli alias' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » alias + +`wp cli alias` - List available aliases. + +Quick links: Github issues + +
+ +Aliases are shorthand references to WordPress installs. For instance, +'@dev' could refer to a development install and '@prod' could refer to +a production install. This command gives you visibility in what +registered aliases you have available. + +### OPTIONS + +[\--format=<format>] +: Render output in a particular format. +\--- +default: yaml +options: + - yaml + - json +\--- + + + diff --git a/commands/cli/check-update/index.md b/commands/cli/check-update/index.md index 6e7af947..0bd7b4be 100644 --- a/commands/cli/check-update/index.md +++ b/commands/cli/check-update/index.md @@ -1,4 +1,59 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/check-update/ ---- \ No newline at end of file +layout: default +title: 'wp cli check-update' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » check-update + +`wp cli check-update` - Check for update via Github API. Returns the available versions if there are updates, or empty if no update available. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--patch] +: Only list patch updates + +[\--minor] +: Only list minor updates + +[\--major] +: Only list major updates + +[\--field=<field>] +: Prints the value of a single field for each update. + +[\--fields=<fields>] +: Limit the output to specific object fields. Defaults to version,update_type,package_url. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - yaml +\--- + +### EXAMPLES + + # Check for update + $ wp cli check-update + Success: WP-CLI is at the latest version. + + # Check for update and new version is available + $ wp cli check-update + +---------+-------------+-------------------------------------------------------------------------------+ + | version | update_type | package_url | + +---------+-------------+-------------------------------------------------------------------------------+ + | 0.23.1 | patch | https://github.com/wp-cli/wp-cli/releases/download/v0.23.1/wp-cli-0.23.1.phar | + +---------+-------------+-------------------------------------------------------------------------------+ + + + diff --git a/commands/cli/cmd-dump/index.md b/commands/cli/cmd-dump/index.md index 0b6dcf46..943ab8a9 100644 --- a/commands/cli/cmd-dump/index.md +++ b/commands/cli/cmd-dump/index.md @@ -1,4 +1,20 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/cmd-dump/ ---- \ No newline at end of file +layout: default +title: 'wp cli cmd-dump' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » cmd-dump + +`wp cli cmd-dump` - Dump the list of installed commands, as JSON. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Dump the list of installed commands + $ wp cli cmd-dump + {"name":"wp","description":"Manage WordPress through the command-line.","longdesc":"\n\n + diff --git a/commands/cli/completions/index.md b/commands/cli/completions/index.md index aaf88f6e..cb2599e0 100644 --- a/commands/cli/completions/index.md +++ b/commands/cli/completions/index.md @@ -1,4 +1,31 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/completions/ ---- \ No newline at end of file +layout: default +title: 'wp cli completions' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » completions + +`wp cli completions` - Generate tab completion strings. + +Quick links: Github issues + +
+ +### OPTIONS + +\--line=<line> +: The current command line to be executed. + +\--point=<point> +: The index to the current cursor position relative to the beginning of the command. + +### EXAMPLES + + # Generate tab completion strings. + $ wp cli completions --line='wp eva' --point=100 + eval + eval-file + + + diff --git a/commands/cli/index.md b/commands/cli/index.md index 030254ae..e2f3c78d 100644 --- a/commands/cli/index.md +++ b/commands/cli/index.md @@ -1,4 +1,77 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/ ---- \ No newline at end of file +layout: default +title: 'wp cli' +display_global_parameters: true +--- + +[Commands](/commands/) » cli + +`wp cli` - Get information about WP-CLI itself. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Display CLI version + $ wp cli version + WP-CLI 0.23.1 + + # Check for update + $ wp cli check-update + Success: WP-CLI is at the latest version. + + # Update CLI + $ wp cli update + You have version 0.23.0. Would you like to update to 0.23.1? [y/n] y + Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.23.1/wp-cli-0.23.1.phar... + New version works. Proceeding to replace. + Success: Updated WP-CLI to 0.23.1 + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
aliasList available aliases.
check-updateCheck for update via Github API. Returns the available versions if there are updates, or empty if no update available.
cmd-dumpDump the list of installed commands, as JSON.
completionsGenerate tab completion strings.
infoPrint various data about the CLI environment.
param-dumpDump the list of global parameters, as JSON or in var_export format.
updateFetch most recent update matching the requirements. Returns the available versions if there are updates, or empty if no update available.
versionPrint WP-CLI version.
diff --git a/commands/cli/info/index.md b/commands/cli/info/index.md index 1aea9db2..f9ca2d93 100644 --- a/commands/cli/info/index.md +++ b/commands/cli/info/index.md @@ -1,4 +1,39 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/info/ ---- \ No newline at end of file +layout: default +title: 'wp cli info' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » info + +`wp cli info` - Print various data about the CLI environment. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--format=<format>] +: Render output in a particular format. +\--- +default: list +options: + - list + - json +\--- + +### EXAMPLES + + $ wp cli info + PHP binary: /usr/bin/php5 + PHP version: 5.5.9-1ubuntu4.16 + php.ini used: /etc/php5/cli/php.ini + WP-CLI root dir: phar://wp-cli.phar + WP-CLI packages dir: /home/person/.wp-cli/packages/ + WP-CLI global config: + WP-CLI project config: + WP-CLI version: 0.23.1 + + + diff --git a/commands/cli/param-dump/index.md b/commands/cli/param-dump/index.md index ceb354b3..ce82a8bf 100644 --- a/commands/cli/param-dump/index.md +++ b/commands/cli/param-dump/index.md @@ -1,4 +1,46 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/param-dump/ ---- \ No newline at end of file +layout: default +title: 'wp cli param-dump' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » param-dump + +`wp cli param-dump` - Dump the list of global parameters, as JSON or in var_export format. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--with-values] +: Display current values also. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: json +options: + - var_export + - json +\--- + +### EXAMPLES + + $ wp cli param-dump --format=var_export + array ( + 'path' => + array ( + 'runtime' => '=<path>', + 'file' => '<path>', + 'synopsis' => '', + 'default' => NULL, + 'multiple' => false, + 'desc' => 'Path to the WordPress files.', + ), + 'url' => + array ( + + + diff --git a/commands/cli/update/index.md b/commands/cli/update/index.md index f1f62e51..0182bf7f 100644 --- a/commands/cli/update/index.md +++ b/commands/cli/update/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/update/ ---- \ No newline at end of file +layout: default +title: 'wp cli update' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » update + +`wp cli update` - Fetch most recent update matching the requirements. Returns the available versions if there are updates, or empty if no update available. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--patch] +: Only perform patch updates + +[\--minor] +: Only perform minor updates + +[\--major] +: Only perform major updates + +[\--nightly] +: Update to the latest built version of the master branch. Potentially unstable. + +[\--yes] +: Do not prompt for confirmation + +### EXAMPLES + + $ wp cli update + You have version 0.23.0. Would you like to update to 0.23.1? [y/n] y + Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.23.1/wp-cli-0.23.1.phar... + New version works. Proceeding to replace. + Success: Updated WP-CLI to 0.23.1 + + + diff --git a/commands/cli/version/index.md b/commands/cli/version/index.md index e639b203..d2d13abb 100644 --- a/commands/cli/version/index.md +++ b/commands/cli/version/index.md @@ -1,4 +1,21 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cli/version/ ---- \ No newline at end of file +layout: default +title: 'wp cli version' +display_global_parameters: true +--- + +[Commands](/commands/) » [cli](/commands/cli/) » version + +`wp cli version` - Print WP-CLI version. + +Quick links: Github issues + +
+ +### EXAMPLES + + $ wp cli version + WP-CLI 0.23.1 + + + diff --git a/commands/comment/approve/index.md b/commands/comment/approve/index.md index ff2d7673..1590fe07 100644 --- a/commands/comment/approve/index.md +++ b/commands/comment/approve/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/approve/ ---- \ No newline at end of file +layout: default +title: 'wp comment approve' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » approve + +`wp comment approve` - Approve a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: The IDs of the comments to approve. + +### EXAMPLES + + $ wp comment approve 1337 + Success: Approved comment 1337 + + + diff --git a/commands/comment/count/index.md b/commands/comment/count/index.md index 9a7e66f5..74c40bcb 100644 --- a/commands/comment/count/index.md +++ b/commands/comment/count/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/count/ ---- \ No newline at end of file +layout: default +title: 'wp comment count' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » count + +`wp comment count` - Count comments, on whole blog or on a given post. + +Quick links: Github issues + +
+ +### OPTIONS + +[<post-id>] +: The ID of the post to count comments in. + +### EXAMPLES + + # Count comments on whole blog + $ wp comment count + approved: 33 + spam: 3 + trash: 1 + post-trashed: 0 + all: 34 + moderated: 1 + total_comments: 37 + + # Count comments in a post + $ wp comment count 42 + approved: 19 + spam: 0 + trash: 0 + post-trashed: 0 + all: 19 + moderated: 0 + total_comments: 19 + + + diff --git a/commands/comment/create/index.md b/commands/comment/create/index.md index ca315bf5..781869f6 100644 --- a/commands/comment/create/index.md +++ b/commands/comment/create/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/create/ ---- \ No newline at end of file +layout: default +title: 'wp comment create' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » create + +`wp comment create` - Insert a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: Associative args 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" + Success: Created comment 932. + + + diff --git a/commands/comment/delete/index.md b/commands/comment/delete/index.md index 9a5c9c4f..2b8deed4 100644 --- a/commands/comment/delete/index.md +++ b/commands/comment/delete/index.md @@ -1,4 +1,35 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/delete/ ---- \ No newline at end of file +layout: default +title: 'wp comment delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » delete + +`wp comment delete` - Delete a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of comments to delete. + +[\--force] +: Skip the trash bin. + +### EXAMPLES + + # Delete comment + $ wp comment delete 1337 --force + Success: Deleted comment 1337. + + # Delete multiple comments + $ wp comment delete 1337 2341 --force + Success: Deleted comment 1337. + Success: Deleted comment 2341. + + + diff --git a/commands/comment/exists/index.md b/commands/comment/exists/index.md index 94f93bb4..0a97d7a7 100644 --- a/commands/comment/exists/index.md +++ b/commands/comment/exists/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/exists/ ---- \ No newline at end of file +layout: default +title: 'wp comment exists' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » exists + +`wp comment exists` - Verify whether a comment exists. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the comment to check. + +### EXAMPLES + + $ wp comment exists 1337 + Success: Comment with ID 1337 exists. + + + diff --git a/commands/comment/generate/index.md b/commands/comment/generate/index.md index 39debe61..d94d0041 100644 --- a/commands/comment/generate/index.md +++ b/commands/comment/generate/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/generate/ ---- \ No newline at end of file +layout: default +title: 'wp comment generate' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » generate + +`wp comment generate` - Generate comments. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--count=<number>] +: How many comments to generate. Default: 100 + +[\--post_id=<post-id>] +: Assign comments to a specific post. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: progress +options: + - progress + - ids +\--- + +### EXAMPLES + + # Add meta to every generated comment + $ wp comment generate --format=ids --count=3 | xargs -0 -d ' ' -I % wp comment meta add % foo bar + Success: Added custom field. + Success: Added custom field. + Success: Added custom field. + + + diff --git a/commands/comment/get/index.md b/commands/comment/get/index.md index 63ca9405..f3154af9 100644 --- a/commands/comment/get/index.md +++ b/commands/comment/get/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/get/ ---- \ No newline at end of file +layout: default +title: 'wp comment get' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » get + +`wp comment get` - Get a single comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The comment to get. + +[\--field=<field>] +: Instead of returning the whole comment, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +### EXAMPLES + + $ wp comment get 21 --field=content + Thanks for all the comments, everyone! + + + diff --git a/commands/comment/index.md b/commands/comment/index.md index c1b96fc4..b6dcf3d2 100644 --- a/commands/comment/index.md +++ b/commands/comment/index.md @@ -1,4 +1,119 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/ ---- \ No newline at end of file +layout: default +title: 'wp comment' +display_global_parameters: true +--- + +[Commands](/commands/) » comment + +`wp comment` - Manage comments. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Create comment + $ wp comment create --comment_post_ID=15 --comment_content="hello blog" --comment_author="wp-cli" + Success: Created comment 932. + + # Update comment + $ wp comment update 123 --comment_author='That Guy' + Success: Updated comment 123. + + # Delete comment + $ wp comment delete 1337 --force + Success: Deleted comment 1337. + + # Delete all spam comments. + $ wp comment delete $(wp comment list --status=spam --format=ids) + Success: Deleted comment 264. + Success: Deleted comment 262. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
approveApprove a comment.
countCount comments, on whole blog or on a given post.
createInsert a comment.
deleteDelete a comment.
existsVerify whether a comment exists.
generateGenerate comments.
getGet a single comment.
listGet a list of comments.
metaManage comment custom fields.
recountRecount the comment_count value for one or more posts.
spamSpam a comment.
statusGet status of a comment.
trashTrash a comment.
unapproveUnapprove a comment.
unspamUnspam a comment.
untrashUntrash a comment.
updateUpdate one or more comments.
urlGet comment url
diff --git a/commands/comment/list/index.md b/commands/comment/list/index.md index 316c0dcf..1722c9be 100644 --- a/commands/comment/list/index.md +++ b/commands/comment/list/index.md @@ -1,4 +1,89 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/list/ ---- \ No newline at end of file +layout: default +title: 'wp comment list' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » list + +`wp comment list` - Get a list of comments. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: One or more args to pass to WP_Comment_Query. + +[\--field=<field>] +: Prints the value of a single field for each comment. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - ids + - csv + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each comment: + +* comment_ID +* comment_post_ID +* comment_date +* comment_approved +* comment_author +* comment_author_email + +These fields are optionally available: + +* comment_author_url +* comment_author_IP +* comment_date_gmt +* comment_content +* comment_karma +* comment_agent +* comment_type +* comment_parent +* user_id + +### EXAMPLES + + # List comment IDs + $ wp comment list --field=ID + 22 + 23 + 24 + + # List comments of a post + $ wp comment list --post_id=1 --fields=ID,comment_date,comment_author + +------------+---------------------+----------------+ + | comment_ID | comment_date | comment_author | + +------------+---------------------+----------------+ + | 1 | 2015-06-20 09:00:10 | Mr WordPress | + +------------+---------------------+----------------+ + + # List approved comments + $ wp comment list --number=3 --status=approve --fields=ID,comment_date,comment_author + +------------+---------------------+----------------+ + | comment_ID | comment_date | comment_author | + +------------+---------------------+----------------+ + | 1 | 2015-06-20 09:00:10 | Mr WordPress | + | 30 | 2013-03-14 12:35:07 | John Doe | + | 29 | 2013-03-14 11:56:08 | Jane Doe | + +------------+---------------------+----------------+ + + + diff --git a/commands/comment/meta/add/index.md b/commands/comment/meta/add/index.md index edb127d4..bc658f2b 100644 --- a/commands/comment/meta/add/index.md +++ b/commands/comment/meta/add/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/meta/add/ ---- \ No newline at end of file +layout: default +title: 'wp comment meta add' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » [meta](/commands/comment/meta/) » add + +`wp comment meta add` - Add a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to create. + +[<value>] +: The value of the meta field. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/comment/meta/delete/index.md b/commands/comment/meta/delete/index.md index 0f699649..afea2b7b 100644 --- a/commands/comment/meta/delete/index.md +++ b/commands/comment/meta/delete/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/meta/delete/ ---- \ No newline at end of file +layout: default +title: 'wp comment meta delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » [meta](/commands/comment/meta/) » delete + +`wp comment meta delete` - Delete a meta field. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +[<key>] +: The name of the meta field to delete. + +[<value>] +: The value to delete. If omitted, all rows with key will deleted. + +[\--all] +: Delete all meta for the object. + + + diff --git a/commands/comment/meta/get/index.md b/commands/comment/meta/get/index.md index 6458617e..f8955400 100644 --- a/commands/comment/meta/get/index.md +++ b/commands/comment/meta/get/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/meta/get/ ---- \ No newline at end of file +layout: default +title: 'wp comment meta get' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » [meta](/commands/comment/meta/) » get + +`wp comment meta get` - Get meta field value. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<key> +: The name of the meta field to get. + +[\--format=<format>] +: Accepted values: table, json. Default: table + + + diff --git a/commands/comment/meta/index.md b/commands/comment/meta/index.md index b5c7ea6b..345cc2a1 100644 --- a/commands/comment/meta/index.md +++ b/commands/comment/meta/index.md @@ -1,4 +1,68 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/meta/ ---- \ No newline at end of file +layout: default +title: 'wp comment meta' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » meta + +`wp comment meta` - Manage comment custom fields. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set comment meta + $ wp comment meta set 123 description "Mary is a WordPress developer." + Success: Updated custom field 'description'. + + # Get comment meta + $ wp comment meta get 123 description + Mary is a WordPress developer. + + # Update comment meta + $ wp comment meta update 123 description "Mary is an awesome WordPress developer." + Success: Updated custom field 'description'. + + # Delete comment meta + $ wp comment meta delete 123 description + Success: Deleted custom field. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a meta field.
deleteDelete a meta field.
getGet meta field value.
listList all metadata associated with an object.
updateUpdate a meta field.
diff --git a/commands/comment/meta/list/index.md b/commands/comment/meta/list/index.md index f9a62856..4a8b0e2c 100644 --- a/commands/comment/meta/list/index.md +++ b/commands/comment/meta/list/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/meta/list/ ---- \ No newline at end of file +layout: default +title: 'wp comment meta list' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » [meta](/commands/comment/meta/) » list + +`wp comment meta list` - List all metadata associated with an object. + +Quick links: Github issues + +
+ +<id> +: ID for the object. + +[\--keys=<keys>] +: Limit output to metadata of specific keys. + +[\--fields=<fields>] +: Limit the output to specific row fields. Defaults to id,meta_key,meta_value. + +[\--format=<format>] +: Accepted values: table, csv, json, count. Default: table + + + diff --git a/commands/comment/meta/update/index.md b/commands/comment/meta/update/index.md index e6748ec3..8d96f581 100644 --- a/commands/comment/meta/update/index.md +++ b/commands/comment/meta/update/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/meta/update/ ---- \ No newline at end of file +layout: default +title: 'wp comment meta update' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » [meta](/commands/comment/meta/) » update + +`wp comment meta update` - Update a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to update. + +[<value>] +: The new value. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/comment/recount/index.md b/commands/comment/recount/index.md index f1395902..3e1234de 100644 --- a/commands/comment/recount/index.md +++ b/commands/comment/recount/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/recount/ ---- \ No newline at end of file +layout: default +title: 'wp comment recount' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » recount + +`wp comment recount` - Recount the comment_count value for one or more posts. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: IDs for one or more posts to update. + +### EXAMPLES + + $ wp comment recount 123 + Updated post 123 comment count to 67. + + + diff --git a/commands/comment/spam/index.md b/commands/comment/spam/index.md index a0c34585..ced5ab51 100644 --- a/commands/comment/spam/index.md +++ b/commands/comment/spam/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/spam/ ---- \ No newline at end of file +layout: default +title: 'wp comment spam' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » spam + +`wp comment spam` - Spam a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: The IDs of the comments to mark as spam. + +### EXAMPLES + + $ wp comment spam 1337 + Success: Marked as spam comment 1337. + + + diff --git a/commands/comment/status/index.md b/commands/comment/status/index.md index 9f1c5e3f..a688a6d8 100644 --- a/commands/comment/status/index.md +++ b/commands/comment/status/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/status/ ---- \ No newline at end of file +layout: default +title: 'wp comment status' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » status + +`wp comment status` - Get status of a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the comment to check. + +### EXAMPLES + + $ wp comment status 1337 + approved + + + diff --git a/commands/comment/trash/index.md b/commands/comment/trash/index.md index d6489354..0716cdc0 100644 --- a/commands/comment/trash/index.md +++ b/commands/comment/trash/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/trash/ ---- \ No newline at end of file +layout: default +title: 'wp comment trash' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » trash + +`wp comment trash` - Trash a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: The IDs of the comments to trash. + +### EXAMPLES + + $ wp comment trash 1337 + Success: Trashed comment 1337. + + + diff --git a/commands/comment/unapprove/index.md b/commands/comment/unapprove/index.md index 5006dfb3..efc4cf66 100644 --- a/commands/comment/unapprove/index.md +++ b/commands/comment/unapprove/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/unapprove/ ---- \ No newline at end of file +layout: default +title: 'wp comment unapprove' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » unapprove + +`wp comment unapprove` - Unapprove a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: The IDs of the comments to unapprove. + +### EXAMPLES + + $ wp comment unapprove 1337 + Success: Unapproved comment 1337 + + + diff --git a/commands/comment/unspam/index.md b/commands/comment/unspam/index.md index 115f0194..11ea4f11 100644 --- a/commands/comment/unspam/index.md +++ b/commands/comment/unspam/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/unspam/ ---- \ No newline at end of file +layout: default +title: 'wp comment unspam' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » unspam + +`wp comment unspam` - Unspam a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: The IDs of the comments to unmark as spam. + +### EXAMPLES + + $ wp comment unspam 1337 + Success: Unspammed comment 1337. + + + diff --git a/commands/comment/untrash/index.md b/commands/comment/untrash/index.md index 623aec36..fe3caa81 100644 --- a/commands/comment/untrash/index.md +++ b/commands/comment/untrash/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/untrash/ ---- \ No newline at end of file +layout: default +title: 'wp comment untrash' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » untrash + +`wp comment untrash` - Untrash a comment. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: The IDs of the comments to untrash. + +### EXAMPLES + + $ wp comment untrash 1337 + Success: Untrashed comment 1337. + + + diff --git a/commands/comment/update/index.md b/commands/comment/update/index.md index 735eefde..93f2b593 100644 --- a/commands/comment/update/index.md +++ b/commands/comment/update/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/comment/update/ ---- \ No newline at end of file +layout: default +title: 'wp comment update' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » update + +`wp comment update` - Update one or more comments. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of comments to update. + +\--<field>=<value> +: One or more fields to update. See wp_update_comment(). + +### EXAMPLES + + $ wp comment update 123 --comment_author='That Guy' + Success: Updated comment 123. + + + diff --git a/commands/comment/url/index.md b/commands/comment/url/index.md new file mode 100644 index 00000000..c537963d --- /dev/null +++ b/commands/comment/url/index.md @@ -0,0 +1,26 @@ +--- +layout: default +title: 'wp comment url' +display_global_parameters: true +--- + +[Commands](/commands/) » [comment](/commands/comment/) » url + +`wp comment url` - Get comment url + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of comments to get the URL. + +### EXAMPLES + + $ wp comment url 123 + http://example.com/about/page-with-comments/#comment-123 + + + diff --git a/commands/core/check-update/index.md b/commands/core/check-update/index.md index e140a369..8a3c9ecd 100644 --- a/commands/core/check-update/index.md +++ b/commands/core/check-update/index.md @@ -1,4 +1,53 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/check-update/ ---- \ No newline at end of file +layout: default +title: 'wp core check-update' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » check-update + +`wp core check-update` - Check for update via Version Check API. + +Quick links: Github issues + +
+ +Lists the most recent versions when there are updates available, or success message when up to date. + +### OPTIONS + +[\--minor] +: Compare only the first two parts of the version number. + +[\--major] +: Compare only the first part of the version number. + +[\--field=<field>] +: Prints the value of a single field for each update. + +[\--fields=<fields>] +: Limit the output to specific object fields. Defaults to version,update_type,package_url. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - count + - json + - yaml +\--- + +### EXAMPLES + + $ wp core check-update + +---------+-------------+-------------------------------------------------------------+ + | version | update_type | package_url | + +---------+-------------+-------------------------------------------------------------+ + | 4.5.2 | major | https://downloads.wordpress.org/release/wordpress-4.5.2.zip | + +---------+-------------+-------------------------------------------------------------+ + + + diff --git a/commands/core/config/index.md b/commands/core/config/index.md index 8549546c..f02d8ae9 100644 --- a/commands/core/config/index.md +++ b/commands/core/config/index.md @@ -1,4 +1,76 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/config/ ---- \ No newline at end of file +layout: default +title: 'wp core config' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » config + +`wp core config` - Generate a wp-config.php file. + +Quick links: Github issues + +
+ +### 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_ +\--- + +[\--dbcharset=<dbcharset>] +: Set the database charset. +\--- +default: utf8 +\--- + +[\--dbcollate=<dbcollate>] +: Set the database collation. +\--- +default: +\--- + +[\--locale=<locale>] +: Set the WPLANG constant. Defaults to $wp_local_package variable. + +[\--extra-php] +: If set, the command copies additional PHP code into wp-config.php from STDIN. + +[\--skip-salts] +: If set, keys and salts won't be generated, but should instead be passed via `--extra-php`. + +[\--skip-check] +: If set, the database connection is not checked. + +### EXAMPLES + + # Standard wp-config.php file + $ wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --locale=ro_RO + Success: Generated 'wp-config.php' file. + + # Enable WP_DEBUG and WP_DEBUG_LOG + $ wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --extra-php <[Commands](/commands/) » [core](/commands/core/) » download + +`wp core download` - Download core WordPress files. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--path=<path>] +: Specify the path in which to install WordPress. + +[\--locale=<locale>] +: Select which language you want to download. + +[\--version=<version>] +: Select which version you want to download. Accepts a version number, 'latest' or 'nightly' + +[\--force] +: Overwrites existing files, if present. + +### EXAMPLES + + $ wp core download --locale=nl_NL + Downloading WordPress 4.5.2 (nl_NL)... + md5 hash verified: c5366d05b521831dd0b29dfc386e56a5 + Success: WordPress downloaded. + + + diff --git a/commands/core/index.md b/commands/core/index.md index f66842ad..37e58d1e 100644 --- a/commands/core/index.md +++ b/commands/core/index.md @@ -1,4 +1,92 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/ ---- \ No newline at end of file +layout: default +title: 'wp core' +display_global_parameters: true +--- + +[Commands](/commands/) » core + +`wp core` - Download, install, update and otherwise manage WordPress proper. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Download WordPress core + $ wp core download --locale=nl_NL + Downloading WordPress 4.5.2 (nl_NL)... + md5 hash verified: c5366d05b521831dd0b29dfc386e56a5 + Success: WordPress downloaded. + + # Install WordPress + $ wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword --admin_email=info@example.com + Success: WordPress installed successfully. + + # Display the WordPress version + $ wp core version + 4.5.2 + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
check-updateCheck for update via Version Check API.
configGenerate a wp-config.php file.
downloadDownload core WordPress files.
installRuns the standard WordPress installation process.
is-installedDetermine if the WordPress tables are installed.
languageManage core language.
multisite-convertTransform a single-site install into a multi-site install.
multisite-installInstall multisite from scratch.
updateUpdate WordPress.
update-dbUpdate the WordPress database.
verify-checksumsVerify WordPress files against WordPress.org's checksums.
versionDisplay the WordPress version.
diff --git a/commands/core/install-network/index.md b/commands/core/install-network/index.md index 8f496b90..14d8ec06 100644 --- a/commands/core/install-network/index.md +++ b/commands/core/install-network/index.md @@ -1,4 +1,5 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/install-network/ ---- \ No newline at end of file +layout: default +title: 'wp core install-network' +--- +The `wp core install-network` command has been renamed to [wp core multisite-convert](/commands/core/multisite-convert) in WP-CLI 0.11. diff --git a/commands/core/install/index.md b/commands/core/install/index.md index df7a3a4e..91e6f928 100644 --- a/commands/core/install/index.md +++ b/commands/core/install/index.md @@ -1,4 +1,51 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/install/ ---- \ No newline at end of file +layout: default +title: 'wp core install' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » install + +`wp core install` - Runs the standard WordPress installation process. + +Quick links: Github issues + +
+ +Creates the WordPress tables in the database using the URL, title, and +default admin user details provided. Performs the famous 5 minute install +in seconds or less. + +Note: if you've installed WordPress in a subdirectory, then you'll need +to `wp option update siteurl` after `wp core install`. For instance, if +WordPress is installed in the `/wp` directory and your domain is wp.dev, +then you'll need to run `wp option update siteurl http://wp.dev/wp` for +your WordPress install to function properly. + +### OPTIONS + +\--url=<url> +: The address of the new site. + +\--title=<site-title> +: The title of the new site. + +\--admin_user=<username> +: The name of the admin user. + +\--admin_password=<password> +: The password for the admin user. + +\--admin_email=<email> +: The email address for the admin user. + +[\--skip-email] +: Don't send an email notification to the new admin user. + +### EXAMPLES + + $ wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword --admin_email=info@example.com + Success: WordPress installed successfully. + + + diff --git a/commands/core/is-installed/index.md b/commands/core/is-installed/index.md index 42222529..ecd6fdc2 100644 --- a/commands/core/is-installed/index.md +++ b/commands/core/is-installed/index.md @@ -1,4 +1,31 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/is-installed/ ---- \ No newline at end of file +layout: default +title: 'wp core is-installed' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » is-installed + +`wp core is-installed` - Determine if the WordPress tables are installed. + +Quick links: Github issues + +
+ +[\--network] +: Check if this is a multisite install. + +### EXAMPLES + + # Check whether WordPress is installed; exit status 0 if installed, otherwise 1 + $ wp core is-installed + $ echo $? + 1 + + # Bash script for checking whether WordPress is installed or not + if ! $(wp core is-installed); then + wp core install + fi + + + diff --git a/commands/core/language/activate/index.md b/commands/core/language/activate/index.md index 381a62fc..b857ed6a 100644 --- a/commands/core/language/activate/index.md +++ b/commands/core/language/activate/index.md @@ -1,4 +1,19 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/language/activate/ ---- \ No newline at end of file +layout: default +title: 'wp core language activate' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » [language](/commands/core/language/) » activate + +`wp core language activate` - Activate a given language. + +Quick links: Github issues + +
+ +<language> +: Language code to activate. + + + diff --git a/commands/core/language/index.md b/commands/core/language/index.md index 49fd5b91..a6dd55c1 100644 --- a/commands/core/language/index.md +++ b/commands/core/language/index.md @@ -1,4 +1,72 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/language/ ---- \ No newline at end of file +layout: default +title: 'wp core language' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » language + +`wp core language` - Manage core language. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Install language + $ wp core language install nl_NL + Success: Language installed. + + # Activate language + $ wp core language activate nl_NL + Success: Language activated. + + # Uninstall language + $ wp core language uninstall nl_NL + Success: Language uninstalled. + + # List installed languages + $ wp core language list --status=installed + +----------+--------------+-------------+-----------+-----------+---------------------+ + | language | english_name | native_name | status | update | updated | + +----------+--------------+-------------+-----------+-----------+---------------------+ + | nl_NL | Dutch | Nederlands | installed | available | 2016-05-13 08:12:50 | + +----------+--------------+-------------+-----------+-----------+---------------------+ + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
activateActivate a given language.
installInstall a given language.
listList all languages available.
uninstallUninstall a given language.
updateUpdates the active translation of core, plugins, and themes.
diff --git a/commands/core/language/install/index.md b/commands/core/language/install/index.md index 351f9981..71ecc36c 100644 --- a/commands/core/language/install/index.md +++ b/commands/core/language/install/index.md @@ -1,4 +1,22 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/language/install/ ---- \ No newline at end of file +layout: default +title: 'wp core language install' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » [language](/commands/core/language/) » install + +`wp core language install` - Install a given language. + +Quick links: Github issues + +
+ +<language> +: Language code to install. + +[\--activate] +: If set, the language will be activated immediately after install. + + + diff --git a/commands/core/language/list/index.md b/commands/core/language/list/index.md index fdcf14d7..822a1800 100644 --- a/commands/core/language/list/index.md +++ b/commands/core/language/list/index.md @@ -1,4 +1,44 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/language/list/ ---- \ No newline at end of file +layout: default +title: 'wp core language list' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » [language](/commands/core/language/) » list + +`wp core language list` - List all languages available. + +Quick links: Github issues + +
+ +[\--field=<field>] +: Display the value of a single field + +[\--<field>=<value>] +: Filter results by key=value pairs. + +[\--fields=<fields>] +: Limit the output to specific fields. + +[\--format=<format>] +: Accepted values: table, csv, json. Default: table + +### AVAILABLE FIELDS + +These fields will be displayed by default for each translation: + +* language +* english_name +* native_name +* status +* update +* updated + +These fields are optionally available: + +* version +* package + + + diff --git a/commands/core/language/uninstall/index.md b/commands/core/language/uninstall/index.md index 3f3af547..02dbd941 100644 --- a/commands/core/language/uninstall/index.md +++ b/commands/core/language/uninstall/index.md @@ -1,4 +1,19 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/language/uninstall/ ---- \ No newline at end of file +layout: default +title: 'wp core language uninstall' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » [language](/commands/core/language/) » uninstall + +`wp core language uninstall` - Uninstall a given language. + +Quick links: Github issues + +
+ +<language> +: Language code to uninstall. + + + diff --git a/commands/core/language/update/index.md b/commands/core/language/update/index.md index c9b24b05..a5f21ef9 100644 --- a/commands/core/language/update/index.md +++ b/commands/core/language/update/index.md @@ -1,4 +1,19 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/language/update/ ---- \ No newline at end of file +layout: default +title: 'wp core language update' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » [language](/commands/core/language/) » update + +`wp core language update` - Updates the active translation of core, plugins, and themes. + +Quick links: Github issues + +
+ +[\--dry-run] +: Preview which translations would be updated. + + + diff --git a/commands/core/multisite-convert/index.md b/commands/core/multisite-convert/index.md index ae58e516..d3b5b42d 100644 --- a/commands/core/multisite-convert/index.md +++ b/commands/core/multisite-convert/index.md @@ -1,4 +1,40 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/multisite-convert/ ---- \ No newline at end of file +layout: default +title: 'wp core multisite-convert' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » multisite-convert + +`wp core multisite-convert` - Transform a single-site install into a multi-site install. + +Quick links: Github issues + +
+ +For those using WordPress with Apache, remember to update the `.htaccess` +file with the appropriate multisite rewrite rules. + +### OPTIONS + +[\--title=<network-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. Doesn't work with 'localhost'. + +### EXAMPLES + + $ wp core multisite-convert + Set up multisite database tables. + Added multisite constants to wp-config.php. + Success: Network installed. Don't forget to set up rewrite rules. + + + diff --git a/commands/core/multisite-install/index.md b/commands/core/multisite-install/index.md index 24524dd4..37a252ba 100644 --- a/commands/core/multisite-install/index.md +++ b/commands/core/multisite-install/index.md @@ -1,4 +1,58 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/multisite-install/ ---- \ No newline at end of file +layout: default +title: 'wp core multisite-install' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » multisite-install + +`wp core multisite-install` - Install multisite from scratch. + +Quick links: Github issues + +
+ +### 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. Doesn't work with 'localhost'. + +\--title=<site-title> +: The title of the new site. + +\--admin_user=<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. + +[\--skip-email] +: Don't send an email notification to the new admin user. + +### EXAMPLES + + $ wp core multisite-install --title="Welcome to the WordPress" \ + > --admin_user="admin" --admin_password="password" \ + > --admin_email="user@example.com" + Single site database tables already present. + Set up multisite database tables. + Added multisite constants to wp-config.php. + Success: Network installed. Don't forget to set up rewrite rules. + + + diff --git a/commands/core/update-db/index.md b/commands/core/update-db/index.md index 3a1b2654..535161f1 100644 --- a/commands/core/update-db/index.md +++ b/commands/core/update-db/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/update-db/ ---- \ No newline at end of file +layout: default +title: 'wp core update-db' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » update-db + +`wp core update-db` - Update the WordPress database. + +Quick links: Github issues + +
+ +[\--network] +: Update databases for all sites on a network + +[\--dry-run] +: Compare database versions without performing the update. + +### EXAMPLES + + # Update the WordPress database + $ wp core update-db + Success: WordPress database upgraded successfully from db version 36686 to 35700. + + # Update databases for all sites on a network + $ wp core update-db --network + WordPress database upgraded successfully from db version 35700 to 29630 on example.com/ + Success: WordPress database upgraded on 123/123 sites + + + diff --git a/commands/core/update/index.md b/commands/core/update/index.md index e3e875bb..e5fe1102 100644 --- a/commands/core/update/index.md +++ b/commands/core/update/index.md @@ -1,4 +1,63 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/update/ ---- \ No newline at end of file +layout: default +title: 'wp core update' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » update + +`wp core update` - Update WordPress. + +Quick links: Github issues + +
+ +### OPTIONS + +[<zip>] +: Path to zip file to use, instead of downloading from wordpress.org. + +[\--minor] +: Only perform updates for minor releases (e.g. update from WP 4.3 to 4.3.3 instead of 4.4.2). + +[\--version=<version>] +: Update to a specific version, instead of to the latest version. + +[\--force] +: Update even when installed WP version is greater than the requested version. + +[\--locale=<locale>] +: Select which language you want to download. + +### EXAMPLES + + # Update WordPress + $ wp core update + Updating to version 4.5.2 (en_US)... + Downloading update from https://downloads.wordpress.org/release/wordpress-4.5.2-no-content.zip... + Unpacking the update... + Cleaning up files... + No files found that need cleaned up + Success: WordPress updated successfully. + + # Update WordPress to latest version of 3.8 release + $ wp core update --version=3.8 ../latest.zip + Updating to version 3.8 ()... + Unpacking the update... + Cleaning up files... + File removed: wp-admin/js/tags-box.js + ... + File removed: wp-admin/js/updates.min. + 377 files cleaned up + Success: WordPress updated successfully. + + # Update WordPress to 3.1 forcefully + $ wp core update --version=3.1 --force + Updating to version 3.1 (en_US)... + Downloading update from https://wordpress.org/wordpress-3.1.zip... + Unpacking the update... + Warning: Failed to fetch checksums. Please cleanup files manually. + Success: WordPress updated successfully. + + + diff --git a/commands/core/verify-checksums/index.md b/commands/core/verify-checksums/index.md index f9cbb898..913060e9 100644 --- a/commands/core/verify-checksums/index.md +++ b/commands/core/verify-checksums/index.md @@ -1,4 +1,47 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/verify-checksums/ ---- \ No newline at end of file +layout: default +title: 'wp core verify-checksums' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » verify-checksums + +`wp core verify-checksums` - Verify WordPress files against WordPress.org's checksums. + +Quick links: Github issues + +
+ +For security, avoids loading WordPress when verifying checksums. + +### OPTIONS + +[\--version=<version>] +: Verify checksums against a specific version of WordPress. + +[\--locale=<locale>] +: Verify checksums against a specific locale of WordPress. + +### EXAMPLES + + # Verify checksums + $ wp core verify-checksums + Success: WordPress install verifies against checksums. + + # Verify checksums for given WordPress version + $ wp core verify-checksums --version=4.0 + Success: WordPress install verifies against checksums. + + # Verify checksums for given locale + $ wp core verify-checksums --locale=en_US + Success: WordPress install verifies against checksums. + + # Verify checksums for given locale + $ wp core verify-checksums --locale=ja + Warning: File doesn't verify against checksum: wp-includes/version.php + Warning: File doesn't verify against checksum: readme.html + Warning: File doesn't verify against checksum: wp-config-sample.php + Error: WordPress install doesn't verify against checksums. + + + diff --git a/commands/core/version/index.md b/commands/core/version/index.md index f872eb73..c085ef44 100644 --- a/commands/core/version/index.md +++ b/commands/core/version/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/core/version/ ---- \ No newline at end of file +layout: default +title: 'wp core version' +display_global_parameters: true +--- + +[Commands](/commands/) » [core](/commands/core/) » version + +`wp core version` - Display the WordPress version. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--extra] +: Show extended version information. + +### EXAMPLES + + # Display the WordPress version + $ wp core version + 4.5.2 + + # Display WordPress version along with other information + $ wp core version --extra + WordPress version: 4.5.2 + Database revision: 36686 + TinyMCE version: 4.310 (4310-20160418) + + + diff --git a/commands/cron/event/delete/index.md b/commands/cron/event/delete/index.md index 4b18d472..b50b17d7 100644 --- a/commands/cron/event/delete/index.md +++ b/commands/cron/event/delete/index.md @@ -1,4 +1,27 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/event/delete/ ---- \ No newline at end of file +layout: default +title: 'wp cron event delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » [event](/commands/cron/event/) » delete + +`wp cron event delete` - Delete the next scheduled cron event for the given hook. + +Quick links: Github issues + +
+ +### OPTIONS + +<hook> +: The hook name. + +### EXAMPLES + + # Delete the next scheduled cron event + $ wp cron event delete cron_test + Success: Deleted 2 instances of the cron event 'cron_test'. + + + diff --git a/commands/cron/event/index.md b/commands/cron/event/index.md index 37737729..84722089 100644 --- a/commands/cron/event/index.md +++ b/commands/cron/event/index.md @@ -1,4 +1,64 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/event/ ---- \ No newline at end of file +layout: default +title: 'wp cron event' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » event + +`wp cron event` - Manage WP-Cron events. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Schedule a new cron event + $ wp cron event schedule cron_test + Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:19:16 GMT. + + # Run all cron events due right now + $ wp cron event run --due-now + Success: Executed a total of 2 cron events. + + # Delete the next scheduled cron event + $ wp cron event delete cron_test + Success: Deleted 2 instances of the cron event 'cron_test'. + + # List scheduled cron events in JSON + $ wp cron event list --fields=hook,next_run --format=json + [{"hook":"wp_version_check","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_plugins","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_themes","next_run":"2016-05-31 10:15:14"}] + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
deleteDelete the next scheduled cron event for the given hook.
listList scheduled cron events.
runRun the next scheduled cron event for the given hook.
scheduleSchedule a new cron event.
diff --git a/commands/cron/event/list/index.md b/commands/cron/event/list/index.md index 1bc661af..aa4c7670 100644 --- a/commands/cron/event/list/index.md +++ b/commands/cron/event/list/index.md @@ -1,4 +1,72 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/event/list/ ---- \ No newline at end of file +layout: default +title: 'wp cron event list' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » [event](/commands/cron/event/) » list + +`wp cron event list` - List scheduled cron events. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--<field>=<value>] +: Filter by one or more fields. + +[\--field=<field>] +: Prints the value of a single field for each event. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - ids + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each cron event: +* hook +* next_run_gmt +* next_run_relative +* recurrence + +These fields are optionally available: +* time +* sig +* args +* schedule +* interval +* next_run + +### EXAMPLES + + # List scheduled cron events + $ wp cron event list + +-------------------+---------------------+---------------------+------------+ + | hook | next_run_gmt | next_run_relative | recurrence | + +-------------------+---------------------+---------------------+------------+ + | wp_version_check | 2016-05-31 22:15:13 | 11 hours 57 minutes | 12 hours | + | wp_update_plugins | 2016-05-31 22:15:13 | 11 hours 57 minutes | 12 hours | + | wp_update_themes | 2016-05-31 22:15:14 | 11 hours 57 minutes | 12 hours | + +-------------------+---------------------+---------------------+------------+ + + # List scheduled cron events in JSON + $ wp cron event list --fields=hook,next_run --format=json + [{"hook":"wp_version_check","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_plugins","next_run":"2016-05-31 10:15:13"},{"hook":"wp_update_themes","next_run":"2016-05-31 10:15:14"}] + + + diff --git a/commands/cron/event/run/index.md b/commands/cron/event/run/index.md index a5e53006..db612ee7 100644 --- a/commands/cron/event/run/index.md +++ b/commands/cron/event/run/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/event/run/ ---- \ No newline at end of file +layout: default +title: 'wp cron event run' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » [event](/commands/cron/event/) » run + +`wp cron event run` - Run the next scheduled cron event for the given hook. + +Quick links: Github issues + +
+ +### OPTIONS + +[<hook>...] +: One or more hooks to run. + +[\--due-now] +: Run all hooks due right now. + +[\--all] +: Run all hooks. + +### EXAMPLES + + # Run all cron events due right now + $ wp cron event run --due-now + Success: Executed a total of 2 cron events. + + + diff --git a/commands/cron/event/schedule/index.md b/commands/cron/event/schedule/index.md index f817198b..040f4e8a 100644 --- a/commands/cron/event/schedule/index.md +++ b/commands/cron/event/schedule/index.md @@ -1,4 +1,44 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/event/schedule/ ---- \ No newline at end of file +layout: default +title: 'wp cron event schedule' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » [event](/commands/cron/event/) » schedule + +`wp cron event schedule` - Schedule a new cron event. + +Quick links: Github issues + +
+ +### OPTIONS + +<hook> +: The hook name. + +[<next-run>] +: A Unix timestamp or an English textual datetime description compatible with `strtotime()`. Defaults to now. + +[<recurrence>] +: How often the event should recur. See `wp cron schedule list` for available schedule names. Defaults to no recurrence. + +[\--<field>=<value>] +: Associative args for the event. + +### EXAMPLES + + # Schedule a new cron event + $ wp cron event schedule cron_test + Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:19:16 GMT. + + # Schedule new cron event with hourly recurrence + $ wp cron event schedule cron_test now hourly + Success: Scheduled event with hook 'cron_test' for 2016-05-31 10:20:32 GMT. + + # Schedule new cron event and pass associative arguments + $ wp cron event schedule cron_test '+1 hour' --foo=1 --bar=2 + Success: Scheduled event with hook 'cron_test' for 2016-05-31 11:21:35 GMT. + + + diff --git a/commands/cron/index.md b/commands/cron/index.md index ab003276..db7db4f5 100644 --- a/commands/cron/index.md +++ b/commands/cron/index.md @@ -1,4 +1,46 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/ ---- \ No newline at end of file +layout: default +title: 'wp cron' +display_global_parameters: true +--- + +[Commands](/commands/) » cron + +`wp cron` - Manage WP-Cron events and schedules. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Test WP Cron spawning system + $ wp cron test + Success: WP-Cron spawning is working as expected. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
eventManage WP-Cron events.
scheduleManage WP-Cron schedules.
testTest the WP Cron spawning system and report back its status.
diff --git a/commands/cron/schedule/index.md b/commands/cron/schedule/index.md index 1d0728c2..0b1cf0dd 100644 --- a/commands/cron/schedule/index.md +++ b/commands/cron/schedule/index.md @@ -1,4 +1,46 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/schedule/ ---- \ No newline at end of file +layout: default +title: 'wp cron schedule' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » schedule + +`wp cron schedule` - Manage WP-Cron schedules. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List available cron schedules + $ wp cron schedule list + +------------+-------------+----------+ + | name | display | interval | + +------------+-------------+----------+ + | hourly | Once Hourly | 3600 | + | twicedaily | Twice Daily | 43200 | + | daily | Once Daily | 86400 | + +------------+-------------+----------+ + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + +
NameDescription
listList available cron schedules.
diff --git a/commands/cron/schedule/list/index.md b/commands/cron/schedule/list/index.md index 88ba00e3..aa555fa9 100644 --- a/commands/cron/schedule/list/index.md +++ b/commands/cron/schedule/list/index.md @@ -1,4 +1,62 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/schedule/list/ ---- \ No newline at end of file +layout: default +title: 'wp cron schedule list' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » [schedule](/commands/cron/schedule/) » list + +`wp cron schedule list` - List available cron schedules. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--field=<field>] +: Prints the value of a single field for each schedule. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - ids + - json + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each cron schedule: + +* name +* display +* interval + +There are no additional fields. + +### EXAMPLES + + # List available cron schedules + $ wp cron schedule list + +------------+-------------+----------+ + | name | display | interval | + +------------+-------------+----------+ + | hourly | Once Hourly | 3600 | + | twicedaily | Twice Daily | 43200 | + | daily | Once Daily | 86400 | + +------------+-------------+----------+ + + # List id of available cron schedule + $ wp cron schedule list --fields=name --format=ids + hourly twicedaily daily + + + diff --git a/commands/cron/test/index.md b/commands/cron/test/index.md index d14bef75..3e282792 100644 --- a/commands/cron/test/index.md +++ b/commands/cron/test/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/cron/test/ ---- \ No newline at end of file +layout: default +title: 'wp cron test' +display_global_parameters: true +--- + +[Commands](/commands/) » [cron](/commands/cron/) » test + +`wp cron test` - Test the WP Cron spawning system and report back its status. + +Quick links: Github issues + +
+ +This command tests the spawning system by performing the following steps: +* Checks to see if the `DISABLE_WP_CRON` constant is set; errors if true +because WP-Cron is disabled. +* Checks to see if the `ALTERNATE_WP_CRON` constant is set; warns if true +* Attempts to spawn WP-Cron over HTTP; warns if non 200 response code is +returned. + +### EXAMPLES + + $ wp cron test + Success: WP-Cron spawning is working as expected. + + + diff --git a/commands/db/check/index.md b/commands/db/check/index.md deleted file mode 100644 index 836e72bb..00000000 --- a/commands/db/check/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/check/ ---- \ No newline at end of file diff --git a/commands/db/cli/index.md b/commands/db/cli/index.md index 3e83634c..2620131f 100644 --- a/commands/db/cli/index.md +++ b/commands/db/cli/index.md @@ -1,4 +1,22 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/cli/ ---- \ No newline at end of file +layout: default +title: 'wp db cli' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » cli + +`wp db cli` - Open a MySQL console using credentials from wp-config.php + +Quick links: Github issues + +
+ +### EXAMPLES + + # Open MySQL console + $ wp db cli + mysql> + + + diff --git a/commands/db/create/index.md b/commands/db/create/index.md index c502d99b..58802b95 100644 --- a/commands/db/create/index.md +++ b/commands/db/create/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/create/ ---- \ No newline at end of file +layout: default +title: 'wp db create' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » create + +`wp db create` - Create the database in MySQL. + +Quick links: Github issues + +
+ +Runs `CREATE_DATABASE` MySQL statement using `DB_HOST`, `DB_NAME`, +`DB_USER` and `DB_PASSWORD` database credentials specified in +wp-config.php. + +### EXAMPLES + + $ wp db create + Success: Database created. + + + diff --git a/commands/db/drop/index.md b/commands/db/drop/index.md index 69957c56..0d06a1ce 100644 --- a/commands/db/drop/index.md +++ b/commands/db/drop/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/drop/ ---- \ No newline at end of file +layout: default +title: 'wp db drop' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » drop + +`wp db drop` - Delete the database in MySQL. + +Quick links: Github issues + +
+ +Runs `DROP_DATABASE` MySQL statement using `DB_HOST`, `DB_NAME`, +`DB_USER` and `DB_PASSWORD` database credentials specified in +wp-config.php. + +### OPTIONS + +[\--yes] +: Answer yes to the confirmation message. + +### EXAMPLES + + $ wp db drop --yes + Success: Database dropped. + + + diff --git a/commands/db/export/index.md b/commands/db/export/index.md index c05d048e..24de71be 100644 --- a/commands/db/export/index.md +++ b/commands/db/export/index.md @@ -1,4 +1,51 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/export/ ---- \ No newline at end of file +layout: default +title: 'wp db export' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » export + +`wp db export` - Exports the MySQL database to a file or to STDOUT. + +Quick links: Github issues + +
+ +Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and +`DB_PASSWORD` database credentials specified in wp-config.php. + +### OPTIONS + +[<file>] +: The name of the SQL file to export. If '-', then outputs to STDOUT. If omitted, it will be '{dbname}.sql'. + +[\--<field>=<value>] +: Extra arguments to pass to mysqldump + +[\--tables=<tables>] +: The comma separated list of specific tables to export. Excluding this parameter will export all tables in the database. + +[\--porcelain] +: Output filename for the exported database. + +### EXAMPLES + + # Export database with drop query included + $ wp db export --add-drop-table + Success: Exported to 'wordpress_dbase.sql'. + + # Export certain tables + $ wp db export --tables=wp_options,wp_users + Success: Exported to 'wordpress_dbase.sql'. + + # Export all tables matching a wildcard + $ wp db export --tables=$(wp db tables 'wp_user*' --format=csv) + Success: Exported to 'wordpress_dbase.sql'. + + # Export all tables matching prefix + $ wp db export --tables=$(wp db tables --all-tables-with-prefix --format=csv) + Success: Exported to 'wordpress_dbase.sql'. + + + diff --git a/commands/db/import/index.md b/commands/db/import/index.md index 74b6bd5f..6881d0d8 100644 --- a/commands/db/import/index.md +++ b/commands/db/import/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/import/ ---- \ No newline at end of file +layout: default +title: 'wp db import' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » import + +`wp db import` - Import a MySQL database from a file or from STDIN. + +Quick links: Github issues + +
+ +### OPTIONS + +[<file>] +: The name of the SQL file to import. If '-', then reads from STDIN. If omitted, it will look for '{dbname}.sql'. + +### EXAMPLES + + $ wp db import wordpress_dbase.sql + Success: Imported from 'wordpress_dbase.sql'. + + + diff --git a/commands/db/index.md b/commands/db/index.md index 9eb8483c..66045e3d 100644 --- a/commands/db/index.md +++ b/commands/db/index.md @@ -1,4 +1,85 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/ ---- \ No newline at end of file +layout: default +title: 'wp db' +display_global_parameters: true +--- + +[Commands](/commands/) » db + +`wp db` - Perform basic database operations. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Create database + $ wp db create + Success: Database created. + + # Drop database + $ wp db drop --yes + Success: Database dropped. + + # Reset database + $ wp db reset --yes + Success: Database reset. + + # Execute a query stored in a file + $ wp db query < debug.sql + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
cliOpen a MySQL console using credentials from wp-config.php
createCreate the database in MySQL.
dropDelete the database in MySQL.
exportExports the MySQL database to a file or to STDOUT.
importImport a MySQL database from a file or from STDIN.
optimizeOptimize the database in MySQL.
queryExecute a MySQL query against the database.
repairRepair the database in MySQL.
resetRemove all tables from the database in MySQL.
tablesList the MySQL database tables.
diff --git a/commands/db/optimize/index.md b/commands/db/optimize/index.md index 13c258c7..a8e67a10 100644 --- a/commands/db/optimize/index.md +++ b/commands/db/optimize/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/optimize/ ---- \ No newline at end of file +layout: default +title: 'wp db optimize' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » optimize + +`wp db optimize` - Optimize the database in MySQL. + +Quick links: Github issues + +
+ +Runs `mysqlcheck` utility with `--optimize=true` using `DB_HOST`, +`DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials +specified in wp-config.php. + +[See docs](http://dev.mysql.com/doc/refman/5.7/en/optimize-table.html) +for more details on the `OPTIMIZE_TABLE` statement. + +### EXAMPLES + + $ wp db optimize + Success: Database optimized. + + + diff --git a/commands/db/query/index.md b/commands/db/query/index.md index 7cbfb232..5ba0de9d 100644 --- a/commands/db/query/index.md +++ b/commands/db/query/index.md @@ -1,4 +1,48 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/query/ ---- \ No newline at end of file +layout: default +title: 'wp db query' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » query + +`wp db query` - Execute a MySQL query against the database. + +Quick links: Github issues + +
+ +Executes an arbitrary MySQL query using `DB_HOST`, `DB_NAME`, `DB_USER` + and `DB_PASSWORD` database credentials specified in wp-config.php. + +### OPTIONS + +[<sql>] +: A SQL query. If not passed, will try to read from STDIN. + +### EXAMPLES + + # Execute a query stored in a file + $ wp db query < debug.sql + + # Check all tables in the database + $ wp db query "CHECK TABLE $(wp db tables | paste -s -d',');" + +---------------------------------------+-------+----------+----------+ + | Table | Op | Msg_type | Msg_text | + +---------------------------------------+-------+----------+----------+ + | wordpress_dbase.wp_users | check | status | OK | + | wordpress_dbase.wp_usermeta | check | status | OK | + | wordpress_dbase.wp_posts | check | status | OK | + | wordpress_dbase.wp_comments | check | status | OK | + | wordpress_dbase.wp_links | check | status | OK | + | wordpress_dbase.wp_options | check | status | OK | + | wordpress_dbase.wp_postmeta | check | status | OK | + | wordpress_dbase.wp_terms | check | status | OK | + | wordpress_dbase.wp_term_taxonomy | check | status | OK | + | wordpress_dbase.wp_term_relationships | check | status | OK | + | wordpress_dbase.wp_termmeta | check | status | OK | + | wordpress_dbase.wp_commentmeta | check | status | OK | + +---------------------------------------+-------+----------+----------+ + + + diff --git a/commands/db/repair/index.md b/commands/db/repair/index.md index 4bb09152..2280e92c 100644 --- a/commands/db/repair/index.md +++ b/commands/db/repair/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/repair/ ---- \ No newline at end of file +layout: default +title: 'wp db repair' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » repair + +`wp db repair` - Repair the database in MySQL. + +Quick links: Github issues + +
+ +Runs `mysqlcheck` utility with `--repair=true` using `DB_HOST`, +`DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials +specified in wp-config.php. + +[See docs](http://dev.mysql.com/doc/refman/5.7/en/repair-table.html) for +more details on the `REPAIR_TABLE` statement. + +### EXAMPLES + + $ wp db repair + Success: Database repaired. + + + diff --git a/commands/db/reset/index.md b/commands/db/reset/index.md index ea4e3970..12809c45 100644 --- a/commands/db/reset/index.md +++ b/commands/db/reset/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/reset/ ---- \ No newline at end of file +layout: default +title: 'wp db reset' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » reset + +`wp db reset` - Remove all tables from the database in MySQL. + +Quick links: Github issues + +
+ +Runs `DROP_DATABASE` and `CREATE_DATABASE` MySQL statements using +`DB_HOST`, `DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials +specified in wp-config.php. + +### OPTIONS + +[\--yes] +: Answer yes to the confirmation message. + +### EXAMPLES + + $ wp db reset --yes + Success: Database reset. + + + diff --git a/commands/db/tables/index.md b/commands/db/tables/index.md index d35d47d1..7b29fc65 100644 --- a/commands/db/tables/index.md +++ b/commands/db/tables/index.md @@ -1,4 +1,44 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/db/tables/ ---- \ No newline at end of file +layout: default +title: 'wp db tables' +display_global_parameters: true +--- + +[Commands](/commands/) » [db](/commands/db/) » tables + +`wp db tables` - List the MySQL database tables. + +Quick links: Github issues + +
+ +Defaults to all tables registered to $wpdb. + +### OPTIONS + +[<table>...] +: List tables based on wildcard search, e.g. 'wp_*_options' or 'wp_post?'. + +[\--scope=<scope>] +: Can be all, global, ms_global, blog, or old tables. Defaults to all. + +[\--network] +: List all the tables in a multisite install. Overrides --scope=<scope>. + +[\--all-tables-with-prefix] +: List all tables that match the table prefix even if not registered on $wpdb. Overrides --network. + +[\--all-tables] +: List all tables in the database, regardless of the prefix, and even if not registered on $wpdb. Overrides --all-tables-with-prefix. + +[\--format=<format>] +: Accepted values: list, csv. Default: list + +### EXAMPLES + + # Export only tables for a single site + $ wp db export --tables=$(wp db tables --url=sub.example.com --format=csv) + Success: Exported to wordpress_dbase.sql + + + diff --git a/commands/eval-file/index.md b/commands/eval-file/index.md index 99da8219..dcd65a3e 100644 --- a/commands/eval-file/index.md +++ b/commands/eval-file/index.md @@ -1,4 +1,27 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/eval-file/ ---- \ No newline at end of file +layout: default +title: 'wp eval-file' +display_global_parameters: true +--- + +[Commands](/commands/) » eval-file + +`wp eval-file` - Load and execute a PHP file. + +Quick links: Github issues + +
+ +### OPTIONS + +<file> +: The path to the PHP file to execute. + +[<arg>...] +: One or more arguments to pass to the file. They are placed in the $args variable. + +[\--skip-wordpress] +: Load and execute file without loading WordPress. + + + diff --git a/commands/eval/index.md b/commands/eval/index.md index 133cbdfa..82c1e2dd 100644 --- a/commands/eval/index.md +++ b/commands/eval/index.md @@ -1,4 +1,24 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/eval/ ---- \ No newline at end of file +layout: default +title: 'wp eval' +display_global_parameters: true +--- + +[Commands](/commands/) » eval + +`wp eval` - Execute arbitrary PHP code. + +Quick links: Github issues + +
+ +### OPTIONS + +<php-code> +: The code to execute, as a string. + +[\--skip-wordpress] +: Execute code without loading WordPress. + + + diff --git a/commands/export/index.md b/commands/export/index.md index 03d5c2bf..4323d9ca 100644 --- a/commands/export/index.md +++ b/commands/export/index.md @@ -1,4 +1,88 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/export/ ---- \ No newline at end of file +layout: default +title: 'wp export' +display_global_parameters: true +--- + +[Commands](/commands/) » export + +`wp export` - Export content to a WXR file. + +Quick links: Github issues + +
+ +### 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. + +[\--max_file_size=<MB>] +: A single export file should have this many megabytes. +\--- +default: 15 +\--- + +### FILTERS + +[\--start_date=<date>] +: Export only posts published after this date, in format YYYY-MM-DD. + +[\--end_date=<date>] +: Export only posts published before this date, in format YYYY-MM-DD. + +[\--post_type=<post-type>] +: Export only posts with this post_type. Separate multiple post types with a +comma. +\--- +default: any +\--- + +[\--post_type__not_in=<post-type>] +: Export all post types except those identified. Separate multiple post types +with a comma. Defaults to none. + +[\--post__in=<pid>] +: Export all posts specified as a comma- or space-separated list of IDs. + +[\--start_id=<pid>] +: Export only posts with IDs greater than or equal to this post ID. + +[\--author=<author>] +: Export only posts by this author. Can be either user login or user ID. + +[\--category=<name>] +: Export only posts in this category. + +[\--post_status=<status>] +: Export only posts with this status. + +[\--filename_format=<format>] +: Use a custom format for export filenames. Defaults to '{site}.wordpress.{date}.{n}.xml'. + +### EXAMPLES + + # Export posts published by the user between given start and end date + $ wp export --dir=/tmp/ --user=admin --post_type=post --start_date=2011-01-01 --end_date=2011-12-31 + Starting export process... + Writing to file /tmp/staging.wordpress.2016-05-24.000.xml + Success: All done with export. + + # Export posts by IDs + $ wp export --dir=/tmp/ --post__in=123,124,125 + Starting export process... + Writing to file /tmp/staging.wordpress.2016-05-24.000.xml + Success: All done with export. + + # Export a random subset of content + $ wp export --post__in="$(wp post list --post_type=post --orderby=rand --posts_per_page=8 --format=ids)" + Starting export process... + Writing to file /var/www/example.com/public_html/staging.wordpress.2016-05-24.000.xml + Success: All done with export. + + + diff --git a/commands/help/index.md b/commands/help/index.md index 572ea263..67655a6a 100644 --- a/commands/help/index.md +++ b/commands/help/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/help/ ---- \ No newline at end of file +layout: default +title: 'wp help' +display_global_parameters: true +--- + +[Commands](/commands/) » help + +`wp help` - Get help on WP-CLI, or on a specific command. + +Quick links: Github issues + +
+ +### OPTIONS + +[<command>...] +: Get help on a specific command. + +### EXAMPLES + + # get help for `core` command + wp help core + + # get help for `core download` subcommand + wp help core download + + + diff --git a/commands/import/index.md b/commands/import/index.md index f5dc2038..0407b50f 100644 --- a/commands/import/index.md +++ b/commands/import/index.md @@ -1,4 +1,38 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/import/ ---- \ No newline at end of file +layout: default +title: 'wp import' +display_global_parameters: true +--- + +[Commands](/commands/) » import + +`wp import` - Import content from a WXR file. + +Quick links: Github issues + +
+ +### OPTIONS + +<file>... +: Path to one or more valid WXR files for importing. Directories are also accepted. + +\--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 CSV requires two columns, and a header row like "old_user_login,new_user_login". The last option will skip any author mapping. + +[\--skip=<data-type>] +: Skip importing specific data. Supported options are: 'attachment' and 'image_resize' (skip time-consuming thumbnail generation). + +### EXAMPLES + + # Import content from a WXR file + $ wp import example.wordpress.2016-06-21.xml --authors=create + Starting the import process... + Processing post #1 ("Hello world!") (post_type: post) + -- 1 of 1 + -- Tue, 21 Jun 2016 05:31:12 +0000 + -- Imported post as post_id #1 + Success: Finished importing from 'example.wordpress.2016-06-21.xml' file. + + + diff --git a/commands/index.html b/commands/index.html new file mode 100644 index 00000000..01f0b957 --- /dev/null +++ b/commands/index.html @@ -0,0 +1,19 @@ +--- +layout: default +title: Built-in Commands +display_global_parameters: true +--- + + + + + + + + + + {% include cmd-list.html %} + +
CommandDescription
+ +

Also see the list of community commands.

diff --git a/commands/media/import/index.md b/commands/media/import/index.md index 7791aae0..07b987ea 100644 --- a/commands/media/import/index.md +++ b/commands/media/import/index.md @@ -1,4 +1,67 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/media/import/ ---- \ No newline at end of file +layout: default +title: 'wp media import' +display_global_parameters: true +--- + +[Commands](/commands/) » [media](/commands/media/) » import + +`wp media import` - Create attachments from local files or from URLs. + +Quick links: Github issues + +
+ +### 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. + +[\--porcelain] +: Output just the new attachment id. + +### EXAMPLES + + # Import all jpgs in the current user's "Pictures" directory, not attached to any post + $ wp media import ~/Pictures/**\/*.jpg + Success: Imported file /home/person/Pictures/beautiful-youg-girl-in-ivy.jpg as attachment ID 1751. + Success: Imported file /home/person/Pictures/fashion-girl.jpg as attachment ID 1752. + + # 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 + Success: Imported file /home/person/Downloads/image.png as attachment ID 1753 and attached to post 123 as featured image. + + # Import a local image, but set it as the featured image for all posts + # 1. Import the image and get its attachment ID + # 2. Assign the attachment ID as the featured image for all posts + $ ATTACHMENT_ID="$(wp media import ~/Downloads/image.png --porcelain)" + $ wp post list --post_type=post --format=ids | xargs -0 -d ' ' -I % wp post meta add % _thumbnail_id $ATTACHMENT_ID + Success: Added custom field. + Success: Added custom field. + + # 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" + Success: Imported file http://s.wordpress.org/style/images/wp-header-logo.png as attachment ID 1755. + + + diff --git a/commands/media/index.md b/commands/media/index.md index 3d6aaba6..e37cf4f5 100644 --- a/commands/media/index.md +++ b/commands/media/index.md @@ -1,4 +1,50 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/media/ ---- \ No newline at end of file +layout: default +title: 'wp media' +display_global_parameters: true +--- + +[Commands](/commands/) » media + +`wp media` - Manage attachments. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Re-generate all thumbnails, without confirmation + $ wp media regenerate --yes + Found 3 images to regenerate. + Regenerated thumbnails for "Sydney Harbor Bridge" (ID 760). + Regenerated thumbnails for "Boardwalk" (ID 757). + Regenerated thumbnails for "Sunburst Over River" (ID 756). + Success: Finished regenerating all images. + + # Import a local image and set it to be the featured image for a post + $ wp media import ~/Downloads/image.png --post_id=123 --title="A downloaded picture" --featured_image + Success: Imported file /home/person/Downloads/image.png as attachment ID 1753 and attached to post 123 as featured image. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + +
NameDescription
importCreate attachments from local files or from URLs.
regenerateRegenerate thumbnail(s).
diff --git a/commands/media/regenerate/index.md b/commands/media/regenerate/index.md index 421570e0..96304f19 100644 --- a/commands/media/regenerate/index.md +++ b/commands/media/regenerate/index.md @@ -1,4 +1,49 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/media/regenerate/ ---- \ No newline at end of file +layout: default +title: 'wp media regenerate' +display_global_parameters: true +--- + +[Commands](/commands/) » [media](/commands/media/) » regenerate + +`wp media regenerate` - Regenerate thumbnail(s). + +Quick links: Github issues + +
+ +### OPTIONS + +[<attachment-id>...] +: One or more IDs of the attachments to regenerate. + +[\--skip-delete] +: Skip deletion of the original thumbnails. If your thumbnails are linked from sources outside your control, it's likely best to leave them around. Defaults to false. + +[\--only-missing] +: Only generate thumbnails for images missing image sizes. + +[\--yes] +: Answer yes to the confirmation message. + +### EXAMPLES + + # Re-generate all thumbnails, without confirmation + $ wp media regenerate --yes + Found 3 images to regenerate. + Regenerated thumbnails for "Sydney Harbor Bridge" (ID 760). + Regenerated thumbnails for "Boardwalk" (ID 757). + Regenerated thumbnails for "Sunburst Over River" (ID 756). + Success: Finished regenerating all images. + + # Re-generate all thumbnails that have IDs between 1000 and 2000 + $ seq 1000 2000 | xargs wp media regenerate + Found 4 images to regenerate. + Regenerated thumbnails for "Vertical Featured Image" (ID 1027). + Regenerated thumbnails for "Horizontal Featured Image" (ID 1022). + Regenerated thumbnails for "Unicorn Wallpaper" (ID 1045). + Regenerated thumbnails for "I Am Worth Loving Wallpaper" (ID 1023). + Success: Finished regenerating all images. + + + diff --git a/commands/menu/create/index.md b/commands/menu/create/index.md index 328f015f..e969d684 100644 --- a/commands/menu/create/index.md +++ b/commands/menu/create/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/create/ ---- \ No newline at end of file +layout: default +title: 'wp menu create' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » create + +`wp menu create` - Create a new menu. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu-name> +: A descriptive name for the menu. + +[\--porcelain] +: Output just the new menu id. + +### EXAMPLES + + $ wp menu create "My Menu" + Success: Created menu 200. + + + diff --git a/commands/menu/delete/index.md b/commands/menu/delete/index.md index a82ae40d..45d095eb 100644 --- a/commands/menu/delete/index.md +++ b/commands/menu/delete/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/delete/ ---- \ No newline at end of file +layout: default +title: 'wp menu delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » delete + +`wp menu delete` - Delete one or more menus. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu>... +: The name, slug, or term ID for the menu(s). + +### EXAMPLES + + $ wp menu delete "My Menu" + Success: Menu(s) deleted. + + + diff --git a/commands/menu/index.md b/commands/menu/index.md index ef050659..822644ee 100644 --- a/commands/menu/index.md +++ b/commands/menu/index.md @@ -1,4 +1,71 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/ ---- \ No newline at end of file +layout: default +title: 'wp menu' +display_global_parameters: true +--- + +[Commands](/commands/) » menu + +`wp menu` - List, create, assign, and delete menus. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Create a new menu + $ wp menu create "My Menu" + Success: Created menu 200. + + # List existing menus + $ wp menu list + +---------+----------+----------+-----------+-------+ + | term_id | name | slug | locations | count | + +---------+----------+----------+-----------+-------+ + | 200 | My Menu | my-menu | | 0 | + | 177 | Top Menu | top-menu | primary | 7 | + +---------+----------+----------+-----------+-------+ + + # Create a new menu link item + $ wp menu item add-custom my-menu Apple http://apple.com --porcelain + 1922 + + # Assign the 'my-menu' menu to the 'primary' location + $ wp menu location assign my-menu primary + Success: Assigned location to menu. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
createCreate a new menu.
deleteDelete one or more menus.
itemList, add, and delete items associated with a menu.
listGet a list of menus.
locationManage a menu's assignment to locations.
diff --git a/commands/menu/item/add-custom/index.md b/commands/menu/item/add-custom/index.md index 50474c1b..e0024f90 100644 --- a/commands/menu/item/add-custom/index.md +++ b/commands/menu/item/add-custom/index.md @@ -1,4 +1,53 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/add-custom/ ---- \ No newline at end of file +layout: default +title: 'wp menu item add-custom' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [item](/commands/menu/item/) » add-custom + +`wp menu item add-custom` - Add a custom menu item. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu> +: The name, slug, or term ID for the menu. + +<title> +: Title for the link. + +<link> +: Target URL for the link. + +[\--description=<description>] +: Set a custom description for the menu item. + +[\--attr-title=<attr-title>] +: Set a custom title attribute for the menu item. + +[\--target=<target>] +: Set a custom link target for the menu item. + +[\--classes=<classes>] +: Set a custom link classes for the menu item. + +[\--position=<position>] +: Specify the position of this menu item. + +[\--parent-id=<parent-id>] +: Make this menu item a child of another menu item. + +[\--porcelain] +: Output just the new menu item id. + +### EXAMPLES + + $ wp menu item add-custom sidebar-menu Apple http://apple.com + Success: Menu item added. + + + diff --git a/commands/menu/item/add-post/index.md b/commands/menu/item/add-post/index.md index 9f20940e..b29908f5 100644 --- a/commands/menu/item/add-post/index.md +++ b/commands/menu/item/add-post/index.md @@ -1,4 +1,56 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/add-post/ ---- \ No newline at end of file +layout: default +title: 'wp menu item add-post' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [item](/commands/menu/item/) » add-post + +`wp menu item add-post` - Add a post as a menu item. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu> +: The name, slug, or term ID for the menu. + +<post-id> +: Post ID to add to the menu. + +[\--title=<title>] +: Set a custom title for the menu item. + +[\--link=<link>] +: Set a custom url for the menu item. + +[\--description=<description>] +: Set a custom description for the menu item. + +[\--attr-title=<attr-title>] +: Set a custom title attribute for the menu item. + +[\--target=<target>] +: Set a custom link target for the menu item. + +[\--classes=<classes>] +: Set a custom link classes for the menu item. + +[\--position=<position>] +: Specify the position of this menu item. + +[\--parent-id=<parent-id>] +: Make this menu item a child of another menu item. + +[\--porcelain] +: Output just the new menu item id. + +### EXAMPLES + + $ wp menu item add-post sidebar-menu 33 --title="Custom Test Post" + Success: Menu item added. + + + diff --git a/commands/menu/item/add-term/index.md b/commands/menu/item/add-term/index.md index da0b9d23..8c307ee8 100644 --- a/commands/menu/item/add-term/index.md +++ b/commands/menu/item/add-term/index.md @@ -1,4 +1,59 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/add-term/ ---- \ No newline at end of file +layout: default +title: 'wp menu item add-term' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [item](/commands/menu/item/) » add-term + +`wp menu item add-term` - Add a taxonomy term as a menu item. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu> +: The name, slug, or term ID for the menu. + +<taxonomy> +: Taxonomy of the term to be added. + +<term-id> +: Term ID of the term to be added. + +[\--title=<title>] +: Set a custom title for the menu item. + +[\--link=<link>] +: Set a custom url for the menu item. + +[\--description=<description>] +: Set a custom description for the menu item. + +[\--attr-title=<attr-title>] +: Set a custom title attribute for the menu item. + +[\--target=<target>] +: Set a custom link target for the menu item. + +[\--classes=<classes>] +: Set a custom link classes for the menu item. + +[\--position=<position>] +: Specify the position of this menu item. + +[\--parent-id=<parent-id>] +: Make this menu item a child of another menu item. + +[\--porcelain] +: Output just the new menu item id. + +### EXAMPLES + + $ wp menu item add-term sidebar-menu post_tag 24 + Success: Menu item added. + + + diff --git a/commands/menu/item/delete/index.md b/commands/menu/item/delete/index.md index 7c748e70..ff3d1218 100644 --- a/commands/menu/item/delete/index.md +++ b/commands/menu/item/delete/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/delete/ ---- \ No newline at end of file +layout: default +title: 'wp menu item delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [item](/commands/menu/item/) » delete + +`wp menu item delete` - Delete one or more items from a menu. + +Quick links: Github issues + +
+ +### OPTIONS + +<db-id>... +: Database ID for the menu item(s). + +### EXAMPLES + + $ wp menu item delete 45 + Success: Menu item(s) deleted. + + + diff --git a/commands/menu/item/index.md b/commands/menu/item/index.md index f09f1f86..5d05eeda 100644 --- a/commands/menu/item/index.md +++ b/commands/menu/item/index.md @@ -1,4 +1,68 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/ ---- \ No newline at end of file +layout: default +title: 'wp menu item' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » item + +`wp menu item` - List, add, and delete items associated with a menu. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Add an existing post to an existing menu + $ wp menu item add-post sidebar-menu 33 --title="Custom Test Post" + Success: Menu item added. + + # Create a new menu link item + $ wp menu item add-custom sidebar-menu Apple http://apple.com + Success: Menu item added. + + # Delete menu item + $ wp menu item delete 45 + Success: Menu item(s) deleted. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
add-customAdd a custom menu item.
add-postAdd a post as a menu item.
add-termAdd a taxonomy term as a menu item.
deleteDelete one or more items from a menu.
listGet a list of items associated with a menu.
updateUpdate a menu item.
diff --git a/commands/menu/item/list/index.md b/commands/menu/item/list/index.md index 0713b338..d39ec53c 100644 --- a/commands/menu/item/list/index.md +++ b/commands/menu/item/list/index.md @@ -1,4 +1,70 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/list/ ---- \ No newline at end of file +layout: default +title: 'wp menu item list' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [item](/commands/menu/item/) » list + +`wp menu item list` - Get a list of items associated with a menu. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu> +: The name, slug, or term ID for the menu. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - ids + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each menu item: + +* db_id +* type +* title +* link +* position + +These fields are optionally available: + +* menu_item_parent +* object_id +* object +* type +* type_label +* target +* attr_title +* description +* classes +* xfn + +### EXAMPLES + + $ wp menu item list main-menu + +-------+-----------+-------------+---------------------------------+----------+ + | db_id | type | title | link | position | + +-------+-----------+-------------+---------------------------------+----------+ + | 5 | custom | Home | http://example.com | 1 | + | 6 | post_type | Sample Page | http://example.com/sample-page/ | 2 | + +-------+-----------+-------------+---------------------------------+----------+ + + + diff --git a/commands/menu/item/update/index.md b/commands/menu/item/update/index.md index 01b68582..3972cee0 100644 --- a/commands/menu/item/update/index.md +++ b/commands/menu/item/update/index.md @@ -1,4 +1,50 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/item/update/ ---- \ No newline at end of file +layout: default +title: 'wp menu item update' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [item](/commands/menu/item/) » update + +`wp menu item update` - Update a menu item. + +Quick links: Github issues + +
+ +### OPTIONS + +<db-id> +: Database ID for the menu item. + +[\--title=<title>] +: Set a custom title for the menu item. + +[\--link=<link>] +: Set a custom url for the menu item. + +[\--description=<description>] +: Set a custom description for the menu item. + +[\--attr-title=<attr-title>] +: Set a custom title attribute for the menu item. + +[\--target=<target>] +: Set a custom link target for the menu item. + +[\--classes=<classes>] +: Set a custom link classes for the menu item. + +[\--position=<position>] +: Specify the position of this menu item. + +[\--parent-id=<parent-id>] +: Make this menu item a child of another menu item. + +### EXAMPLES + + $ wp menu item update 45 --title=WordPress --link='http://wordpress.org' --target=_blank --position=2 + Success: Menu item updated. + + + diff --git a/commands/menu/list/index.md b/commands/menu/list/index.md index fded4a73..75dd1c28 100644 --- a/commands/menu/list/index.md +++ b/commands/menu/list/index.md @@ -1,4 +1,62 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/list/ ---- \ No newline at end of file +layout: default +title: 'wp menu list' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » list + +`wp menu list` - Get a list of menus. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - ids + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each menu: + +* term_id +* name +* slug +* count + +These fields are optionally available: + +* term_group +* term_taxonomy_id +* taxonomy +* description +* parent +* locations + +### EXAMPLES + + $ wp menu list + +---------+----------+----------+-----------+-------+ + | term_id | name | slug | locations | count | + +---------+----------+----------+-----------+-------+ + | 200 | My Menu | my-menu | | 0 | + | 177 | Top Menu | top-menu | primary | 7 | + +---------+----------+----------+-----------+-------+ + + + diff --git a/commands/menu/location/assign/index.md b/commands/menu/location/assign/index.md index 9c746201..68000690 100644 --- a/commands/menu/location/assign/index.md +++ b/commands/menu/location/assign/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/location/assign/ ---- \ No newline at end of file +layout: default +title: 'wp menu location assign' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [location](/commands/menu/location/) » assign + +`wp menu location assign` - Assign a location to a menu. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu> +: The name, slug, or term ID for the menu. + +<location> +: Location's slug. + +### EXAMPLES + + $ wp menu location assign primary-menu primary + Success: Assigned location to menu. + + + diff --git a/commands/menu/location/index.md b/commands/menu/location/index.md index c66f02e5..c261b752 100644 --- a/commands/menu/location/index.md +++ b/commands/menu/location/index.md @@ -1,4 +1,61 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/location/ ---- \ No newline at end of file +layout: default +title: 'wp menu location' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » location + +`wp menu location` - Manage a menu's assignment to locations. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List available menu locations + $ wp menu location list + +----------+-------------------+ + | location | description | + +----------+-------------------+ + | primary | Primary Menu | + | social | Social Links Menu | + +----------+-------------------+ + + # Assign the 'primary-menu' menu to the 'primary' location + $ wp menu location assign primary-menu primary + Success: Assigned location to menu. + + # Remove the 'primary-menu' menu from the 'primary' location + $ wp menu location remove primary-menu primary + Success: Removed location from menu. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
assignAssign a location to a menu.
listList locations for the current theme.
removeRemove a location from a menu.
diff --git a/commands/menu/location/list/index.md b/commands/menu/location/list/index.md index 6d1e3701..ffe112c3 100644 --- a/commands/menu/location/list/index.md +++ b/commands/menu/location/list/index.md @@ -1,4 +1,48 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/location/list/ ---- \ No newline at end of file +layout: default +title: 'wp menu location list' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [location](/commands/menu/location/) » list + +`wp menu location list` - List locations for the current theme. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - yaml + - ids +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each location: + +* name +* description + +### EXAMPLES + + $ wp menu location list + +----------+-------------------+ + | location | description | + +----------+-------------------+ + | primary | Primary Menu | + | social | Social Links Menu | + +----------+-------------------+ + + + diff --git a/commands/menu/location/remove/index.md b/commands/menu/location/remove/index.md index fb4ceb5a..3f547937 100644 --- a/commands/menu/location/remove/index.md +++ b/commands/menu/location/remove/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/menu/location/remove/ ---- \ No newline at end of file +layout: default +title: 'wp menu location remove' +display_global_parameters: true +--- + +[Commands](/commands/) » [menu](/commands/menu/) » [location](/commands/menu/location/) » remove + +`wp menu location remove` - Remove a location from a menu. + +Quick links: Github issues + +
+ +### OPTIONS + +<menu> +: The name, slug, or term ID for the menu. + +<location> +: Location's slug. + +### EXAMPLES + + $ wp menu location remove primary-menu primary + Success: Removed location from menu. + + + diff --git a/commands/network/index.md b/commands/network/index.md index 3c879aac..13a77cdc 100644 --- a/commands/network/index.md +++ b/commands/network/index.md @@ -1,4 +1,34 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/ ---- \ No newline at end of file +layout: default +title: 'wp network' +display_global_parameters: true +--- + +[Commands](/commands/) » network + +`wp network` - + +Quick links: Github issues + +
+ + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + +
NameDescription
metaManage network custom fields.
diff --git a/commands/network/meta/add/index.md b/commands/network/meta/add/index.md index 860053db..1a06333f 100644 --- a/commands/network/meta/add/index.md +++ b/commands/network/meta/add/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/meta/add/ ---- \ No newline at end of file +layout: default +title: 'wp network meta add' +display_global_parameters: true +--- + +[Commands](/commands/) » [network](/commands/network/) » [meta](/commands/network/meta/) » add + +`wp network meta add` - Add a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to create. + +[<value>] +: The value of the meta field. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/network/meta/delete/index.md b/commands/network/meta/delete/index.md index 01f0800c..5c17e072 100644 --- a/commands/network/meta/delete/index.md +++ b/commands/network/meta/delete/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/meta/delete/ ---- \ No newline at end of file +layout: default +title: 'wp network meta delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [network](/commands/network/) » [meta](/commands/network/meta/) » delete + +`wp network meta delete` - Delete a meta field. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +[<key>] +: The name of the meta field to delete. + +[<value>] +: The value to delete. If omitted, all rows with key will deleted. + +[\--all] +: Delete all meta for the object. + + + diff --git a/commands/network/meta/get/index.md b/commands/network/meta/get/index.md index 16932de1..253a5c02 100644 --- a/commands/network/meta/get/index.md +++ b/commands/network/meta/get/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/meta/get/ ---- \ No newline at end of file +layout: default +title: 'wp network meta get' +display_global_parameters: true +--- + +[Commands](/commands/) » [network](/commands/network/) » [meta](/commands/network/meta/) » get + +`wp network meta get` - Get meta field value. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<key> +: The name of the meta field to get. + +[\--format=<format>] +: Accepted values: table, json. Default: table + + + diff --git a/commands/network/meta/index.md b/commands/network/meta/index.md index cdeaca95..48cab1ef 100644 --- a/commands/network/meta/index.md +++ b/commands/network/meta/index.md @@ -1,4 +1,58 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/meta/ ---- \ No newline at end of file +layout: default +title: 'wp network meta' +display_global_parameters: true +--- + +[Commands](/commands/) » [network](/commands/network/) » meta + +`wp network meta` - Manage network custom fields. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Get a list of super-admins + $ wp network meta get 1 site_admins + array ( + 0 => 'supervisor', + ) + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a meta field.
deleteDelete a meta field.
getGet meta field value.
listList all metadata associated with an object.
updateUpdate a meta field.
diff --git a/commands/network/meta/list/index.md b/commands/network/meta/list/index.md index a3fed3c7..58a3c681 100644 --- a/commands/network/meta/list/index.md +++ b/commands/network/meta/list/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/meta/list/ ---- \ No newline at end of file +layout: default +title: 'wp network meta list' +display_global_parameters: true +--- + +[Commands](/commands/) » [network](/commands/network/) » [meta](/commands/network/meta/) » list + +`wp network meta list` - List all metadata associated with an object. + +Quick links: Github issues + +
+ +<id> +: ID for the object. + +[\--keys=<keys>] +: Limit output to metadata of specific keys. + +[\--fields=<fields>] +: Limit the output to specific row fields. Defaults to id,meta_key,meta_value. + +[\--format=<format>] +: Accepted values: table, csv, json, count. Default: table + + + diff --git a/commands/network/meta/update/index.md b/commands/network/meta/update/index.md index b22e3a32..e2d2e492 100644 --- a/commands/network/meta/update/index.md +++ b/commands/network/meta/update/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/network/meta/update/ ---- \ No newline at end of file +layout: default +title: 'wp network meta update' +display_global_parameters: true +--- + +[Commands](/commands/) » [network](/commands/network/) » [meta](/commands/network/meta/) » update + +`wp network meta update` - Update a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to update. + +[<value>] +: The new value. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/option/add/index.md b/commands/option/add/index.md index 403f7920..8f9694d0 100644 --- a/commands/option/add/index.md +++ b/commands/option/add/index.md @@ -1,4 +1,48 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/option/add/ ---- \ No newline at end of file +layout: default +title: 'wp option add' +display_global_parameters: true +--- + +[Commands](/commands/) » [option](/commands/option/) » add + +`wp option add` - Add an option. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: The name of the option to add. + +[<value>] +: The value of the option to add. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. +\--- +default: plaintext +options: + - plaintext + - json +\--- + +[\--autoload=<autoload>] +: Should this option be automatically loaded. +\--- +default: yes +options: + - yes + - no +\--- + +### EXAMPLES + + # Create an option by reading a JSON file + $ wp option add my_option --format=json < config.json + Success: Added 'my_option' option. + + + diff --git a/commands/option/delete/index.md b/commands/option/delete/index.md index d471a9c3..a547809b 100644 --- a/commands/option/delete/index.md +++ b/commands/option/delete/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/option/delete/ ---- \ No newline at end of file +layout: default +title: 'wp option delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [option](/commands/option/) » delete + +`wp option delete` - Delete an option. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Key for the option. + +### EXAMPLES + + $ wp option delete my_option + Success: Deleted 'my_option' option. + + + diff --git a/commands/option/get/index.md b/commands/option/get/index.md index 56bd6852..778004b3 100644 --- a/commands/option/get/index.md +++ b/commands/option/get/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/option/get/ ---- \ No newline at end of file +layout: default +title: 'wp option get' +display_global_parameters: true +--- + +[Commands](/commands/) » [option](/commands/option/) » get + +`wp option get` - Get an option. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Key for the option. + +[\--format=<format>] +: Get value in a particular format. +\--- +default: var_export +options: + - var_export + - json + - yaml +\--- + +### EXAMPLES + + # Get option + $ wp option get home + http://example.com + + # Get option in JSON format + $ wp option get active_plugins --format=json + {"0":"dynamically-dynamic-sidebar\/dynamically-dynamic-sidebar.php","1":"monster-widget\/monster-widget.php","2":"show-current-template\/show-current-template.php","3":"theme-check\/theme-check.php","5":"wordpress-importer\/wordpress-importer.php"} + + + diff --git a/commands/option/index.md b/commands/option/index.md index 637929ff..39b4fed1 100644 --- a/commands/option/index.md +++ b/commands/option/index.md @@ -1,4 +1,71 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/option/ ---- \ No newline at end of file +layout: default +title: 'wp option' +display_global_parameters: true +--- + +[Commands](/commands/) » option + +`wp option` - Manage options. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--format=json] +: Encode/decode values as JSON. + +### EXAMPLES + + # Get site URL + $ wp option get siteurl + http://example.com + + # Add option + $ wp option add my_option foobar + Success: Added 'my_option' option. + + # Update option + $ wp option update my_option '{"foo": "bar"}' --format=json + Success: Updated 'my_option' option. + + # Delete option + $ wp option delete my_option + Success: Deleted 'my_option' option. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd an option.
deleteDelete an option.
getGet an option.
listList options.
updateUpdate an option.
diff --git a/commands/option/list/index.md b/commands/option/list/index.md index 926ae1b4..6a8bf429 100644 --- a/commands/option/list/index.md +++ b/commands/option/list/index.md @@ -1,4 +1,84 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/option/list/ ---- \ No newline at end of file +layout: default +title: 'wp option list' +display_global_parameters: true +--- + +[Commands](/commands/) » [option](/commands/option/) » list + +`wp option list` - List options. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--search=<pattern>] +: Use wildcards ( * and ? ) to match option name. + +[\--autoload=<value>] +: Match only autoload options when value is on, and only not-autoload option when off. + +[\--field=<field>] +: Prints the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: The serialization format for the value. total_bytes displays the total size of matching options in bytes. +\--- +default: table +options: + - table + - json + - csv + - count + - yaml + - total_bytes +\--- + +### AVAILABLE FIELDS + +This field will be displayed by default for each matching option: + +* option_name +* option_value + +These fields are optionally available: + +* autoload +* size_bytes + +### EXAMPLES + + # Get the total size of all autoload options + $ wp option list --autoload=on --format=total_bytes + 33198 + + # Find biggest transients + $ wp option list --search="*_transient_*" --fields=option_name,size_bytes | sort -n -k 2 | tail + option_name size_bytes + _site_transient_timeout_theme_roots 10 + _site_transient_theme_roots 76 + _site_transient_update_themes 181 + _site_transient_update_core 808 + _site_transient_update_plugins 6645 + + # List all options begining with "i2f_" + $ wp option list --search="i2f_*" + +-------------+--------------+ + | option_name | option_value | + +-------------+--------------+ + | i2f_version | 0.1.0 | + +-------------+--------------+ + + # Delete all options begining with "theme_mods_" + $ wp option list --search="theme_mods_*" --field=option_name | xargs -0 -d '\n' -I % wp option delete % + Success: Deleted 'theme_mods_twentysixteen' option. + Success: Deleted 'theme_mods_twentfifteen' option. + Success: Deleted 'theme_mods_twentyfourteen' option. + + + diff --git a/commands/option/update/index.md b/commands/option/update/index.md index d9f799f0..b364d80b 100644 --- a/commands/option/update/index.md +++ b/commands/option/update/index.md @@ -1,4 +1,53 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/option/update/ ---- \ No newline at end of file +layout: default +title: 'wp option update' +display_global_parameters: true +--- + +[Commands](/commands/) » [option](/commands/option/) » update + +`wp option update` - Update an option. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: The name of the option to add. + +[<value>] +: The new value. If ommited, the value is read from STDIN. + +[\--autoload=<autoload>] +: Requires WP 4.2. Should this option be automatically loaded. +\--- +default: yes +options: + - yes + - no +\--- + +[\--format=<format>] +: The serialization format for the value. +\--- +default: plaintext +options: + - plaintext + - json +\--- + +### EXAMPLES + + # Update an option by reading from a file + $ wp option update my_option < value.txt + Success: Updated 'my_option' option. + + # Update one option on multiple sites using xargs + $ wp site list --field=url | xargs -n1 -I {} sh -c 'wp --url={} option update my_option my_value' + Success: Updated 'my_option' option. + Success: Updated 'my_option' option. + + + diff --git a/commands/package/browse/index.md b/commands/package/browse/index.md index b0ad5d4f..2cd20bda 100644 --- a/commands/package/browse/index.md +++ b/commands/package/browse/index.md @@ -1,4 +1,52 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/browse/ ---- \ No newline at end of file +layout: default +title: 'wp package browse' +display_global_parameters: true +--- + +[Commands](/commands/) » [package](/commands/package/) » browse + +`wp package browse` - Browse WP-CLI packages available for installation. + +Quick links: Github issues + +
+ +Lists packages available for installation from the [Package Index](http://wp-cli.org/package-index/). + +### OPTIONS + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - ids + - json + - yaml +\--- + +### EXAMPLES + + $ wp package browse --format=yaml + --- + 10up/mu-migration: + name: 10up/mu-migration + description: A set of WP-CLI commands to support the migration of single WordPress instances to multisite + authors: Nícholas André + version: dev-master, dev-develop + aaemnnosttv/wp-cli-dotenv-command: + name: aaemnnosttv/wp-cli-dotenv-command + description: Dotenv commands for WP-CLI + authors: Evan Mattson + version: v0.1, v0.1-beta.1, v0.2, dev-master, dev-dev, dev-develop, dev-tests/behat + aaemnnosttv/wp-cli-http-command: + name: aaemnnosttv/wp-cli-http-command + description: WP-CLI command for using the WordPress HTTP API + authors: Evan Mattson + version: dev-master + + + diff --git a/commands/package/index.md b/commands/package/index.md index ebb25bcf..a88e19ee 100644 --- a/commands/package/index.md +++ b/commands/package/index.md @@ -1,4 +1,92 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/ ---- \ No newline at end of file +layout: default +title: 'wp package' +display_global_parameters: true +--- + +[Commands](/commands/) » package + +`wp package` - Manage WP-CLI packages. + +Quick links: Github issues + +
+ +WP-CLI packages are community-maintained projects built on WP-CLI. They can +contain WP-CLI commands, but they can also just extend WP-CLI in some way. + +Installable packages are listed in the +[Package Index](http://wp-cli.org/package-index/). + +Learn how to create your own command from the +[Commands Cookbook](http://wp-cli.org/docs/commands-cookbook/) + +### EXAMPLES + + # List installed packages + $ wp package list + +-----------------------+------------------------------------------+---------+------------+ + | name | description | authors | version | + +-----------------------+------------------------------------------+---------+------------+ + | wp-cli/server-command | Start a development server for WordPress | | dev-master | + +-----------------------+------------------------------------------+---------+------------+ + + # Install the latest development version of the package + $ wp package install wp-cli/server-command + Installing wp-cli/server-command (dev-master) + Updating /home/person/.wp-cli/packages/composer.json to require the package... + Using Composer to install the package... + --- + Loading composer repositories with package information + Updating dependencies + Resolving dependencies through SAT + Dependency resolution completed in 0.005 seconds + Analyzed 732 packages to resolve dependencies + Analyzed 1034 rules to resolve dependencies + - Installing package + Writing lock file + Generating autoload files + --- + Success: Package installed successfully. + + # Uninstall package + $ wp package uninstall wp-cli/server-command + Removing require statement from /home/person/.wp-cli/packages/composer.json + Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command + Regenerating Composer autoload. + Success: Uninstalled package. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
browseBrowse WP-CLI packages available for installation.
installInstall a WP-CLI package.
listList installed WP-CLI packages.
pathGet the path to an installed WP-CLI package, or the package directory.
uninstallUninstall a WP-CLI package.
diff --git a/commands/package/install/index.md b/commands/package/install/index.md index ff315b55..d767921c 100644 --- a/commands/package/install/index.md +++ b/commands/package/install/index.md @@ -1,4 +1,44 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/install/ ---- \ No newline at end of file +layout: default +title: 'wp package install' +display_global_parameters: true +--- + +[Commands](/commands/) » [package](/commands/package/) » install + +`wp package install` - Install a WP-CLI package. + +Quick links: Github issues + +
+ +### OPTIONS + +<name> +: Name of the package to install. Can optionally contain a version constraint. + +### EXAMPLES + + # Install the latest development version + $ wp package install wp-cli/server-command + Installing wp-cli/server-command (dev-master) + Updating /home/person/.wp-cli/packages/composer.json to require the package... + Using Composer to install the package... + --- + Loading composer repositories with package information + Updating dependencies + Resolving dependencies through SAT + Dependency resolution completed in 0.005 seconds + Analyzed 732 packages to resolve dependencies + Analyzed 1034 rules to resolve dependencies + - Installing package + Writing lock file + Generating autoload files + --- + Success: Package installed successfully. + + # Install the latest stable version + $ wp package install wp-cli/server-command:@stable + + + diff --git a/commands/package/list/index.md b/commands/package/list/index.md index 0df19ed1..daa5fcf0 100644 --- a/commands/package/list/index.md +++ b/commands/package/list/index.md @@ -1,4 +1,39 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/list/ ---- \ No newline at end of file +layout: default +title: 'wp package list' +display_global_parameters: true +--- + +[Commands](/commands/) » [package](/commands/package/) » list + +`wp package list` - List installed WP-CLI packages. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - ids + - json + - yaml +\--- + +### EXAMPLES + + $ wp package list + +-----------------------+------------------------------------------+---------+------------+ + | name | description | authors | version | + +-----------------------+------------------------------------------+---------+------------+ + | wp-cli/server-command | Start a development server for WordPress | | dev-master | + +-----------------------+------------------------------------------+---------+------------+ + + + diff --git a/commands/package/path/index.md b/commands/package/path/index.md index a29adb9d..3de7cd68 100644 --- a/commands/package/path/index.md +++ b/commands/package/path/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/path/ ---- \ No newline at end of file +layout: default +title: 'wp package path' +display_global_parameters: true +--- + +[Commands](/commands/) » [package](/commands/package/) » path + +`wp package path` - Get the path to an installed WP-CLI package, or the package directory. + +Quick links: Github issues + +
+ +If you want to contribute to a package, this is a great way to jump to it. + +### OPTIONS + +[<name>] +: Name of the package to get the directory for. + +### EXAMPLES + + # Get package path + $ wp package path + /home/person/.wp-cli/packages/ + + # Change directory to package path + $ cd $(wp package path) && pwd + /home/vagrant/.wp-cli/packages + + + diff --git a/commands/package/uninstall/index.md b/commands/package/uninstall/index.md index 847871ae..1ee0ce50 100644 --- a/commands/package/uninstall/index.md +++ b/commands/package/uninstall/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/uninstall/ ---- \ No newline at end of file +layout: default +title: 'wp package uninstall' +display_global_parameters: true +--- + +[Commands](/commands/) » [package](/commands/package/) » uninstall + +`wp package uninstall` - Uninstall a WP-CLI package. + +Quick links: Github issues + +
+ +### OPTIONS + +<name> +: Name of the package to uninstall. + +### EXAMPLES + + $ wp package uninstall wp-cli/server-command + Removing require statement from /home/person/.wp-cli/packages/composer.json + Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command + Regenerating Composer autoload. + Success: Uninstalled package. + + + diff --git a/commands/package/update/index.md b/commands/package/update/index.md deleted file mode 100644 index 33f5b728..00000000 --- a/commands/package/update/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/package/update/ ---- \ No newline at end of file diff --git a/commands/plugin/activate/index.md b/commands/plugin/activate/index.md index 0fd2b1f1..5f102ec1 100644 --- a/commands/plugin/activate/index.md +++ b/commands/plugin/activate/index.md @@ -1,4 +1,37 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/activate/ ---- \ No newline at end of file +layout: default +title: 'wp plugin activate' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » activate + +`wp plugin activate` - Activate a plugin. + +Quick links: Github issues + +
+ +### OPTIONS + +[<plugin>...] +: One or more plugins to activate. + +[\--all] +: If set, all plugins will be activated. + +[\--network] +: If set, the plugin will be activated for the entire multisite network. + +### EXAMPLES + + # Activate plugin + $ wp plugin activate hello-dolly + Success: Plugin 'hello-dolly' activated. + + # Activate plugin in entire multisite network + $ wp plugin activate hello-dolly --network + Success: Plugin 'hello-dolly' network activated. + + + diff --git a/commands/plugin/deactivate/index.md b/commands/plugin/deactivate/index.md index 05aaf682..99eb8ca8 100644 --- a/commands/plugin/deactivate/index.md +++ b/commands/plugin/deactivate/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/deactivate/ ---- \ No newline at end of file +layout: default +title: 'wp plugin deactivate' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » deactivate + +`wp plugin deactivate` - Deactivate a plugin. + +Quick links: Github issues + +
+ +### OPTIONS + +[<plugin>...] +: One or more plugins to deactivate. + +[\--uninstall] +: Uninstall the plugin after deactivation. + +[\--all] +: If set, all plugins will be deactivated. + +[\--network] +: If set, the plugin will be deactivated for the entire multisite network. + +### EXAMPLES + + # Deactivate plugin + $ wp plugin deactivate hello-dolly + Success: Plugin 'hello-dolly' deactivated. + + + diff --git a/commands/plugin/delete/index.md b/commands/plugin/delete/index.md index 4d0e9541..88687118 100644 --- a/commands/plugin/delete/index.md +++ b/commands/plugin/delete/index.md @@ -1,4 +1,31 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/delete/ ---- \ No newline at end of file +layout: default +title: 'wp plugin delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » delete + +`wp plugin delete` - Delete plugin files without deactivating or uninstalling. + +Quick links: Github issues + +
+ +### OPTIONS + +<plugin>... +: One or more plugins to delete. + +### EXAMPLES + + # Delete plugin + $ wp plugin delete hello + Success: Deleted 'hello' plugin. + + # Delete inactive plugins + $ wp plugin delete $(wp plugin list --status=inactive --field=name) + Success: Deleted 'tinymce-templates' plugin. + + + diff --git a/commands/plugin/get/index.md b/commands/plugin/get/index.md index dec04a29..05bba40a 100644 --- a/commands/plugin/get/index.md +++ b/commands/plugin/get/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/get/ ---- \ No newline at end of file +layout: default +title: 'wp plugin get' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » get + +`wp plugin get` - Get a plugin. + +Quick links: Github issues + +
+ +### OPTIONS + +<plugin> +: The plugin to get. + +[\--field=<field>] +: Instead of returning the whole plugin, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +### EXAMPLES + + $ wp plugin get bbpress --format=json + {"name":"bbpress","title":"bbPress","author":"The bbPress Contributors","version":"2.6-alpha","description":"bbPress is forum software with a twist from the creators of WordPress.","status":"active"} + + + diff --git a/commands/plugin/index.md b/commands/plugin/index.md index eb0260a9..9e33850b 100644 --- a/commands/plugin/index.md +++ b/commands/plugin/index.md @@ -1,4 +1,105 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/ ---- \ No newline at end of file +layout: default +title: 'wp plugin' +display_global_parameters: true +--- + +[Commands](/commands/) » plugin + +`wp plugin` - Manage plugins. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Activate plugin + $ wp plugin activate hello-dolly + Success: Plugin 'hello-dolly' activated. + + # Deactivate plugin + $ wp plugin deactivate hello-dolly + Success: Plugin 'hello-dolly' deactivated. + + # Delete plugin + $ wp plugin delete hello-dolly + Success: Deleted 'hello-dolly' plugin. + + # Install the latest version from wordpress.org and activate + $ wp plugin install bbpress --activate + Installing bbPress (2.5.9) + Downloading install package from https://downloads.wordpress.org/plugin/bbpress.2.5.9.zip... + Using cached file '/home/vagrant/.wp-cli/cache/plugin/bbpress-2.5.9.zip'... + Unpacking the package... + Installing the plugin... + Plugin installed successfully. + Activating 'bbpress'... + Success: Plugin 'bbpress' activated. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
activateActivate a plugin.
deactivateDeactivate a plugin.
deleteDelete plugin files without deactivating or uninstalling.
getGet a plugin.
installInstall a plugin.
is-installedCheck if the plugin is installed.
listGet a list of plugins.
pathGet the path to a plugin or to the plugin directory.
searchSearch the wordpress.org plugin repository.
statusSee the status of one or all plugins.
toggleToggle a plugin's activation state.
uninstallUninstall a plugin.
updateUpdate one or more plugins.
diff --git a/commands/plugin/install/index.md b/commands/plugin/install/index.md index 7682ff48..d9e0e1ff 100644 --- a/commands/plugin/install/index.md +++ b/commands/plugin/install/index.md @@ -1,4 +1,69 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/install/ ---- \ No newline at end of file +layout: default +title: 'wp plugin install' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » install + +`wp plugin install` - Install a plugin. + +Quick links: Github issues + +
+ +### 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. + +[\--activate-network] +: If set, the plugin will be network activated immediately after install + +### EXAMPLES + + # Install the latest version from wordpress.org and activate + $ wp plugin install bbpress --activate + Installing bbPress (2.5.9) + Downloading install package from https://downloads.wordpress.org/plugin/bbpress.2.5.9.zip... + Using cached file '/home/vagrant/.wp-cli/cache/plugin/bbpress-2.5.9.zip'... + Unpacking the package... + Installing the plugin... + Plugin installed successfully. + Activating 'bbpress'... + Success: Plugin 'bbpress' activated. + + # Install the development version from wordpress.org + $ wp plugin install bbpress --version=dev + Installing bbPress (Development Version) + Downloading install package from https://downloads.wordpress.org/plugin/bbpress.zip... + Unpacking the package... + Installing the plugin... + Plugin installed successfully. + + # Install from a local zip file + $ wp plugin install ../my-plugin.zip + Unpacking the package... + Installing the plugin... + Plugin installed successfully. + + # Install from a remote zip file + $ wp plugin install http://s3.amazonaws.com/bucketname/my-plugin.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef + Downloading install package from http://s3.amazonaws.com/bucketname/my-plugin.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef + Unpacking the package... + Installing the plugin... + Plugin installed successfully. + + + diff --git a/commands/plugin/is-installed/index.md b/commands/plugin/is-installed/index.md index d1cdedca..a776ebb6 100644 --- a/commands/plugin/is-installed/index.md +++ b/commands/plugin/is-installed/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/is-installed/ ---- \ No newline at end of file +layout: default +title: 'wp plugin is-installed' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » is-installed + +`wp plugin is-installed` - Check if the plugin is installed. + +Quick links: Github issues + +
+ +Returns exit code 0 when installed, 1 when uninstalled. + +### OPTIONS + +<plugin> +: The plugin to check. + +### EXAMPLES + + # Check whether plugin is installed; exit status 0 if installed, otherwise 1 + $ wp plugin is-installed hello-dolly + $ echo $? + 1 + + + diff --git a/commands/plugin/list/index.md b/commands/plugin/list/index.md index 40959e92..a84b920e 100644 --- a/commands/plugin/list/index.md +++ b/commands/plugin/list/index.md @@ -1,4 +1,76 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/list/ ---- \ No newline at end of file +layout: default +title: 'wp plugin list' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » list + +`wp plugin list` - Get a list of plugins. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: Filter results based on the value of a field. + +[\--field=<field>] +: Prints the value of a single field for each plugin. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - count + - json + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each plugin: + +* name +* status +* update +* version + +These fields are optionally available: + +* update_version +* update_package +* update_id +* title +* description + +### EXAMPLES + + $ wp plugin list --status=active --format=json + [{"name":"dynamic-hostname","status":"active","update":"none","version":"0.4.2"},{"name":"tinymce-templates","status":"active","update":"none","version":"4.4.3"},{"name":"wp-multibyte-patch","status":"active","update":"none","version":"2.4"},{"name":"wp-total-hacks","status":"active","update":"none","version":"2.0.1"}] + + # List plugins on each site in a network + $ wp site list --field=url | xargs -n 1 -I % wp plugin list --url=% + +------------------------------+----------------+-----------+------------+ + | name | status | update | version | + +------------------------------+----------------+-----------+------------+ + | akismet | active-network | none | 3.1.11 | + | hello | inactive | none | 1.6 | + +------------------------------+----------------+-----------+------------+ + +------------------------------+----------------+-----------+------------+ + | name | status | update | version | + +------------------------------+----------------+-----------+------------+ + | akismet | active-network | none | 3.1.11 | + | hello | inactive | none | 1.6 | + +------------------------------+----------------+-----------+------------+ + + + diff --git a/commands/plugin/path/index.md b/commands/plugin/path/index.md index 22e187e0..7e450b8d 100644 --- a/commands/plugin/path/index.md +++ b/commands/plugin/path/index.md @@ -1,4 +1,31 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/path/ ---- \ No newline at end of file +layout: default +title: 'wp plugin path' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » path + +`wp plugin path` - Get the path to a plugin or to the plugin directory. + +Quick links: Github issues + +
+ +### 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 plugin path) && pwd + /var/www/wordpress/wp-content/plugins + + + diff --git a/commands/plugin/search/index.md b/commands/plugin/search/index.md index 9ddf89b7..20a44076 100644 --- a/commands/plugin/search/index.md +++ b/commands/plugin/search/index.md @@ -1,4 +1,82 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/search/ ---- \ No newline at end of file +layout: default +title: 'wp plugin search' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » search + +`wp plugin search` - Search the wordpress.org plugin repository. + +Quick links: Github issues + +
+ +### OPTIONS + +<search> +: The string to search for. + +[\--page=<page>] +: Optional page to display. +\--- +default: 1 +\--- + +[\--per-page=<per-page>] +: Optional number of results to display. +\--- +default: 10 +\--- + +[\--field=<field>] +: Prints the value of a single field for each plugin. + +[\--fields=<fields>] +: Ask for specific fields from the API. Defaults to name,slug,author_profile,rating. Acceptable values: + + **name**: Plugin Name + **slug**: Plugin Slug + **version**: Current Version Number + **author**: Plugin Author + **author_profile**: Plugin Author Profile + **contributors**: Plugin Contributors + **requires**: Plugin Minimum Requirements + **tested**: Plugin Tested Up To + **compatibility**: Plugin Compatible With + **rating**: Plugin Rating + **num_ratings**: Number of Plugin Ratings + **homepage**: Plugin Author's Homepage + **description**: Plugin's Description + **short_description**: Plugin's Short Description + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - count + - json + - yaml +\--- + +### EXAMPLES + + $ wp plugin search dsgnwrks --per-page=20 --format=json + Success: Showing 3 of 3 plugins. + [{"name":"DsgnWrks Instagram Importer Debug","slug":"dsgnwrks-instagram-importer-debug","rating":0},{"name":"DsgnWrks Instagram Importer","slug":"dsgnwrks-instagram-importer","rating":84},{"name":"DsgnWrks Twitter Importer","slug":"dsgnwrks-twitter-importer","rating":80}] + + $ wp plugin search dsgnwrks --fields=name,version,slug,rating,num_ratings + Success: Showing 3 of 3 plugins. + +-----------------------------------+---------+-----------------------------------+--------+-------------+ + | name | version | slug | rating | num_ratings | + +-----------------------------------+---------+-----------------------------------+--------+-------------+ + | DsgnWrks Instagram Importer Debug | 0.1.6 | dsgnwrks-instagram-importer-debug | 0 | 0 | + | DsgnWrks Instagram Importer | 1.3.7 | dsgnwrks-instagram-importer | 84 | 23 | + | DsgnWrks Twitter Importer | 1.1.1 | dsgnwrks-twitter-importer | 80 | 1 | + +-----------------------------------+---------+-----------------------------------+--------+-------------+ + + + diff --git a/commands/plugin/status/index.md b/commands/plugin/status/index.md index 31358b56..b362844e 100644 --- a/commands/plugin/status/index.md +++ b/commands/plugin/status/index.md @@ -1,4 +1,42 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/status/ ---- \ No newline at end of file +layout: default +title: 'wp plugin status' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » status + +`wp plugin status` - See the status of one or all plugins. + +Quick links: Github issues + +
+ +### OPTIONS + +[<plugin>] +: A particular plugin to show the status for. + +### EXAMPLES + + # Displays status of all plugins + $ wp plugin status + 5 installed plugins: + I akismet 3.1.11 + I easy-digital-downloads 2.5.16 + A theme-check 20160523.1 + I wen-logo-slider 2.0.3 + M ns-pack 1.0.0 + Legend: I = Inactive, A = Active, M = Must Use + + # Displays status of a plugin + $ wp plugin status theme-check + Plugin theme-check details: + Name: Theme Check + Status: Active + Version: 20160523.1 + Author: Otto42, pross + Description: A simple and easy way to test your theme for all the latest WordPress standards and practices. A great theme development tool! + + + diff --git a/commands/plugin/toggle/index.md b/commands/plugin/toggle/index.md index bbb60ac7..acf41a9d 100644 --- a/commands/plugin/toggle/index.md +++ b/commands/plugin/toggle/index.md @@ -1,4 +1,32 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/toggle/ ---- \ No newline at end of file +layout: default +title: 'wp plugin toggle' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » toggle + +`wp plugin toggle` - Toggle a plugin's activation state. + +Quick links: Github issues + +
+ +### OPTIONS + +<plugin>... +: One or more plugins to toggle. + +[\--network] +: If set, the plugin will be toggled for the entire multisite network. + +### EXAMPLES + + $ wp plugin toggle akismet + Success: Plugin 'akismet' deactivated. + + $ wp plugin toggle akismet + Success: Plugin 'akismet' activated. + + + diff --git a/commands/plugin/uninstall/index.md b/commands/plugin/uninstall/index.md index faac3fb8..d179c894 100644 --- a/commands/plugin/uninstall/index.md +++ b/commands/plugin/uninstall/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/uninstall/ ---- \ No newline at end of file +layout: default +title: 'wp plugin uninstall' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » uninstall + +`wp plugin uninstall` - Uninstall a plugin. + +Quick links: Github issues + +
+ +### OPTIONS + +<plugin>... +: One or more plugins to uninstall. + +[\--deactivate] +: Deactivate the plugin before uninstalling. Default behavior is to warn and skip if the plugin is active. + +[\--skip-delete] +: If set, the plugin files will not be deleted. Only the uninstall procedure +will be run. + +### EXAMPLES + + $ wp plugin uninstall hello + Success: Uninstalled and deleted 'hello' plugin. + + + diff --git a/commands/plugin/update-all/index.md b/commands/plugin/update-all/index.md index 8f851dc4..49c6f8a4 100644 --- a/commands/plugin/update-all/index.md +++ b/commands/plugin/update-all/index.md @@ -1,4 +1,6 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/update-all/ ---- \ No newline at end of file +layout: default +title: 'wp plugin update-all' +--- + +`wp plugin update-all` is an alias for [wp plugin update --all](/commands/plugin/update/). diff --git a/commands/plugin/update/index.md b/commands/plugin/update/index.md index 851eaaba..392f94bd 100644 --- a/commands/plugin/update/index.md +++ b/commands/plugin/update/index.md @@ -1,4 +1,64 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/plugin/update/ ---- \ No newline at end of file +layout: default +title: 'wp plugin update' +display_global_parameters: true +--- + +[Commands](/commands/) » [plugin](/commands/plugin/) » update + +`wp plugin update` - Update one or more plugins. + +Quick links: Github issues + +
+ +### OPTIONS + +[<plugin>...] +: One or more plugins to update. + +[\--all] +: If set, all plugins that have updates will be updated. + +[\--format=<format>] +: Output summary as table or summary. Defaults to table. + +[\--version=<version>] +: If set, the plugin will be updated to the specified version. + +[\--dry-run] +: Preview which plugins would be updated. + +### EXAMPLES + + $ wp plugin update bbpress --version=dev + Installing bbPress (Development Version) + Downloading install package from https://downloads.wordpress.org/plugin/bbpress.zip... + Unpacking the package... + Installing the plugin... + Removing the old version of the plugin... + Plugin updated successfully. + + $ wp plugin update --all + Enabling Maintenance mode... + Downloading update from https://downloads.wordpress.org/plugin/akismet.3.1.11.zip... + Unpacking the update... + Installing the latest version... + Removing the old version of the plugin... + Plugin updated successfully. + Downloading update from https://downloads.wordpress.org/plugin/nginx-champuru.3.2.0.zip... + Unpacking the update... + Installing the latest version... + Removing the old version of the plugin... + Plugin updated successfully. + Disabling Maintenance mode... + Success: Updated 2/2 plugins. + +------------------------+-------------+-------------+---------+ + | name | old_version | new_version | status | + +------------------------+-------------+-------------+---------+ + | akismet | 3.1.3 | 3.1.11 | Updated | + | nginx-cache-controller | 3.1.1 | 3.2.0 | Updated | + +------------------------+-------------+-------------+---------+ + + + diff --git a/commands/post-type/get/index.md b/commands/post-type/get/index.md index 00ea191e..5fa51a0b 100644 --- a/commands/post-type/get/index.md +++ b/commands/post-type/get/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post-type/get/ ---- \ No newline at end of file +layout: default +title: 'wp post-type get' +display_global_parameters: true +--- + +[Commands](/commands/) » [post-type](/commands/post-type/) » get + +`wp post-type get` - Get a post type + +Quick links: Github issues + +
+ +### OPTIONS + +<post-type> +: Post type slug + +[\--field=<field>] +: Instead of returning the whole taxonomy, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +### EXAMPLES + + $ wp post-type get page --fields=name,label,hierarchical --format=json + {"name":"page","label":"Pages","hierarchical":true} + + + diff --git a/commands/post-type/index.md b/commands/post-type/index.md index 21f74bdc..7ae28759 100644 --- a/commands/post-type/index.md +++ b/commands/post-type/index.md @@ -1,4 +1,53 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post-type/ ---- \ No newline at end of file +layout: default +title: 'wp post-type' +display_global_parameters: true +--- + +[Commands](/commands/) » post-type + +`wp post-type` - Manage post types. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Get a post type + $ wp post-type get page --fields=name,label,hierarchical --format=json + {"name":"page","label":"Pages","hierarchical":true} + + # List post types with 'post' capability type + $ wp post-type list --capability_type=post --fields=name,public + +---------------+--------+ + | name | public | + +---------------+--------+ + | post | 1 | + | attachment | 1 | + | revision | | + | nav_menu_item | | + +---------------+--------+ + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + +
NameDescription
getGet a post type
listList post types.
diff --git a/commands/post-type/list/index.md b/commands/post-type/list/index.md index cd697686..6e76f0b9 100644 --- a/commands/post-type/list/index.md +++ b/commands/post-type/list/index.md @@ -1,4 +1,74 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post-type/list/ ---- \ No newline at end of file +layout: default +title: 'wp post-type list' +display_global_parameters: true +--- + +[Commands](/commands/) » [post-type](/commands/post-type/) » list + +`wp post-type list` - List post types. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: Filter by one or more fields (see get_post_types() first parameter for a list of available fields). + +[\--field=<field>] +: Prints the value of a single field for each post type. + +[\--fields=<fields>] +: Limit the output to specific post type fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each term: + +* name +* label +* description +* hierarchical +* public +* capability_type + +There are no optionally available fields. + +### EXAMPLES + + # List registered post types + $ wp post-type list --format=csv + name,label,description,hierarchical,public,capability_type + post,Posts,,,1,post + page,Pages,,1,1,page + attachment,Media,,,1,post + revision,Revisions,,,,post + nav_menu_item,"Navigation Menu Items",,,,post + + # List post types with 'post' capability type + $ wp post-type list --capability_type=post --fields=name,public + +---------------+--------+ + | name | public | + +---------------+--------+ + | post | 1 | + | attachment | 1 | + | revision | | + | nav_menu_item | | + +---------------+--------+ + + + diff --git a/commands/post/create/index.md b/commands/post/create/index.md index f68570ef..fe5c5a88 100644 --- a/commands/post/create/index.md +++ b/commands/post/create/index.md @@ -1,4 +1,47 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/create/ ---- \ No newline at end of file +layout: default +title: 'wp post create' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » create + +`wp post create` - Create a post. + +Quick links: Github issues + +
+ +### OPTIONS + +[<file>] +: Read post content from <file>. 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>] +: Associative args 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 + + # Create post and schedule for future + $ wp post create --post_type=page --post_title='A future post' --post_status=future --post_date='2020-12-01 07:00:00' + Success: Created post 1921. + + # Create post with content from given file + $ wp post create ./post-content.txt --post_category=201,345 --post_title='Post from file' + Success: Created post 1922. + + + diff --git a/commands/post/delete/index.md b/commands/post/delete/index.md index 5a66451a..1051d6f5 100644 --- a/commands/post/delete/index.md +++ b/commands/post/delete/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/delete/ ---- \ No newline at end of file +layout: default +title: 'wp post delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » delete + +`wp post delete` - Delete a post by ID. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of posts to delete. + +[\--force] +: Skip the trash bin. + +[\--defer-term-counting] +: Recalculate term count in batch, for a performance boost. + +### EXAMPLES + + # Delete post skipping trash + $ wp post delete 123 --force + Success: Deleted post 123. + + # Delete all pages + $ wp post delete $(wp post list --post_type='page' --format=ids) + Success: Trashed post 1164. + Success: Trashed post 1186. + + # Delete all posts in the trash + $ wp post delete $(wp post list --post_status=trash --format=ids) + Success: Trashed post 1268. + Success: Trashed post 1294. + + + diff --git a/commands/post/edit/index.md b/commands/post/edit/index.md index 738c4ca5..b896367e 100644 --- a/commands/post/edit/index.md +++ b/commands/post/edit/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/edit/ ---- \ No newline at end of file +layout: default +title: 'wp post edit' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » edit + +`wp post edit` - Launch system editor to edit post content. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the post to edit. + +### EXAMPLES + + # Launch system editor to edit post + $ wp post edit 123 + + + diff --git a/commands/post/generate/index.md b/commands/post/generate/index.md index 88f61c8f..e6af0ec1 100644 --- a/commands/post/generate/index.md +++ b/commands/post/generate/index.md @@ -1,4 +1,82 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/generate/ ---- \ No newline at end of file +layout: default +title: 'wp post generate' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » generate + +`wp post generate` - Generate some posts. + +Quick links: Github issues + +
+ +### 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: +\--- + +[\--post_date=<yyyy-mm-dd>] +: The date of the generated posts. Default: current date + +[\--post_content] +: If set, the command reads the post_content from STDIN. + +[\--max_depth=<number>] +: For hierarchical post types, generate child posts down to a certain depth. +\--- +default: 1 +\--- + +[\--format=<format>] +: Render output in a particular format. +\--- +default: progress +options: + - progress + - ids +\--- + +### EXAMPLES + + # Generate posts + $ wp post generate --count=10 --post_type=page --post_date=1999-01-04 + Generating posts 100% [================================================] 0:01 / 0:04 + + # Generate posts with fetched content + $ curl http://loripsum.net/api/5 | wp post generate --post_content --count=10 + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 2509 100 2509 0 0 616 0 0:00:04 0:00:04 --:--:-- 616 + Generating posts 100% [================================================] 0:01 / 0:04 + + # Add meta to every generated post + $ wp post generate --format=ids | xargs -0 -d ' ' -I % wp post meta add % foo bar + Success: Added custom field. + Success: Added custom field. + Success: Added custom field. + + + diff --git a/commands/post/get/index.md b/commands/post/get/index.md index 7df99292..ec52d668 100644 --- a/commands/post/get/index.md +++ b/commands/post/get/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/get/ ---- \ No newline at end of file +layout: default +title: 'wp post get' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » get + +`wp post get` - Get a post's content by ID. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the post to get. + +[\--field=<field>] +: Instead of returning the whole post, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +### EXAMPLES + + # Save the post content to a file + $ wp post get 123 --field=content > file.txt + + + diff --git a/commands/post/index.md b/commands/post/index.md index 7ee724b9..7dc5fb3e 100644 --- a/commands/post/index.md +++ b/commands/post/index.md @@ -1,4 +1,78 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/ ---- \ No newline at end of file +layout: default +title: 'wp post' +display_global_parameters: true +--- + +[Commands](/commands/) » post + +`wp post` - Manage posts. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Create post + $ wp post create --post_type=post --post_title='A sample post' + Success: Created post 123. + + # Update post + $ wp post update 123 --post_status=draft + Success: Updated post 123. + + # Delete post + $ wp post delete 123 + Success: Trashed post 123. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
createCreate a post.
deleteDelete a post by ID.
editLaunch system editor to edit post content.
generateGenerate some posts.
getGet a post's content by ID.
listGet a list of posts.
metaManage post custom fields.
termManage post terms.
updateUpdate one or more posts.
diff --git a/commands/post/list/index.md b/commands/post/list/index.md index f7a8663e..a6b655d1 100644 --- a/commands/post/list/index.md +++ b/commands/post/list/index.md @@ -1,4 +1,107 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/list/ ---- \ No newline at end of file +layout: default +title: 'wp post list' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » list + +`wp post list` - Get a list of posts. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: One or more args to pass to WP_Query. + +[\--field=<field>] +: Prints the value of a single field for each post. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Accepted values: table, csv, json, count, ids, yaml. Default: table +\--- +default: table +options: + - table + - csv + - ids + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each post: + +* ID +* post_title +* post_name +* post_date +* post_status + +These fields are optionally available: + +* post_author +* post_date_gmt +* post_content +* post_excerpt +* comment_status +* ping_status +* post_password +* to_ping +* pinged +* post_modified +* post_modified_gmt +* post_content_filtered +* post_parent +* guid +* menu_order +* post_type +* post_mime_type +* comment_count +* filter +* url + +### EXAMPLES + + # List post + $ wp post list --field=ID + 568 + 829 + 1329 + 1695 + + # List posts in JSON + $ wp post list --post_type=post --posts_per_page=5 --format=json + [{"ID":1,"post_title":"Hello world!","post_name":"hello-world","post_date":"2015-06-20 09:00:10","post_status":"publish"},{"ID":1178,"post_title":"Markup: HTML Tags and Formatting","post_name":"markup-html-tags-and-formatting","post_date":"2013-01-11 20:22:19","post_status":"draft"}] + + # List all pages + $ wp post list --post_type=page --fields=post_title,post_status + +-------------+-------------+ + | post_title | post_status | + +-------------+-------------+ + | Sample Page | publish | + +-------------+-------------+ + + # List ids of all pages and posts + $ wp post list --post_type=page,post --format=ids + 15 25 34 37 198 + + # List given posts + $ wp post list --post__in=1,3 + +----+--------------+-------------+---------------------+-------------+ + | ID | post_title | post_name | post_date | post_status | + +----+--------------+-------------+---------------------+-------------+ + | 3 | Lorem Ipsum | lorem-ipsum | 2016-06-01 14:34:36 | publish | + | 1 | Hello world! | hello-world | 2016-06-01 14:31:12 | publish | + +----+--------------+-------------+---------------------+-------------+ + + + diff --git a/commands/post/meta/add/index.md b/commands/post/meta/add/index.md index 34e2171c..f15ff154 100644 --- a/commands/post/meta/add/index.md +++ b/commands/post/meta/add/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/meta/add/ ---- \ No newline at end of file +layout: default +title: 'wp post meta add' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [meta](/commands/post/meta/) » add + +`wp post meta add` - Add a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to create. + +[<value>] +: The value of the meta field. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/post/meta/delete/index.md b/commands/post/meta/delete/index.md index efdddaed..079d58bf 100644 --- a/commands/post/meta/delete/index.md +++ b/commands/post/meta/delete/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/meta/delete/ ---- \ No newline at end of file +layout: default +title: 'wp post meta delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [meta](/commands/post/meta/) » delete + +`wp post meta delete` - Delete a meta field. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +[<key>] +: The name of the meta field to delete. + +[<value>] +: The value to delete. If omitted, all rows with key will deleted. + +[\--all] +: Delete all meta for the object. + + + diff --git a/commands/post/meta/get/index.md b/commands/post/meta/get/index.md index cf7fe2db..cca1cf18 100644 --- a/commands/post/meta/get/index.md +++ b/commands/post/meta/get/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/meta/get/ ---- \ No newline at end of file +layout: default +title: 'wp post meta get' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [meta](/commands/post/meta/) » get + +`wp post meta get` - Get meta field value. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<key> +: The name of the meta field to get. + +[\--format=<format>] +: Accepted values: table, json. Default: table + + + diff --git a/commands/post/meta/index.md b/commands/post/meta/index.md index 33a9e9f8..cb0ef06a 100644 --- a/commands/post/meta/index.md +++ b/commands/post/meta/index.md @@ -1,4 +1,68 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/meta/ ---- \ No newline at end of file +layout: default +title: 'wp post meta' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » meta + +`wp post meta` - Manage post custom fields. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set post meta + $ wp post meta set 123 _wp_page_template about.php + Success: Updated custom field '_wp_page_template'. + + # Get post meta + $ wp post meta get 123 _wp_page_template + about.php + + # Update post meta + $ wp post meta update 123 _wp_page_template contact.php + Success: Updated custom field '_wp_page_template'. + + # Delete post meta + $ wp post meta delete 123 _wp_page_template + Success: Deleted custom field. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a meta field.
deleteDelete a meta field.
getGet meta field value.
listList all metadata associated with an object.
updateUpdate a meta field.
diff --git a/commands/post/meta/list/index.md b/commands/post/meta/list/index.md index 6ce03bbd..e73d1295 100644 --- a/commands/post/meta/list/index.md +++ b/commands/post/meta/list/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/meta/list/ ---- \ No newline at end of file +layout: default +title: 'wp post meta list' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [meta](/commands/post/meta/) » list + +`wp post meta list` - List all metadata associated with an object. + +Quick links: Github issues + +
+ +<id> +: ID for the object. + +[\--keys=<keys>] +: Limit output to metadata of specific keys. + +[\--fields=<fields>] +: Limit the output to specific row fields. Defaults to id,meta_key,meta_value. + +[\--format=<format>] +: Accepted values: table, csv, json, count. Default: table + + + diff --git a/commands/post/meta/update/index.md b/commands/post/meta/update/index.md index 777e1b71..ccbb9b88 100644 --- a/commands/post/meta/update/index.md +++ b/commands/post/meta/update/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/meta/update/ ---- \ No newline at end of file +layout: default +title: 'wp post meta update' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [meta](/commands/post/meta/) » update + +`wp post meta update` - Update a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to update. + +[<value>] +: The new value. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/post/term/add/index.md b/commands/post/term/add/index.md index 254f552d..b526a50b 100644 --- a/commands/post/term/add/index.md +++ b/commands/post/term/add/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/term/add/ ---- \ No newline at end of file +layout: default +title: 'wp post term add' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [term](/commands/post/term/) » add + +`wp post term add` - Add a term. Appends to existing set of terms on the object. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<taxonomy> +: The name of the taxonomy type to be added. + +<term>... +: The slug of the term or terms to be added. + + + diff --git a/commands/post/term/index.md b/commands/post/term/index.md index 5b3e7d6f..b1f58e09 100644 --- a/commands/post/term/index.md +++ b/commands/post/term/index.md @@ -1,4 +1,52 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/term/ ---- \ No newline at end of file +layout: default +title: 'wp post term' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » term + +`wp post term` - Manage post terms. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set post terms + $ wp post term set 123 test category + Set terms. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a term. Appends to existing set of terms on the object.
listList all terms associated with an object.
removeRemove a term.
setSet terms. Replaces existing terms on the object.
diff --git a/commands/post/term/list/index.md b/commands/post/term/list/index.md index 18c8993a..7486ec48 100644 --- a/commands/post/term/list/index.md +++ b/commands/post/term/list/index.md @@ -1,4 +1,45 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/term/list/ ---- \ No newline at end of file +layout: default +title: 'wp post term list' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [term](/commands/post/term/) » list + +`wp post term list` - List all terms associated with an object. + +Quick links: Github issues + +
+ +<id> +: ID for the object. + +<taxonomy>... +: One or more taxonomies to list. + +[\--fields=<fields>] +: Limit the output to specific row fields. + +[\--format=<format>] +: Accepted values: table, csv, json, count, ids. Default: table + +### AVAILABLE FIELDS + +These fields will be displayed by default for each term: + +* term_id +* name +* slug +* taxonomy + +These fields are optionally available: + +* term_taxonomy_id +* description +* term_group +* parent +* count + + + diff --git a/commands/post/term/remove/index.md b/commands/post/term/remove/index.md index e9130d5b..55c373a0 100644 --- a/commands/post/term/remove/index.md +++ b/commands/post/term/remove/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/term/remove/ ---- \ No newline at end of file +layout: default +title: 'wp post term remove' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [term](/commands/post/term/) » remove + +`wp post term remove` - Remove a term. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<taxonomy> +: The name of the taxonomy type to deleted. + +<term>... +: The name of the term or terms to deleted. + + + diff --git a/commands/post/term/set/index.md b/commands/post/term/set/index.md index b166638c..5b7e8105 100644 --- a/commands/post/term/set/index.md +++ b/commands/post/term/set/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/term/set/ ---- \ No newline at end of file +layout: default +title: 'wp post term set' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » [term](/commands/post/term/) » set + +`wp post term set` - Set terms. Replaces existing terms on the object. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<taxonomy> +: The name of the taxonomy type to be updated. + +<term>... +: The slug of the term or terms to be updated. + + + diff --git a/commands/post/update/index.md b/commands/post/update/index.md index 2dbb9b18..101b8a2a 100644 --- a/commands/post/update/index.md +++ b/commands/post/update/index.md @@ -1,4 +1,39 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/post/update/ ---- \ No newline at end of file +layout: default +title: 'wp post update' +display_global_parameters: true +--- + +[Commands](/commands/) » [post](/commands/post/) » update + +`wp post update` - Update one or more posts. + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of posts to update. + +[<file>] +: Read post content from <file>. 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> +: One or more fields to update. See wp_update_post(). + +[\--defer-term-counting] +: Recalculate term count in batch, for a performance boost. + +### EXAMPLES + + $ wp post update 123 --post_name=something --post_status=draft + Success: Updated post 123. + + + diff --git a/commands/rewrite/flush/index.md b/commands/rewrite/flush/index.md index 426b6b90..a4429b59 100644 --- a/commands/rewrite/flush/index.md +++ b/commands/rewrite/flush/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/rewrite/flush/ ---- \ No newline at end of file +layout: default +title: 'wp rewrite flush' +display_global_parameters: true +--- + +[Commands](/commands/) » [rewrite](/commands/rewrite/) » flush + +`wp rewrite flush` - Flush rewrite rules. + +Quick links: Github issues + +
+ +### DESCRIPTION + +Resets WordPress' rewrite rules based on registered post types, etc. + +To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module +to your wp-cli.yml or config.yml. For example: + +`apache_modules: + - mod_rewrite` + +### OPTIONS + +[\--hard] +: Perform a hard flush - update `.htaccess` rules as well as rewrite rules in database. Works only on single site installs. + +### EXAMPLES + + $ wp rewrite flush + Success: Rewrite rules flushed. + + + diff --git a/commands/rewrite/index.md b/commands/rewrite/index.md index 55ee63e7..f0640224 100644 --- a/commands/rewrite/index.md +++ b/commands/rewrite/index.md @@ -1,4 +1,59 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/rewrite/ ---- \ No newline at end of file +layout: default +title: 'wp rewrite' +display_global_parameters: true +--- + +[Commands](/commands/) » rewrite + +`wp rewrite` - Manage rewrite rules. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Flush rewrite rules + $ wp rewrite flush + Success: Rewrite rules flushed. + + # Update permalink structure + $ wp rewrite structure '/%year%/%monthnum%/%postname%' + Success: Rewrite structure set. + + # List rewrite rules + $ wp rewrite list --format=csv + match,query,source + ^wp-json/?$,index.php?rest_route=/,other + ^wp-json/(.*)?,index.php?rest_route=/$matches[1],other + category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category + category/(.+?)/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category + category/(.+?)/embed/?$,index.php?category_name=$matches[1]&embed=true,category + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
flushFlush rewrite rules.
listPrint current rewrite rules.
structureUpdate the permalink structure.
diff --git a/commands/rewrite/list/index.md b/commands/rewrite/list/index.md index 0be10b1b..d2d9e72c 100644 --- a/commands/rewrite/list/index.md +++ b/commands/rewrite/list/index.md @@ -1,4 +1,49 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/rewrite/list/ ---- \ No newline at end of file +layout: default +title: 'wp rewrite list' +display_global_parameters: true +--- + +[Commands](/commands/) » [rewrite](/commands/rewrite/) » list + +`wp rewrite list` - Print current rewrite rules. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--match=<url>] +: Show rewrite rules matching a particular URL. + +[\--source=<source>] +: Show rewrite rules from a particular source. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to match,query,source. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - yaml +\--- + +### EXAMPLES + + $ wp rewrite list --format=csv + match,query,source + ^wp-json/?$,index.php?rest_route=/,other + ^wp-json/(.*)?,index.php?rest_route=/$matches[1],other + category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category + category/(.+?)/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category + category/(.+?)/embed/?$,index.php?category_name=$matches[1]&embed=true,category + + + diff --git a/commands/rewrite/structure/index.md b/commands/rewrite/structure/index.md index bc3b0ec6..07f0e8ca 100644 --- a/commands/rewrite/structure/index.md +++ b/commands/rewrite/structure/index.md @@ -1,4 +1,45 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/rewrite/structure/ ---- \ No newline at end of file +layout: default +title: 'wp rewrite structure' +display_global_parameters: true +--- + +[Commands](/commands/) » [rewrite](/commands/rewrite/) » structure + +`wp rewrite structure` - Update the permalink structure. + +Quick links: Github issues + +
+ +### DESCRIPTION + +Updates the post permalink structure. + +To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module +to your wp-cli.yml or config.yml. For example: + +`apache_modules: + - mod_rewrite` + +### OPTIONS + +<permastruct> +: The new permalink structure to apply. + +[\--category-base=<base>] +: Set the base for category permalinks, i.e. '/category/'. + +[\--tag-base=<base>] +: Set the base for tag permalinks, i.e. '/tag/'. + +[\--hard] +: Perform a hard flush - update `.htaccess` rules as well as rewrite rules in database. + +### EXAMPLES + + $ wp rewrite structure '/%year%/%monthnum%/%postname%' + Success: Rewrite structure set. + + + diff --git a/commands/role/create/index.md b/commands/role/create/index.md index 3f5f1c4c..aacf501a 100644 --- a/commands/role/create/index.md +++ b/commands/role/create/index.md @@ -1,4 +1,37 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/role/create/ ---- \ No newline at end of file +layout: default +title: 'wp role create' +display_global_parameters: true +--- + +[Commands](/commands/) » [role](/commands/role/) » create + +`wp role create` - Create a new role. + +Quick links: Github issues + +
+ +### OPTIONS + +<role-key> +: The internal name of the role. + +<role-name> +: The publicly visible name of the role. + +[\--clone=<role>] +: Clone capabilities from an existing role. + +### EXAMPLES + + # Create role for Approver + $ wp role create approver Approver + Success: Role with key approver created. + + # Create role for Product Administrator + $ wp role create productadmin "Product Administrator" + Success: Role with key productadmin created. + + + diff --git a/commands/role/delete/index.md b/commands/role/delete/index.md index 4ad63ee2..3704ca37 100644 --- a/commands/role/delete/index.md +++ b/commands/role/delete/index.md @@ -1,4 +1,31 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/role/delete/ ---- \ No newline at end of file +layout: default +title: 'wp role delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [role](/commands/role/) » delete + +`wp role delete` - Delete an existing role. + +Quick links: Github issues + +
+ +### OPTIONS + +<role-key> +: The internal name of the role. + +### EXAMPLES + + # Delete approver role + $ wp role delete approver + Success: Role with key approver deleted. + + # Delete productadmin role + wp role delete productadmin + Success: Role with key productadmin deleted. + + + diff --git a/commands/role/exists/index.md b/commands/role/exists/index.md index ade85b2f..38a94f6b 100644 --- a/commands/role/exists/index.md +++ b/commands/role/exists/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/role/exists/ ---- \ No newline at end of file +layout: default +title: 'wp role exists' +display_global_parameters: true +--- + +[Commands](/commands/) » [role](/commands/role/) » exists + +`wp role exists` - Check if a role exists. + +Quick links: Github issues + +
+ +##DESCRIPTION + +Will exit with status 0 if the role exists, 1 if it does not. + +### OPTIONS + +<role-key> +: The internal name of the role. + +### EXAMPLES + + $ wp role exists editor + Success: Role with ID editor exists. + + + diff --git a/commands/role/index.md b/commands/role/index.md index ac7fae3c..dbdf329b 100644 --- a/commands/role/index.md +++ b/commands/role/index.md @@ -1,4 +1,75 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/role/ ---- \ No newline at end of file +layout: default +title: 'wp role' +display_global_parameters: true +--- + +[Commands](/commands/) » role + +`wp role` - Manage user roles. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List roles + $ wp role list --fields=role --format=csv + role + administrator + editor + author + contributor + subscriber + + # Check if a role exists + $ wp role exists editor + Success: Role with ID editor exists. + + # Create role + $ wp role create approver Approver + Success: Role with key approver created. + + # Delete role + $ wp role delete approver + Success: Role with key approver deleted. + + # Reset role + $ wp role reset administrator author contributor + Success: Reset 3/3 roles + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
createCreate a new role.
deleteDelete an existing role.
existsCheck if a role exists.
listList all roles.
resetReset any default role to default capabilities.
diff --git a/commands/role/list/index.md b/commands/role/list/index.md index 2badf624..92dab195 100644 --- a/commands/role/list/index.md +++ b/commands/role/list/index.md @@ -1,4 +1,52 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/role/list/ ---- \ No newline at end of file +layout: default +title: 'wp role list' +display_global_parameters: true +--- + +[Commands](/commands/) » [role](/commands/role/) » list + +`wp role list` - List all roles. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each role: + +* name +* role + +There are no optional fields. + +### EXAMPLES + + $ wp role list --fields=role --format=csv + role + administrator + editor + author + contributor + subscriber + + + diff --git a/commands/role/reset/index.md b/commands/role/reset/index.md index 5227781d..1f92dc7c 100644 --- a/commands/role/reset/index.md +++ b/commands/role/reset/index.md @@ -1,4 +1,34 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/role/reset/ ---- \ No newline at end of file +layout: default +title: 'wp role reset' +display_global_parameters: true +--- + +[Commands](/commands/) » [role](/commands/role/) » reset + +`wp role reset` - Reset any default role to default capabilities. + +Quick links: Github issues + +
+ +### OPTIONS + +[<role-key>...] +: The internal name of one or more roles to reset. + +[\--all] +: If set, all default roles will be reset. + +### EXAMPLES + + # Reset role + $ wp role reset administrator author contributor + Success: Reset 1/3 roles. + + # Reset all default roles + $ wp role reset --all + Success: All default roles reset. + + + diff --git a/commands/scaffold/_s/index.md b/commands/scaffold/_s/index.md index e89885cb..48f05141 100644 --- a/commands/scaffold/_s/index.md +++ b/commands/scaffold/_s/index.md @@ -1,4 +1,47 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/_s/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold _s' +display_global_parameters: true +--- + +[Commands](/commands/) » [scaffold](/commands/scaffold/) » _s + +`wp scaffold _s` - Generate starter code for a theme. + +Quick links: Github issues + +
+ +### OPTIONS + +<slug> +: The slug for the new theme, used for prefixing functions. + +[\--activate] +: Activate the newly downloaded theme. + +[\--enable-network] +: Enable the newly downloaded theme for the entire network. + +[\--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=<uri>] +: What to put in the 'Author URI:' header in 'style.css'. + +[\--sassify] +: Include stylesheets as SASS. + +[\--force] +: Overwrite files that already exist. + +### EXAMPLES + + $ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe" + Success: Created theme 'Sample Theme'. + + + diff --git a/commands/scaffold/child-theme/index.md b/commands/scaffold/child-theme/index.md index cde98b69..d79f14e8 100644 --- a/commands/scaffold/child-theme/index.md +++ b/commands/scaffold/child-theme/index.md @@ -1,4 +1,50 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/child-theme/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold child-theme' +display_global_parameters: true +--- + +[Commands](/commands/) » [scaffold](/commands/scaffold/) » child-theme + +`wp scaffold child-theme` - Generate empty child theme. + +Quick links: Github issues + +
+ +### 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=<uri>] +: What to put in the 'Author URI:' header in 'style.css'. + +[\--theme_uri=<uri>] +: What to put in the 'Theme URI:' header in 'style.css'. + +[\--activate] +: Activate the newly created child theme. + +[\--enable-network] +: Enable the newly created child theme for the entire network. + +[\--force] +: Overwrite files that already exist. + +### EXAMPLES + + $ wp scaffold child-theme sample-theme --parent_theme=twentysixteen + Success: Created '/var/www/example.com/public_html/wp-content/themes/sample-theme'. + + + diff --git a/commands/scaffold/index.md b/commands/scaffold/index.md index 1cdd0597..e8eb6fec 100644 --- a/commands/scaffold/index.md +++ b/commands/scaffold/index.md @@ -1,4 +1,67 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold' +display_global_parameters: true +--- + +[Commands](/commands/) » scaffold + +`wp scaffold` - Generate code for post types, taxonomies, etc. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Generate plugin + $ wp scaffold plugin sample-plugin + Success: Created plugin files. + Success: Created test files. + + # Generate theme based on _s + $ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe" + Success: Created theme 'Sample Theme'. + + # Generate code for post type registration in given theme + $ wp scaffold post-type movie --label=Movie --theme=simple-life + Success: Created /var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
_sGenerate starter code for a theme.
child-themeGenerate empty child theme.
pluginGenerate starter code for a plugin.
plugin-testsGenerate files needed for running PHPUnit tests.
post-typeGenerate PHP code for registering a custom post type.
taxonomyGenerate PHP code for registering a custom taxonomy.
diff --git a/commands/scaffold/plugin-tests/index.md b/commands/scaffold/plugin-tests/index.md index 34242ec4..e118cbfc 100644 --- a/commands/scaffold/plugin-tests/index.md +++ b/commands/scaffold/plugin-tests/index.md @@ -1,4 +1,59 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/plugin-tests/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold plugin-tests' +display_global_parameters: true +--- + +[Commands](/commands/) » [scaffold](/commands/scaffold/) » plugin-tests + +`wp scaffold plugin-tests` - Generate files needed for running PHPUnit tests. + +Quick links: Github issues + +
+ +### OVERVIEW + +The following files are generated for your plugin by this command: + +* `phpunit.xml.dist` is the configuration file for PHPUnit. +* `.travis.yml` is the configuration file for Travis CI. Use `--ci=<provider>` to select a different service. +* `bin/install-wp-tests.sh` configures the WordPress test suite and a test database. +* `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. + +Learn more from the [plugin unit tests documentation](http://wp-cli.org/docs/plugin-unit-tests/). + +### ENVIRONMENT + +The `tests/bootstrap.php` file looks for the WP_TESTS_DIR environment +variable. + +### OPTIONS + +[<plugin>] +: The name of the plugin to generate test files for. + +[\--dir=<dirname>] +: Generate test files for a non-standard plugin path. If no plugin slug is specified, the directory name is used. + +[\--ci=<provider>] +: Add a configuration file for a continuous integration provider. +\--- +default: travis +options: + - travis + - circle + - gitlab +\--- + +[\--force] +: Overwrite files that already exist. + +### EXAMPLES + + $ wp scaffold plugin-tests sample-plugin + Success: Created test files. + + + diff --git a/commands/scaffold/plugin/index.md b/commands/scaffold/plugin/index.md index d11fe36c..dd23600f 100644 --- a/commands/scaffold/plugin/index.md +++ b/commands/scaffold/plugin/index.md @@ -1,4 +1,77 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/plugin/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold plugin' +display_global_parameters: true +--- + +[Commands](/commands/) » [scaffold](/commands/scaffold/) » plugin + +`wp scaffold plugin` - Generate starter code for a plugin. + +Quick links: Github issues + +
+ +### OVERVIEW + +The following files are generated for your plugin by this command: + +* `plugin-slug.php` is the main PHP plugin file. +* `readme.txt` is the readme file for the plugin. +* `package.json` needed by NPM holds various metadata relevant to the project. Packages: `grunt`, `grunt-wp-i18n` and `grunt-wp-readme-to-markdown`. +* `Gruntfile.js` is the JS file containing Grunt tasks. Tasks: `i18n` containing `addtextdomain` and `makepot`, `readme` containing `wp_readme_to_markdown`. +* `.editorconfig` is the configuration file for Editor. +* `.gitignore` tells which files (or patterns) git should ignore. +* `.distignore` tells which files and folders should be ignored in distribution. + +The following files are also generated if tests are not skipped using `--skip-tests`: + +* `phpunit.xml.dist` is the configuration file for PHPUnit. +* `.travis.yml` is the configuration file for Travis CI. +* `bin/install-wp-tests.sh` configures the WordPress test suite and a test database. +* `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 test cases. + +### OPTIONS + +<slug> +: The internal name of the plugin. + +[\--dir=<dirname>] +: Put the new plugin in some arbitrary directory path. Plugin directory will be path plus supplied slug. + +[\--plugin_name=<title>] +: What to put in the 'Plugin Name:' header. + +[\--plugin_description=<description>] +: What to put in the 'Description:' header. + +[\--plugin_author=<author>] +: What to put in the 'Author:' header. + +[\--plugin_author_uri=<url>] +: What to put in the 'Author URI:' header. + +[\--plugin_uri=<url>] +: What to put in the 'Plugin URI:' header. + +[\--skip-tests] +: Don't generate files for unit testing. + +[\--activate] +: Activate the newly generated plugin. + +[\--activate-network] +: Network activate the newly generated plugin. + +[\--force] +: Overwrite files that already exist. + +### EXAMPLES + + $ wp scaffold plugin sample-plugin + Success: Created plugin files. + Success: Created test files. + + + diff --git a/commands/scaffold/post-type/index.md b/commands/scaffold/post-type/index.md index c0adab84..a266da54 100644 --- a/commands/scaffold/post-type/index.md +++ b/commands/scaffold/post-type/index.md @@ -1,4 +1,48 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/post-type/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold post-type' +display_global_parameters: true +--- + +[Commands](/commands/) » [scaffold](/commands/scaffold/) » post-type + +`wp scaffold post-type` - Generate PHP code for registering a custom post type. + +Quick links: Github issues + +
+ +### OPTIONS + +<slug> +: The internal name of the post type. + +[\--label=<label>] +: The text used to translate the update messages. + +[\--textdomain=<textdomain>] +: The textdomain to use for the labels. + +[\--dashicon=<dashicon>] +: The dashicon to use in the menu. + +[\--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. + +[\--force] +: Overwrite files that already exist. + +### EXAMPLES + + $ wp scaffold post-type movie --label=Movie --theme=simple-life + Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'. + + + diff --git a/commands/scaffold/taxonomy/index.md b/commands/scaffold/taxonomy/index.md index 521a39af..d427b4d1 100644 --- a/commands/scaffold/taxonomy/index.md +++ b/commands/scaffold/taxonomy/index.md @@ -1,4 +1,48 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/taxonomy/ ---- \ No newline at end of file +layout: default +title: 'wp scaffold taxonomy' +display_global_parameters: true +--- + +[Commands](/commands/) » [scaffold](/commands/scaffold/) » taxonomy + +`wp scaffold taxonomy` - Generate PHP code for registering a custom taxonomy. + +Quick links: Github issues + +
+ +### OPTIONS + +<slug> +: The internal name of the taxonomy. + +[\--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. + +[\--force] +: Overwrite files that already exist. + +### EXAMPLES + + # Generate PHP code for registering a custom taxonomy and save in a file + $ wp scaffold taxonomy venue --post_types=event,presentation > taxonomy.php + + + diff --git a/commands/scaffold/theme-tests/index.md b/commands/scaffold/theme-tests/index.md deleted file mode 100644 index 7c2cf5ef..00000000 --- a/commands/scaffold/theme-tests/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/scaffold/theme-tests/ ---- \ No newline at end of file diff --git a/commands/search-replace/index.md b/commands/search-replace/index.md index aa13a254..f6a365a5 100644 --- a/commands/search-replace/index.md +++ b/commands/search-replace/index.md @@ -1,4 +1,111 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/search-replace/ ---- \ No newline at end of file +layout: default +title: 'wp search-replace' +display_global_parameters: true +--- + +[Commands](/commands/) » search-replace + +`wp search-replace` - Search/replace strings in the database. + +Quick links: Github issues + +
+ +### DESCRIPTION + +This command will searches through all rows in a selection of tables +and replaces appearances of the first string with the second string. + +By default, the command uses tables registered to the $wpdb object. On +multisite, this will just be the tables for the current site unless +\--network is specified. + +Search/replace intelligently handles PHP serialized data, and does not +change primary key values. + +### OPTIONS + +<old> +: A string to search for within the database. + +<new> +: Replace instances of the first string with this new string. + +[<table>...] +: List of database tables to restrict the replacement to. Wildcards are +supported, e.g. `'wp_*_options'` or `'wp_post*'`. + +[\--dry-run] +: Run the entire search/replace operation and show report, but don't save +changes to the database. + +[\--network] +: Search/replace through all the tables registered to $wpdb in a +multisite install. + +[\--all-tables-with-prefix] +: Enable replacement on any tables that match the table prefix even if +not registered on $wpdb. + +[\--all-tables] +: Enable replacement on ALL tables in the database, regardless of the +prefix, and even if not registered on $wpdb. Overrides --network +and --all-tables-with-prefix. + +[\--export[=<file>]] +: Write transformed data as SQL file instead of saving replacements to +the database. If <file> is not supplied, will output to STDOUT. + +[\--export_insert_size=<rows>] +: Define number of rows in single INSERT statement when doing SQL export. +You might want to change this depending on your database configuration +(e.g. if you need to do fewer queries). Default: 50 + +[\--skip-columns=<columns>] +: Do not perform the replacement on specific columns. Use commas to +specify multiple columns. 'guid' is skipped by default. + +[\--include-columns=<columns>] +: Perform the replacement on specific columns. Use commas to +specify multiple columns. + +[\--precise] +: Force the use of PHP (instead of SQL) which is more thorough, +but slower. + +[\--recurse-objects] +: Enable recursing into objects to replace strings. Defaults to true; +pass --no-recurse-objects to disable. + +[\--verbose] +: Prints rows to the console as they're updated. + +[\--regex] +: Runs the search using a regular expression. Warning: search-replace +will take about 15-20x longer when using --regex. + +### EXAMPLES + + # Search and replace but skip one column + $ wp search-replace 'http://example.dev' 'http://example.com' --skip-columns=guid + + # Run search/replace operation but dont save in database + $ wp search-replace 'foo' 'bar' wp_posts wp_postmeta wp_terms --dry-run + + # Turn your production multisite database into a local dev database + $ wp search-replace --url=example.com example.com example.dev 'wp_*_options' wp_blogs + + # Search/replace to a SQL file without transforming the database + $ wp search-replace foo bar --export=database.sql + + # Bash script: Search/replace production to development url (multisite compatible) + #!/bin/bash + if $(wp --url=http://example.com core is-installed --network); then + wp search-replace --url=http://example.com 'http://example.com' 'http://example.dev' --recurse-objects --network --skip-columns=guid + else + wp search-replace 'http://example.com' 'http://example.dev' --recurse-objects --skip-columns=guid + fi + + + diff --git a/commands/server/index.md b/commands/server/index.md index 72286e3b..c5536b42 100644 --- a/commands/server/index.md +++ b/commands/server/index.md @@ -1,4 +1,51 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/server/ ---- \ No newline at end of file +layout: default +title: 'wp server' +display_global_parameters: true +--- + +[Commands](/commands/) » server + +`wp server` - Launch PHP's built-in web server for this specific WordPress installation. + +Quick links: Github issues + +
+ +<http://php.net/manual/en/features.commandline.webserver.php> + +### OPTIONS + +[\--host=<host>] +: The hostname to bind the server to. +\--- +default: localhost +\--- + +[\--port=<port>] +: The port number to bind the server to. +\--- +default: 8080 +\--- + +[\--docroot=<path>] +: The path to use as the document root. + +### EXAMPLES + + # Make the instance available on any address (with port 8080) + $ wp server --host=0.0.0.0 + PHP 5.6.9 Development Server started at Tue May 24 01:27:11 2016 + Listening on http://0.0.0.0:8080 + Document root is / + Press Ctrl-C to quit. + + # Run on port 80 (for multisite) + $ sudo wp server --host=localhost.localdomain --port=80 + PHP 5.6.9 Development Server started at Tue May 24 01:30:06 2016 + Listening on http://localhost1.localdomain1:8080 + Document root is / + Press Ctrl-C to quit. + + + diff --git a/commands/shell/index.md b/commands/shell/index.md index 2891bd1b..3db5664a 100644 --- a/commands/shell/index.md +++ b/commands/shell/index.md @@ -1,4 +1,31 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/shell/ ---- \ No newline at end of file +layout: default +title: 'wp shell' +display_global_parameters: true +--- + +[Commands](/commands/) » shell + +`wp shell` - Interactive PHP console. + +Quick links: Github issues + +
+ +### 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. + +### EXAMPLES + + # Start interactive PHP console + $ wp shell + wp> + + + diff --git a/commands/sidebar/index.md b/commands/sidebar/index.md index 404346c8..a0b5cded 100644 --- a/commands/sidebar/index.md +++ b/commands/sidebar/index.md @@ -1,4 +1,40 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/sidebar/ ---- \ No newline at end of file +layout: default +title: 'wp sidebar' +display_global_parameters: true +--- + +[Commands](/commands/) » sidebar + +`wp sidebar` - Manage sidebars. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List sidebars + $ wp sidebar list --fields=name,id --format=csv + name,id + "Widget Area",sidebar-1 + "Inactive Widgets",wp_inactive_widgets + + + +### SUBCOMMANDS + + + + + + + + + + + + + + +
NameDescription
listList registered sidebars.
diff --git a/commands/sidebar/list/index.md b/commands/sidebar/list/index.md index fc8ce0f8..26c7a394 100644 --- a/commands/sidebar/list/index.md +++ b/commands/sidebar/list/index.md @@ -1,4 +1,57 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/sidebar/list/ ---- \ No newline at end of file +layout: default +title: 'wp sidebar list' +display_global_parameters: true +--- + +[Commands](/commands/) » [sidebar](/commands/sidebar/) » list + +`wp sidebar list` - List registered sidebars. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - ids + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each sidebar: + +* name +* id +* description + +These fields are optionally available: + +* class +* before_widget +* after_widget +* before_title +* after_title + +### EXAMPLES + + $ wp sidebar list --fields=name,id --format=csv + name,id + "Widget Area",sidebar-1 + "Inactive Widgets",wp_inactive_widgets + + + diff --git a/commands/site/activate/index.md b/commands/site/activate/index.md index 4191d9d7..77c22199 100644 --- a/commands/site/activate/index.md +++ b/commands/site/activate/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/activate/ ---- \ No newline at end of file +layout: default +title: 'wp site activate' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » activate + +`wp site activate` - Activate one or more sites + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of sites to activate. + +### EXAMPLES + + $ wp site activate 123 + Success: Site 123 activated. + + + diff --git a/commands/site/archive/index.md b/commands/site/archive/index.md index 9260e815..06114164 100644 --- a/commands/site/archive/index.md +++ b/commands/site/archive/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/archive/ ---- \ No newline at end of file +layout: default +title: 'wp site archive' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » archive + +`wp site archive` - Archive one or more sites + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of sites to archive. + +### EXAMPLES + + $ wp site archive 123 + Success: Site 123 archived. + + + diff --git a/commands/site/create/index.md b/commands/site/create/index.md index 3502b1a0..13393adc 100644 --- a/commands/site/create/index.md +++ b/commands/site/create/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/create/ ---- \ No newline at end of file +layout: default +title: 'wp site create' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » create + +`wp site create` - Create a site in a multisite install. + +Quick links: Github issues + +
+ +### 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. + +### EXAMPLES + + $ wp site create --slug=example + Success: Site 3 created: www.example.com/example/ + + + diff --git a/commands/site/deactivate/index.md b/commands/site/deactivate/index.md index 868cde0a..87e89fea 100644 --- a/commands/site/deactivate/index.md +++ b/commands/site/deactivate/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/deactivate/ ---- \ No newline at end of file +layout: default +title: 'wp site deactivate' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » deactivate + +`wp site deactivate` - Deactivate one or more sites + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of sites to deactivate. + +### EXAMPLES + + $ wp site deactivate 123 + Success: Site 123 deactivated. + + + diff --git a/commands/site/delete/index.md b/commands/site/delete/index.md index 312f171c..54081263 100644 --- a/commands/site/delete/index.md +++ b/commands/site/delete/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/delete/ ---- \ No newline at end of file +layout: default +title: 'wp site delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » delete + +`wp site delete` - Delete a site in a multisite install. + +Quick links: Github issues + +
+ +### OPTIONS + +[<site-id>] +: The id of the site 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. + +### EXAMPLES + + $ wp site delete 123 + Are you sure you want to delete the http://www.example.com/example site? [y/n] y + Success: The site at 'http://www.example.com/example' was deleted. + + + diff --git a/commands/site/empty/index.md b/commands/site/empty/index.md index 3017c434..9a84d739 100644 --- a/commands/site/empty/index.md +++ b/commands/site/empty/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/empty/ ---- \ No newline at end of file +layout: default +title: 'wp site empty' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » empty + +`wp site empty` - Empty a site of its content (posts, comments, and terms). + +Quick links: Github issues + +
+ +This command doesn't empty custom database tables by default. To do so, +you'll need to hook into command execution: + +``` +WP_CLI::add_hook( 'after_invoke:site empty', function(){ + global $wpdb; + foreach( array( 'p2p', 'p2pmeta' ) as $table ) { + $table = $wpdb->$table; + $wpdb->query( "TRUNCATE $table" ); + } +}); +``` + +### OPTIONS + +[\--uploads] +: Also delete *all* files in the site's in the uploads directory. + +[\--yes] +: Proceed to empty the site without a confirmation prompt. + +### EXAMPLES + + $ wp site empty + Are you sure you want to empty the site at http://www.example.com of all posts, comments, and terms? [y/n] y + Success: The site at 'http://www.example.com' was emptied. + + + diff --git a/commands/site/index.md b/commands/site/index.md index 39ca96ed..9ed130fe 100644 --- a/commands/site/index.md +++ b/commands/site/index.md @@ -1,4 +1,84 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/ ---- \ No newline at end of file +layout: default +title: 'wp site' +display_global_parameters: true +--- + +[Commands](/commands/) » site + +`wp site` - Perform site-wide operations. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Create site + $ wp site create --slug=example + Success: Site 3 created: www.example.com/example/ + + # Output a simple list of site URLs + $ wp site list --field=url + http://www.example.com/ + http://www.example.com/subdir/ + + # Delete site + $ wp site delete 123 + Are you sure you want to delete the 'http://www.example.com/example' site? [y/n] y + Success: The site at 'http://www.example.com/example' was deleted. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
activateActivate one or more sites
archiveArchive one or more sites
createCreate a site in a multisite install.
deactivateDeactivate one or more sites
deleteDelete a site in a multisite install.
emptyEmpty a site of its content (posts, comments, and terms).
listList all sites in a multisite install.
spamMark one or more sites as spam
unarchiveUnarchive one or more sites
unspamRemove one or more sites from spam
diff --git a/commands/site/list/index.md b/commands/site/list/index.md index 821357c8..784dfebd 100644 --- a/commands/site/list/index.md +++ b/commands/site/list/index.md @@ -1,4 +1,72 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/list/ ---- \ No newline at end of file +layout: default +title: 'wp site list' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » list + +`wp site list` - List all sites in a multisite install. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--network=<id>] +: The network to which the sites belong. + +[\--<field>=<value>] +: Filter by one or more fields (see "Available Fields" section). However, +'url' isn't an available filter, because it's created from domain + path. + +[\--field=<field>] +: Prints the value of a single field for each site. + +[\--fields=<fields>] +: Comma-separated list of fields to show. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - count + - ids + - json + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each site: + +* blog_id +* url +* last_updated +* registered + +These fields are optionally available: + +* site_id +* domain +* path +* public +* archived +* mature +* spam +* deleted +* lang_id + +### EXAMPLES + + # Output a simple list of site URLs + $ wp site list --field=url + http://www.example.com/ + http://www.example.com/subdir/ + + + diff --git a/commands/site/option/add/index.md b/commands/site/option/add/index.md deleted file mode 100644 index e41ddbf6..00000000 --- a/commands/site/option/add/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/option/add/ ---- \ No newline at end of file diff --git a/commands/site/option/delete/index.md b/commands/site/option/delete/index.md deleted file mode 100644 index 2907d7bd..00000000 --- a/commands/site/option/delete/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/option/delete/ ---- \ No newline at end of file diff --git a/commands/site/option/get/index.md b/commands/site/option/get/index.md deleted file mode 100644 index e444530c..00000000 --- a/commands/site/option/get/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/option/get/ ---- \ No newline at end of file diff --git a/commands/site/option/index.md b/commands/site/option/index.md deleted file mode 100644 index ed1a6966..00000000 --- a/commands/site/option/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/option/ ---- \ No newline at end of file diff --git a/commands/site/option/list/index.md b/commands/site/option/list/index.md deleted file mode 100644 index d206e838..00000000 --- a/commands/site/option/list/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/option/list/ ---- \ No newline at end of file diff --git a/commands/site/option/update/index.md b/commands/site/option/update/index.md deleted file mode 100644 index c0733251..00000000 --- a/commands/site/option/update/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/option/update/ ---- \ No newline at end of file diff --git a/commands/site/spam/index.md b/commands/site/spam/index.md index 20785019..9dbf125e 100644 --- a/commands/site/spam/index.md +++ b/commands/site/spam/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/spam/ ---- \ No newline at end of file +layout: default +title: 'wp site spam' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » spam + +`wp site spam` - Mark one or more sites as spam + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of sites to be marked as spam. + +### EXAMPLES + + $ wp site spam 123 + Success: Site 123 marked as spam. + + + diff --git a/commands/site/unarchive/index.md b/commands/site/unarchive/index.md index e328a315..f4f971ea 100644 --- a/commands/site/unarchive/index.md +++ b/commands/site/unarchive/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/unarchive/ ---- \ No newline at end of file +layout: default +title: 'wp site unarchive' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » unarchive + +`wp site unarchive` - Unarchive one or more sites + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of sites to unarchive. + +### EXAMPLES + + $ wp site unarchive 123 + Success: Site 123 unarchived. + + + diff --git a/commands/site/unspam/index.md b/commands/site/unspam/index.md index a1631b11..97769e31 100644 --- a/commands/site/unspam/index.md +++ b/commands/site/unspam/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/site/unspam/ ---- \ No newline at end of file +layout: default +title: 'wp site unspam' +display_global_parameters: true +--- + +[Commands](/commands/) » [site](/commands/site/) » unspam + +`wp site unspam` - Remove one or more sites from spam + +Quick links: Github issues + +
+ +### OPTIONS + +<id>... +: One or more IDs of sites to remove from spam. + +### EXAMPLES + + $ wp site unspam 123 + Success: Site 123 removed from spam. + + + diff --git a/commands/super-admin/add/index.md b/commands/super-admin/add/index.md index edc0f3a7..cc4006f5 100644 --- a/commands/super-admin/add/index.md +++ b/commands/super-admin/add/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/super-admin/add/ ---- \ No newline at end of file +layout: default +title: 'wp super-admin add' +display_global_parameters: true +--- + +[Commands](/commands/) » [super-admin](/commands/super-admin/) » add + +`wp super-admin add` - Grant super-admin privileges to one or more users. + +Quick links: Github issues + +
+ +### OPTIONS + +<user>... +: One or more user IDs, user emails, or user logins. + +### EXAMPLES + + $ wp super-admin add superadmin2 + Success: Granted super-admin capabilities. + + + diff --git a/commands/super-admin/index.md b/commands/super-admin/index.md index 63edbde6..5819833f 100644 --- a/commands/super-admin/index.md +++ b/commands/super-admin/index.md @@ -1,4 +1,55 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/super-admin/ ---- \ No newline at end of file +layout: default +title: 'wp super-admin' +display_global_parameters: true +--- + +[Commands](/commands/) » super-admin + +`wp super-admin` - List, add, and remove super admins from a network. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List user with super-admin capabilities + $ wp super-admin list + supervisor + administrator + + # Grant super-admin privileges to the user. + $ wp super-admin add superadmin2 + Success: Granted super-admin capabilities. + + # Revoke super-admin privileges to the user. + $ wp super-admin remove superadmin2 + Success: Revoked super-admin capabilities. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addGrant super-admin privileges to one or more users.
listShow a list of users with super-admin capabilities.
removeRevoke super-admin privileges to one or more users.
diff --git a/commands/super-admin/list/index.md b/commands/super-admin/list/index.md index 449605c7..08d93d65 100644 --- a/commands/super-admin/list/index.md +++ b/commands/super-admin/list/index.md @@ -1,4 +1,38 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/super-admin/list/ ---- \ No newline at end of file +layout: default +title: 'wp super-admin list' +display_global_parameters: true +--- + +[Commands](/commands/) » [super-admin](/commands/super-admin/) » list + +`wp super-admin list` - Show a list of users with super-admin capabilities. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--format=<format>] +: Render output in a particular format. +\--- +default: list +options: + - list + - table + - csv + - json + - count + - yaml +\--- + +### EXAMPLES + + # List user with super-admin capabilities + $ wp super-admin list + supervisor + administrator + + + diff --git a/commands/super-admin/remove/index.md b/commands/super-admin/remove/index.md index 7025bc76..0af3a728 100644 --- a/commands/super-admin/remove/index.md +++ b/commands/super-admin/remove/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/super-admin/remove/ ---- \ No newline at end of file +layout: default +title: 'wp super-admin remove' +display_global_parameters: true +--- + +[Commands](/commands/) » [super-admin](/commands/super-admin/) » remove + +`wp super-admin remove` - Revoke super-admin privileges to one or more users. + +Quick links: Github issues + +
+ +### OPTIONS + +<user>... +: One or more user IDs, user emails, or user logins. + +### EXAMPLES + + $ wp super-admin remove superadmin2 + Success: Revoked super-admin capabilities. + + + diff --git a/commands/taxonomy/get/index.md b/commands/taxonomy/get/index.md index 8dd49989..c1e5a3fe 100644 --- a/commands/taxonomy/get/index.md +++ b/commands/taxonomy/get/index.md @@ -1,4 +1,73 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/taxonomy/get/ ---- \ No newline at end of file +layout: default +title: 'wp taxonomy get' +display_global_parameters: true +--- + +[Commands](/commands/) » [taxonomy](/commands/taxonomy/) » get + +`wp taxonomy get` - Get a taxonomy. + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: Taxonomy slug + +[\--field=<field>] +: Instead of returning the whole taxonomy, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +### EXAMPLES + + $ wp taxonomy get category + +---------------+---------------------------------------------------+ + | Field | Value | + +---------------+---------------------------------------------------+ + | name | category | + | label | Categories | + | description | | + | object_type | ["post"] | + | show_tagcloud | true | + | hierarchical | true | + | public | true | + | labels | {"name":"Categories","singular_name":"Category"," | + | | search_items":"Search Categories","popular_items" | + | | :null,"all_items":"All Categories","parent_item": | + | | "Parent Category","parent_item_colon":"Parent Cat | + | | egory:","edit_item":"Edit Category","view_item":" | + | | View Category","update_item":"Update Category","a | + | | dd_new_item":"Add New Category","new_item_name":" | + | | New Category Name","separate_items_with_commas":n | + | | ull,"add_or_remove_items":null,"choose_from_most_ | + | | used":null,"not_found":"No categories found.","no | + | | _terms":"No categories","items_list_navigation":" | + | | Categories list navigation","items_list":"Categor | + | | ies list","menu_name":"Categories","name_admin_ba | + | | r":"category"} | + | cap | {"manage_terms":"manage_categories","edit_terms": | + | | "manage_categories","delete_terms":"manage_catego | + | | ries","assign_terms":"edit_posts"} | + +---------------+---------------------------------------------------+ + + $ wp taxonomy get post_tag --field=cap + {"manage_terms":"manage_categories","edit_terms":"manage_categories","delete_terms":"manage_categories","assign_terms":"edit_posts"} + + + diff --git a/commands/taxonomy/index.md b/commands/taxonomy/index.md index e7f6f919..f407197c 100644 --- a/commands/taxonomy/index.md +++ b/commands/taxonomy/index.md @@ -1,4 +1,52 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/taxonomy/ ---- \ No newline at end of file +layout: default +title: 'wp taxonomy' +display_global_parameters: true +--- + +[Commands](/commands/) » taxonomy + +`wp taxonomy` - Manage taxonomies. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List all taxonomies with 'post' object type + $ wp taxonomy list --object_type=post --fields=name,public + +-------------+--------+ + | name | public | + +-------------+--------+ + | category | 1 | + | post_tag | 1 | + | post_format | 1 | + +-------------+--------+ + + # Get capabilities of a taxonomy + $ wp taxonomy get post_tag --field=cap + {"manage_terms":"manage_categories","edit_terms":"manage_categories","delete_terms":"manage_categories","assign_terms":"edit_posts"} + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + +
NameDescription
getGet a taxonomy
listList taxonomies.
diff --git a/commands/taxonomy/list/index.md b/commands/taxonomy/list/index.md index 9faefe28..84cf5cf2 100644 --- a/commands/taxonomy/list/index.md +++ b/commands/taxonomy/list/index.md @@ -1,4 +1,72 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/taxonomy/list/ ---- \ No newline at end of file +layout: default +title: 'wp taxonomy list' +display_global_parameters: true +--- + +[Commands](/commands/) » [taxonomy](/commands/taxonomy/) » list + +`wp taxonomy list` - List taxonomies. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: Filter by one or more fields (see get_taxonomies() first parameter for a list of available fields). + +[\--field=<field>] +: Prints the value of a single field for each taxonomy. + +[\--fields=<fields>] +: Limit the output to specific taxonomy fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each term: + +* name +* label +* description +* public +* hierarchical + +There are no optionally available fields. + +### EXAMPLES + + # List all taxonomies + $ wp taxonomy list --format=csv + name,label,description,object_type,show_tagcloud,hierarchical,public + category,Categories,,post,1,1,1 + post_tag,Tags,,post,1,,1 + nav_menu,"Navigation Menus",,nav_menu_item,,, + link_category,"Link Categories",,link,1,, + post_format,Format,,post,,,1 + + # List all taxonomies with 'post' object type + $ wp taxonomy list --object_type=post --fields=name,public + +-------------+--------+ + | name | public | + +-------------+--------+ + | category | 1 | + | post_tag | 1 | + | post_format | 1 | + +-------------+--------+ + + + diff --git a/commands/term/create/index.md b/commands/term/create/index.md index 2319bb7f..f8ba6c6f 100644 --- a/commands/term/create/index.md +++ b/commands/term/create/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/create/ ---- \ No newline at end of file +layout: default +title: 'wp term create' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » create + +`wp term create` - Create a term. + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: Taxonomy for the new term. + +<term> +: A name 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 category Apple --description="A type of fruit" + Success: Created category 199. + + + diff --git a/commands/term/delete/index.md b/commands/term/delete/index.md index 93ae4ba6..2139e123 100644 --- a/commands/term/delete/index.md +++ b/commands/term/delete/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/delete/ ---- \ No newline at end of file +layout: default +title: 'wp term delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » delete + +`wp term delete` - Delete a term. + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: Taxonomy of the term to delete. + +<term-id>... +: One or more IDs of terms to delete. + +### EXAMPLES + + # Delete post category + $ wp term delete category 15 + Success: Deleted category 15. + + # Delete all post tags + $ wp term list post_tag --field=term_id | xargs wp term delete post_tag + Success: Deleted post_tag 159. + Success: Deleted post_tag 160. + Success: Deleted post_tag 161. + + + diff --git a/commands/term/generate/index.md b/commands/term/generate/index.md index 7723ec5e..09e58600 100644 --- a/commands/term/generate/index.md +++ b/commands/term/generate/index.md @@ -1,4 +1,48 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/generate/ ---- \ No newline at end of file +layout: default +title: 'wp term generate' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » generate + +`wp term generate` - Generate some terms. + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: The taxonomy for the generated terms. + +[\--count=<number>] +: How many terms to generate. Default: 100 + +[\--max_depth=<number>] +: Generate child terms down to a certain depth. Default: 1 + +[\--format=<format>] +: Render output in a particular format. +\--- +default: progress +options: + - progress + - ids +\--- + +### EXAMPLES + + # Generate post categories + $ wp term generate category --count=10 + Generating terms 100% [=========] 0:02 / 0:02 + + # Add meta to every generated term + $ wp term generate category --format=ids --count=3 | xargs -0 -d ' ' -I % wp term meta add % foo bar + Success: Added custom field. + Success: Added custom field. + Success: Added custom field. + + + diff --git a/commands/term/get/index.md b/commands/term/get/index.md index add6a239..a9606a07 100644 --- a/commands/term/get/index.md +++ b/commands/term/get/index.md @@ -1,4 +1,46 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/get/ ---- \ No newline at end of file +layout: default +title: 'wp term get' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » get + +`wp term get` - Get a taxonomy term + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: Taxonomy of the term to get + +<term-id> +: ID of the term to get + +[\--field=<field>] +: Instead of returning the whole term, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +### EXAMPLES + + $ wp term get category 199 --format=json + {"term_id":199,"name":"Apple","slug":"apple","term_group":0,"term_taxonomy_id":199,"taxonomy":"category","description":"A type of fruit","parent":0,"count":0,"filter":"raw"} + + + diff --git a/commands/term/index.md b/commands/term/index.md index e08cc23f..644f3a2b 100644 --- a/commands/term/index.md +++ b/commands/term/index.md @@ -1,4 +1,91 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/ ---- \ No newline at end of file +layout: default +title: 'wp term' +display_global_parameters: true +--- + +[Commands](/commands/) » term + +`wp term` - Manage terms. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Create term + $ wp term create category Apple --description="A type of fruit" + Success: Created category 199. + + # Get term + $ wp term get category 199 --format=json --fields=term_id,name,slug,count + {"term_id":199,"name":"Apple","slug":"apple","count":1} + + # Update term + $ wp term update category 15 --name=Apple + Success: Term updated. + + # Get term url + $ wp term url post_tag 123 + http://example.com/tag/tips-and-tricks + + # Delete post category + $ wp term delete category 15 + Success: Deleted category 15. + + # Recount posts assigned to each categories and tags + $ wp term recount category post_tag + Success: Updated category term count + Success: Updated post_tag term count + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
createCreate a term.
deleteDelete a term.
generateGenerate some terms.
getGet a taxonomy term
listList terms in a taxonomy.
metaManage term custom fields.
recountRecalculate number of posts assigned to each term.
updateUpdate a term.
urlGet term url
diff --git a/commands/term/list/index.md b/commands/term/list/index.md index fbe67e3e..d5d1b9f9 100644 --- a/commands/term/list/index.md +++ b/commands/term/list/index.md @@ -1,4 +1,78 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/list/ ---- \ No newline at end of file +layout: default +title: 'wp term list' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » list + +`wp term list` - List terms in a taxonomy. + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy>... +: List terms of one or more taxonomies + +[\--<field>=<value>] +: Filter by one or more fields (see get_terms() $args parameter for a list of fields). + +[\--field=<field>] +: Prints the value of a single field for each term. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - ids + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each term: + +* term_id +* term_taxonomy_id +* name +* slug +* description +* parent +* count + +There are no optionally available fields. + +### EXAMPLES + + # List post categories + $ wp term list category --format=csv + term_id,term_taxonomy_id,name,slug,description,parent,count + 2,2,aciform,aciform,,0,1 + 3,3,antiquarianism,antiquarianism,,0,1 + 4,4,arrangement,arrangement,,0,1 + 5,5,asmodeus,asmodeus,,0,1 + + # List post tags + $ wp term list post_tag --fields=name,slug + +-----------+-------------+ + | name | slug | + +-----------+-------------+ + | 8BIT | 8bit | + | alignment | alignment-2 | + | Articles | articles | + | aside | aside | + +-----------+-------------+ + + + diff --git a/commands/term/meta/add/index.md b/commands/term/meta/add/index.md index 98972be8..f0b50836 100644 --- a/commands/term/meta/add/index.md +++ b/commands/term/meta/add/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/meta/add/ ---- \ No newline at end of file +layout: default +title: 'wp term meta add' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » [meta](/commands/term/meta/) » add + +`wp term meta add` - Add a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to create. + +[<value>] +: The value of the meta field. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/term/meta/delete/index.md b/commands/term/meta/delete/index.md index adea46b5..80065cbd 100644 --- a/commands/term/meta/delete/index.md +++ b/commands/term/meta/delete/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/meta/delete/ ---- \ No newline at end of file +layout: default +title: 'wp term meta delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » [meta](/commands/term/meta/) » delete + +`wp term meta delete` - Delete a meta field. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +[<key>] +: The name of the meta field to delete. + +[<value>] +: The value to delete. If omitted, all rows with key will deleted. + +[\--all] +: Delete all meta for the object. + + + diff --git a/commands/term/meta/get/index.md b/commands/term/meta/get/index.md index c774b038..7c630506 100644 --- a/commands/term/meta/get/index.md +++ b/commands/term/meta/get/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/meta/get/ ---- \ No newline at end of file +layout: default +title: 'wp term meta get' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » [meta](/commands/term/meta/) » get + +`wp term meta get` - Get meta field value. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<key> +: The name of the meta field to get. + +[\--format=<format>] +: Accepted values: table, json. Default: table + + + diff --git a/commands/term/meta/index.md b/commands/term/meta/index.md index c71a250d..ac207dc0 100644 --- a/commands/term/meta/index.md +++ b/commands/term/meta/index.md @@ -1,4 +1,68 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/meta/ ---- \ No newline at end of file +layout: default +title: 'wp term meta' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » meta + +`wp term meta` - Manage term custom fields. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set term meta + $ wp term meta set 123 bio "Mary is a WordPress developer." + Success: Updated custom field 'bio'. + + # Get term meta + $ wp term meta get 123 bio + Mary is a WordPress developer. + + # Update term meta + $ wp term meta update 123 bio "Mary is an awesome WordPress developer." + Success: Updated custom field 'bio'. + + # Delete term meta + $ wp term meta delete 123 bio + Success: Deleted custom field. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a meta field.
deleteDelete a meta field.
getGet meta field value.
listList all metadata associated with an object.
updateUpdate a meta field.
diff --git a/commands/term/meta/list/index.md b/commands/term/meta/list/index.md index 1f3f1028..09a5cbe1 100644 --- a/commands/term/meta/list/index.md +++ b/commands/term/meta/list/index.md @@ -1,4 +1,28 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/meta/list/ ---- \ No newline at end of file +layout: default +title: 'wp term meta list' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » [meta](/commands/term/meta/) » list + +`wp term meta list` - List all metadata associated with an object. + +Quick links: Github issues + +
+ +<id> +: ID for the object. + +[\--keys=<keys>] +: Limit output to metadata of specific keys. + +[\--fields=<fields>] +: Limit the output to specific row fields. Defaults to id,meta_key,meta_value. + +[\--format=<format>] +: Accepted values: table, csv, json, count. Default: table + + + diff --git a/commands/term/meta/update/index.md b/commands/term/meta/update/index.md index a47bd2c6..f6e33cde 100644 --- a/commands/term/meta/update/index.md +++ b/commands/term/meta/update/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/meta/update/ ---- \ No newline at end of file +layout: default +title: 'wp term meta update' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » [meta](/commands/term/meta/) » update + +`wp term meta update` - Update a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: The ID of the object. + +<key> +: The name of the meta field to update. + +[<value>] +: The new value. If ommited, the value is read from STDIN. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + + + diff --git a/commands/term/recount/index.md b/commands/term/recount/index.md index 23f0263c..85aba19d 100644 --- a/commands/term/recount/index.md +++ b/commands/term/recount/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/recount/ ---- \ No newline at end of file +layout: default +title: 'wp term recount' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » recount + +`wp term recount` - Recalculate number of posts assigned to each term. + +Quick links: Github issues + +
+ +In instances where manual updates are made to the terms assigned to +posts in the database, the number of posts associated with a term +can become out-of-sync with the actual number of posts. + +This command runs wp_update_term_count() on the taxonomy's terms +to bring the count back to the correct value. + +### OPTIONS + +<taxonomy>... +: One or more taxonomies to recalculate. + +### EXAMPLES + + # Recount posts assigned to each categories and tags + $ wp term recount category post_tag + Success: Updated category term count. + Success: Updated post_tag term count. + + # Recount all listed taxonomies + $ wp taxonomy list --field=name | xargs wp term recount + Success: Updated category term count. + Success: Updated post_tag term count. + Success: Updated nav_menu term count. + Success: Updated link_category term count. + Success: Updated post_format term count. + + + diff --git a/commands/term/update/index.md b/commands/term/update/index.md index 7ee8473d..917ca349 100644 --- a/commands/term/update/index.md +++ b/commands/term/update/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/term/update/ ---- \ No newline at end of file +layout: default +title: 'wp term update' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » update + +`wp term update` - Update a term. + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: Taxonomy of the term to update. + +<term-id> +: ID for 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 category 15 --name=Apple + Success: Term updated. + + + diff --git a/commands/term/url/index.md b/commands/term/url/index.md new file mode 100644 index 00000000..6c8acc20 --- /dev/null +++ b/commands/term/url/index.md @@ -0,0 +1,29 @@ +--- +layout: default +title: 'wp term url' +display_global_parameters: true +--- + +[Commands](/commands/) » [term](/commands/term/) » url + +`wp term url` - Get term url + +Quick links: Github issues + +
+ +### OPTIONS + +<taxonomy> +: Taxonomy of the term(s) to get. + +<term-id>... +: One or more IDs of terms to get the URL. + +### EXAMPLES + + $ wp term url post_tag 123 + http://example.com/tag/tips-and-tricks + + + diff --git a/commands/theme/activate/index.md b/commands/theme/activate/index.md index 70d50b6f..12cad5bb 100644 --- a/commands/theme/activate/index.md +++ b/commands/theme/activate/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/activate/ ---- \ No newline at end of file +layout: default +title: 'wp theme activate' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » activate + +`wp theme activate` - Activate a theme. + +Quick links: Github issues + +
+ +### OPTIONS + +<theme> +: The theme to activate. + +### EXAMPLES + + $ wp theme activate twentysixteen + Success: Switched to 'Twenty Sixteen' theme. + + + diff --git a/commands/theme/delete/index.md b/commands/theme/delete/index.md index 2f9954a9..d82a2040 100644 --- a/commands/theme/delete/index.md +++ b/commands/theme/delete/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/delete/ ---- \ No newline at end of file +layout: default +title: 'wp theme delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » delete + +`wp theme delete` - Delete a theme. + +Quick links: Github issues + +
+ +### OPTIONS + +<theme>... +: One or more themes to delete. + +### EXAMPLES + + $ wp theme delete twentytwelve + Success: Deleted 'twentytwelve' theme. + + + diff --git a/commands/theme/disable/index.md b/commands/theme/disable/index.md index b312bbee..4a068166 100644 --- a/commands/theme/disable/index.md +++ b/commands/theme/disable/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/disable/ ---- \ No newline at end of file +layout: default +title: 'wp theme disable' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » disable + +`wp theme disable` - Disable a theme in a multisite install. + +Quick links: Github issues + +
+ +### OPTIONS + +<theme> +: The theme to disable. + +[\--network] +: If set, the theme is disabled on the network level. Note that +individual sites may still have this theme enabled if it was +enabled for them independently. + +### EXAMPLES + + # Disable theme + $ wp theme disable twentysixteen + Success: Disabled the 'Twenty Sixteen' theme. + + # Disable theme in network level + $ wp theme disable twentysixteen --network + Success: Network disabled the 'Twenty Sixteen' theme. + + + diff --git a/commands/theme/enable/index.md b/commands/theme/enable/index.md index ebed834c..c7a8fef3 100644 --- a/commands/theme/enable/index.md +++ b/commands/theme/enable/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/enable/ ---- \ No newline at end of file +layout: default +title: 'wp theme enable' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » enable + +`wp theme enable` - Enable a theme in a multisite install. + +Quick links: Github issues + +
+ +### OPTIONS + +<theme> +: The theme to enable. + +[\--network] +: If set, the theme is enabled for the entire network + +[\--activate] +: If set, the theme is activated for the current site. Note that +the "network" flag has no influence on this. + +### EXAMPLES + + # Enable theme + $ wp theme enable twentysixteen + Success: Enabled the 'Twenty Sixteen' theme. + + # Network enable theme + $ wp theme enable twentysixteen --network + Success: Network enabled the 'Twenty Sixteen' theme. + + # Network enable and activate theme for current site + $ wp theme enable twentysixteen --activate + Success: Enabled the 'Twenty Sixteen' theme. + Success: Switched to 'Twenty Sixteen' theme. + + + diff --git a/commands/theme/get/index.md b/commands/theme/get/index.md index cf178449..6aa98340 100644 --- a/commands/theme/get/index.md +++ b/commands/theme/get/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/get/ ---- \ No newline at end of file +layout: default +title: 'wp theme get' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » get + +`wp theme get` - Get a theme + +Quick links: Github issues + +
+ +### OPTIONS + +<theme> +: The theme to get. + +[\--field=<field>] +: Instead of returning the whole theme, returns the value of a single field. + +[\--fields=<fields>] +: Limit the output to specific fields. Defaults to all fields. + +[\--format=<format>] +: Accepted values: table, json, csv, yaml. Default: table + +### EXAMPLES + + $ wp theme get twentysixteen --fields=name,title,version + +---------+----------------+ + | Field | Value | + +---------+----------------+ + | name | Twenty Sixteen | + | title | Twenty Sixteen | + | version | 1.2 | + +---------+----------------+ + + + diff --git a/commands/theme/index.md b/commands/theme/index.md index 8d5c6d76..1b0a31aa 100644 --- a/commands/theme/index.md +++ b/commands/theme/index.md @@ -1,4 +1,110 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/ ---- \ No newline at end of file +layout: default +title: 'wp theme' +display_global_parameters: true +--- + +[Commands](/commands/) » theme + +`wp theme` - Manage themes. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Install the latest version from wordpress.org and activate + $ wp theme install twentysixteen --activate + Installing Twenty Sixteen (1.2) + Downloading install package from http://downloads.wordpress.org/theme/twentysixteen.1.2.zip... + Unpacking the package... + Installing the theme... + Theme installed successfully. + Activating 'twentysixteen'... + Success: Switched to 'Twenty Sixteen' theme. + + # Get theme + $ wp theme get twentysixteen --fields=name,title,version + +---------+----------------+ + | Field | Value | + +---------+----------------+ + | name | Twenty Sixteen | + | title | Twenty Sixteen | + | version | 1.2 | + +---------+----------------+ + + # Get status of theme + $ wp theme status twentysixteen + Theme twentysixteen details: + Name: Twenty Sixteen + Status: Active + Version: 1.2 + Author: the WordPress team + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
activateActivate a theme.
deleteDelete a theme.
disableDisable a theme in a multisite install.
enableEnable a theme in a multisite install.
getGet a theme
installInstall a theme.
is-installedCheck if the theme is installed.
listGet a list of themes.
modManage theme mods.
pathGet the path to a theme or to the theme directory.
searchSearch the wordpress.org theme repository.
statusSee the status of one or all themes.
updateUpdate one or more themes.
diff --git a/commands/theme/install/index.md b/commands/theme/install/index.md index c8fe8318..03bbed5f 100644 --- a/commands/theme/install/index.md +++ b/commands/theme/install/index.md @@ -1,4 +1,50 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/install/ ---- \ No newline at end of file +layout: default +title: 'wp theme install' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » install + +`wp theme install` - Install a theme. + +Quick links: Github issues + +
+ +### OPTIONS + +<theme|zip|url>... +: A theme 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 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 twentysixteen --activate + Installing Twenty Sixteen (1.2) + Downloading install package from http://downloads.wordpress.org/theme/twentysixteen.1.2.zip... + Unpacking the package... + Installing the theme... + Theme installed successfully. + Activating 'twentysixteen'... + Success: Switched to 'Twenty Sixteen' theme. + + # 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 + + + diff --git a/commands/theme/is-installed/index.md b/commands/theme/is-installed/index.md index a846bace..9a894a63 100644 --- a/commands/theme/is-installed/index.md +++ b/commands/theme/is-installed/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/is-installed/ ---- \ No newline at end of file +layout: default +title: 'wp theme is-installed' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » is-installed + +`wp theme is-installed` - Check if the theme is installed. + +Quick links: Github issues + +
+ +Returns exit code 0 when installed, 1 when uninstalled. + +### OPTIONS + +<theme> +: The theme to check. + +### EXAMPLES + + # Check whether theme is installed; exit status 0 if installed, otherwise 1 + $ wp theme is-installed hello-dolly + $ echo $? + 1 + + + diff --git a/commands/theme/list/index.md b/commands/theme/list/index.md index 94f386fc..dc8bacf6 100644 --- a/commands/theme/list/index.md +++ b/commands/theme/list/index.md @@ -1,4 +1,55 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/list/ ---- \ No newline at end of file +layout: default +title: 'wp theme list' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » list + +`wp theme list` - Get a list of themes. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--<field>=<value>] +: Filter results based on the value of a field. + +[\--field=<field>] +: Prints the value of a single field for each theme. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Accepted values: table, json, csv, yaml. Default: table + +### AVAILABLE FIELDS + +These fields will be displayed by default for each theme: + +* name +* status +* update +* version + +These fields are optionally available: + +* update_version +* update_package +* update_id +* title +* description + +### EXAMPLES + + # List themes + $ wp theme list --status=inactive --format=csv + name,status,update,version + twentyfourteen,inactive,none,1.7 + twentysixteen,inactive,available,1.1 + + + diff --git a/commands/theme/mod/get/index.md b/commands/theme/mod/get/index.md index b6ca8909..ff6760b3 100644 --- a/commands/theme/mod/get/index.md +++ b/commands/theme/mod/get/index.md @@ -1,4 +1,60 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/mod/get/ ---- \ No newline at end of file +layout: default +title: 'wp theme mod get' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » [mod](/commands/theme/mod/) » get + +`wp theme mod get` - Get theme mod(s). + +Quick links: Github issues + +
+ +### OPTIONS + +[<mod>...] +: One or more mods to get. + +[\--all] +: List all theme mods + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - json + - csv + - yaml +\--- + +### EXAMPLES + + # Get all theme mods + $ wp theme mod get --all + +------------------+---------+ + | key | value | + +------------------+---------+ + | background_color | dd3333 | + | link_color | #dd9933 | + | main_text_color | #8224e3 | + +------------------+---------+ + + # Get single theme mod in JSON format + $ wp theme mod get background_color --format=json + [{"key":"background_color","value":"dd3333"}] + + # Get multiple theme mods + $ wp theme mod get background_color header_textcolor + +------------------+--------+ + | key | value | + +------------------+--------+ + | background_color | dd3333 | + | header_textcolor | | + +------------------+--------+ + + + diff --git a/commands/theme/mod/index.md b/commands/theme/mod/index.md index af7293b5..a7d7b483 100644 --- a/commands/theme/mod/index.md +++ b/commands/theme/mod/index.md @@ -1,4 +1,56 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/mod/ ---- \ No newline at end of file +layout: default +title: 'wp theme mod' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » mod + +`wp theme mod` - Manage theme mods. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set theme mod. + $ wp theme mod set background_color 000000 + Success: Theme mod background_color set to 000000 + + # Get single theme mod in JSON format. + $ wp theme mod get background_color --format=json + [{"key":"background_color","value":"dd3333"}] + + # Remove all theme mods. + $ wp theme mod remove --all + Success: Theme mods removed. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
getGet theme mod(s).
removeRemove theme mod(s).
setSet a theme mod.
diff --git a/commands/theme/mod/remove/index.md b/commands/theme/mod/remove/index.md index 7a7382e7..eb0f58ce 100644 --- a/commands/theme/mod/remove/index.md +++ b/commands/theme/mod/remove/index.md @@ -1,4 +1,38 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/mod/remove/ ---- \ No newline at end of file +layout: default +title: 'wp theme mod remove' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » [mod](/commands/theme/mod/) » remove + +`wp theme mod remove` - Remove theme mod(s). + +Quick links: Github issues + +
+ +### OPTIONS + +[<mod>...] +: One or more mods to remove. + +[\--all] +: Remove all theme mods. + +### EXAMPLES + + # Remove all theme mods. + $ wp theme mod remove --all + Success: Theme mods removed. + + # Remove single theme mod. + $ wp theme mod remove background_color + Success: 1 mod removed. + + # Remove multiple theme mods. + $ wp theme mod remove background_color header_textcolor + Success: 2 mods removed. + + + diff --git a/commands/theme/mod/set/index.md b/commands/theme/mod/set/index.md index 802367dd..adfdfc2d 100644 --- a/commands/theme/mod/set/index.md +++ b/commands/theme/mod/set/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/mod/set/ ---- \ No newline at end of file +layout: default +title: 'wp theme mod set' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » [mod](/commands/theme/mod/) » set + +`wp theme mod set` - Set a theme mod. + +Quick links: Github issues + +
+ +### OPTIONS + +<mod> +: The name of the theme mod to set or update. + +<value> +: The new value. + +### EXAMPLES + + # Set theme mod + $ wp theme mod set background_color 000000 + Success: Theme mod background_color set to 000000 + + + diff --git a/commands/theme/path/index.md b/commands/theme/path/index.md index 33cefc57..9878d003 100644 --- a/commands/theme/path/index.md +++ b/commands/theme/path/index.md @@ -1,4 +1,35 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/path/ ---- \ No newline at end of file +layout: default +title: 'wp theme path' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » path + +`wp theme path` - Get the path to a theme or to the theme directory. + +Quick links: Github issues + +
+ +### OPTIONS + +[<theme>] +: The theme to get the path to. Path includes "style.css" file. +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's "style.css" file. + +### EXAMPLES + + # Get theme path + $ wp theme path + /var/www/example.com/public_html/wp-content/themes + + # Change directory to theme path + $ cd $(wp theme path) + + + diff --git a/commands/theme/search/index.md b/commands/theme/search/index.md index 727c8ba2..6d3348e4 100644 --- a/commands/theme/search/index.md +++ b/commands/theme/search/index.md @@ -1,4 +1,59 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/search/ ---- \ No newline at end of file +layout: default +title: 'wp theme search' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » search + +`wp theme search` - Search the wordpress.org theme repository. + +Quick links: Github issues + +
+ +### OPTIONS + +<search> +: The string to search for. + +[\--per-page=<per-page>] +: Optional number of results to display. Defaults to 10. + +[\--field=<field>] +: Prints the value of a single field for each theme. + +[\--fields=<fields>] +: Ask for specific fields from the API. Defaults to name,slug,author,rating. Acceptable values: + + **name**: Theme Name + **slug**: Theme Slug + **version**: Current Version Number + **author**: Theme Author + **preview_url**: Theme Preview URL + **screenshot_url**: Theme Screenshot URL + **rating**: Theme Rating + **num_ratings**: Number of Theme Ratings + **homepage**: Theme Author's Homepage + **description**: Theme Description + +[\--format=<format>] +: Accepted values: table, csv, json, count, yaml. Default: table + +### EXAMPLES + + $ wp theme search photo --per-page=6 + Success: Showing 6 of 203 themes. + +----------------------+----------------------+--------+ + | name | slug | rating | + +----------------------+----------------------+--------+ + | Photos | photos | 100 | + | Infinite Photography | infinite-photography | 100 | + | PhotoBook | photobook | 100 | + | BG Photo Frame | bg-photo-frame | 0 | + | fPhotography | fphotography | 0 | + | Photo Perfect | photo-perfect | 98 | + +----------------------+----------------------+--------+ + + + diff --git a/commands/theme/status/index.md b/commands/theme/status/index.md index 3af22e0e..4f27d1a3 100644 --- a/commands/theme/status/index.md +++ b/commands/theme/status/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/status/ ---- \ No newline at end of file +layout: default +title: 'wp theme status' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » status + +`wp theme status` - See the status of one or all themes. + +Quick links: Github issues + +
+ +### OPTIONS + +[<theme>] +: A particular theme to show the status for. + +### EXAMPLES + + $ wp theme status twentysixteen + Theme twentysixteen details: + Name: Twenty Sixteen + Status: Inactive + Version: 1.2 + Author: the WordPress team + + + diff --git a/commands/theme/update-all/index.md b/commands/theme/update-all/index.md index d76844ef..291ec545 100644 --- a/commands/theme/update-all/index.md +++ b/commands/theme/update-all/index.md @@ -1,4 +1,6 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/update-all/ ---- \ No newline at end of file +layout: default +title: 'wp theme update-all' +--- + +`wp theme update-all` is an alias for [wp theme update --all](/commands/theme/update/). diff --git a/commands/theme/update/index.md b/commands/theme/update/index.md index 8146d0cd..806d54ab 100644 --- a/commands/theme/update/index.md +++ b/commands/theme/update/index.md @@ -1,4 +1,58 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/theme/update/ ---- \ No newline at end of file +layout: default +title: 'wp theme update' +display_global_parameters: true +--- + +[Commands](/commands/) » [theme](/commands/theme/) » update + +`wp theme update` - Update one or more themes. + +Quick links: Github issues + +
+ +### OPTIONS + +[<theme>...] +: One or more themes to update. + +[\--all] +: If set, all themes that have updates will be updated. + +[\--format=<format>] +: Output summary as table or summary. Defaults to table. + +[\--version=<version>] +: If set, the theme will be updated to the specified version. + +[\--dry-run] +: Preview which themes would be updated. + +### EXAMPLES + + # Update multiple themes + $ wp theme update twentyfifteen twentysixteen + Downloading update from https://downloads.wordpress.org/theme/twentyfifteen.1.5.zip... + Unpacking the update... + Installing the latest version... + Removing the old version of the theme... + Theme updated successfully. + Downloading update from https://downloads.wordpress.org/theme/twentysixteen.1.2.zip... + Unpacking the update... + Installing the latest version... + Removing the old version of the theme... + Theme updated successfully. + Success: Updated 2/2 themes. + +---------------+-------------+-------------+---------+ + | name | old_version | new_version | status | + +---------------+-------------+-------------+---------+ + | twentyfifteen | 1.4 | 1.5 | Updated | + | twentysixteen | 1.1 | 1.2 | Updated | + +---------------+-------------+-------------+---------+ + + # Update all themes + $ wp theme update --all + + + diff --git a/commands/transient/delete-all/index.md b/commands/transient/delete-all/index.md new file mode 100644 index 00000000..95a7c795 --- /dev/null +++ b/commands/transient/delete-all/index.md @@ -0,0 +1,21 @@ +--- +layout: default +title: 'wp transient delete-all' +display_global_parameters: true +--- + +[Commands](/commands/) » [transient](/commands/transient/) » delete-all + +`wp transient delete-all` - Delete all transients. + +Quick links: Github issues + +
+ +### EXAMPLES + + $ wp transient delete-all + Success: 14 transients deleted from the database. + + + diff --git a/commands/transient/delete-expired/index.md b/commands/transient/delete-expired/index.md new file mode 100644 index 00000000..401175ca --- /dev/null +++ b/commands/transient/delete-expired/index.md @@ -0,0 +1,21 @@ +--- +layout: default +title: 'wp transient delete-expired' +display_global_parameters: true +--- + +[Commands](/commands/) » [transient](/commands/transient/) » delete-expired + +`wp transient delete-expired` - Delete all expired transients. + +Quick links: Github issues + +
+ +### EXAMPLES + + $ wp transient delete-expired + Success: 12 expired transients deleted from the database. + + + diff --git a/commands/transient/delete/index.md b/commands/transient/delete/index.md index d938d89c..e688757d 100644 --- a/commands/transient/delete/index.md +++ b/commands/transient/delete/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/transient/delete/ ---- \ No newline at end of file +layout: default +title: 'wp transient delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [transient](/commands/transient/) » delete + +`wp transient delete` - Delete a transient value. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Key for the transient. + +[\--network] +: Delete the value of a network transient, instead of that on a single site. + +### EXAMPLES + + $ wp transient delete sample_key + Success: Transient deleted. + + + diff --git a/commands/transient/get/index.md b/commands/transient/get/index.md index 8a0c8a80..8db11a7f 100644 --- a/commands/transient/get/index.md +++ b/commands/transient/get/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/transient/get/ ---- \ No newline at end of file +layout: default +title: 'wp transient get' +display_global_parameters: true +--- + +[Commands](/commands/) » [transient](/commands/transient/) » get + +`wp transient get` - Get a transient value. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Key for the transient. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - json + - yaml +\--- + +[\--network] +: Get the value of the network transient, instead of the single site. + +### EXAMPLES + + $ wp transient get sample_key + test data + + $ wp transient get random_key + Warning: Transient with key "random_key" is not set. + + + diff --git a/commands/transient/index.md b/commands/transient/index.md index 95839b6d..2bbfc47e 100644 --- a/commands/transient/index.md +++ b/commands/transient/index.md @@ -1,4 +1,74 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/transient/ ---- \ No newline at end of file +layout: default +title: 'wp transient' +display_global_parameters: true +--- + +[Commands](/commands/) » transient + +`wp transient` - Manage transients. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set transient + $ wp transient set sample_key "test data" 3600 + Success: Transient added. + + # Get transient + $ wp transient get sample_key + test data + + # Delete transient + $ wp transient delete sample_key + Success: Transient deleted. + + # Delete expired transients + $ wp transient delete-expired + Success: 12 expired transients deleted from the database. + + # Delete all transients + $ wp transient delete-all + Success: 14 transients deleted from the database. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
deleteDelete a transient value.
delete-allDelete all transients.
delete-expiredDelete all expired transients.
getGet a transient value.
setSet a transient value. <expiration> is the time until expiration, in seconds.
typeSee whether the transients API is using an object cache or the options table.
diff --git a/commands/transient/set/index.md b/commands/transient/set/index.md index e8131ad5..cd4a2fcd 100644 --- a/commands/transient/set/index.md +++ b/commands/transient/set/index.md @@ -1,4 +1,35 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/transient/set/ ---- \ No newline at end of file +layout: default +title: 'wp transient set' +display_global_parameters: true +--- + +[Commands](/commands/) » [transient](/commands/transient/) » set + +`wp transient set` - Set a transient value. <expiration> is the time until expiration, in seconds. + +Quick links: Github issues + +
+ +### OPTIONS + +<key> +: Key for the transient. + +<value> +: Value to be set for the transient. + +[<expiration>] +: Time until expiration, in seconds. + +[\--network] +: Set the transient value on the network, instead of single site. + +### EXAMPLES + + $ wp transient set sample_key "test data" 3600 + Success: Transient added. + + + diff --git a/commands/transient/type/index.md b/commands/transient/type/index.md index 9914fb9e..5a0fa7d2 100644 --- a/commands/transient/type/index.md +++ b/commands/transient/type/index.md @@ -1,4 +1,21 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/transient/type/ ---- \ No newline at end of file +layout: default +title: 'wp transient type' +display_global_parameters: true +--- + +[Commands](/commands/) » [transient](/commands/transient/) » type + +`wp transient type` - See whether the transients API is using an object cache or the options table. + +Quick links: Github issues + +
+ +### EXAMPLES + + $ wp transient type + Transients are saved to the wp_options table. + + + diff --git a/commands/user/add-cap/index.md b/commands/user/add-cap/index.md index da5f3867..94a6bb70 100644 --- a/commands/user/add-cap/index.md +++ b/commands/user/add-cap/index.md @@ -1,4 +1,34 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/add-cap/ ---- \ No newline at end of file +layout: default +title: 'wp user add-cap' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » add-cap + +`wp user add-cap` - Add a capability for a user. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or user login. + +<cap> +: The capability to add. + +### EXAMPLES + + # Add a capability for a user + $ wp user add-cap john create_premium_item + Success: Added 'create_premium_item' capability for john (16). + + # Add a capability for a user + $ wp user add-cap 15 edit_product + Success: Added 'edit_product' capability for johndoe (15). + + + diff --git a/commands/user/add-role/index.md b/commands/user/add-role/index.md index 36ade048..9cc45321 100644 --- a/commands/user/add-role/index.md +++ b/commands/user/add-role/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/add-role/ ---- \ No newline at end of file +layout: default +title: 'wp user add-role' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » add-role + +`wp user add-role` - Add a role for a user. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or user login. + +<role> +: Add the specified role to the user. + +### EXAMPLES + + $ wp user add-role 12 author + Success: Added 'author' role for johndoe (12). + + + diff --git a/commands/user/create/index.md b/commands/user/create/index.md index 7dbd1471..19a4ded2 100644 --- a/commands/user/create/index.md +++ b/commands/user/create/index.md @@ -1,4 +1,55 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/create/ ---- \ No newline at end of file +layout: default +title: 'wp user create' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » create + +`wp user create` - Create a user. + +Quick links: Github issues + +
+ +### 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. + +[\--first_name=<first_name>] +: The user's first name. + +[\--last_name=<last_name>] +: The user's last name. + +[\--send-email] +: Send an email to the user with their new account details. + +[\--porcelain] +: Output just the new user id. + +### EXAMPLES + + # Create user + $ wp user create bob bob@example.com --role=author + Success: Created user 3. + Password: k9**&I4vNH(& + + + diff --git a/commands/user/delete/index.md b/commands/user/delete/index.md index 806726e1..93f27da4 100644 --- a/commands/user/delete/index.md +++ b/commands/user/delete/index.md @@ -1,4 +1,41 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/delete/ ---- \ No newline at end of file +layout: default +title: 'wp user delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » delete + +`wp user delete` - Delete one or more users from the current site. + +Quick links: Github issues + +
+ +### OPTIONS + +<user>... +: The user login, user email, or user ID of the user(s) to delete. + +[\--network] +: On multisite, delete the user from the entire network. + +[\--reassign=<user-id>] +: User ID to reassign the posts to. + +[\--yes] +: Answer yes to any confirmation prompts. + +### EXAMPLES + + # Delete user 123 and reassign posts to user 567 + $ wp user delete 123 --reassign=567 + Success: Removed user 123 from http://example.com + + # Delete all contributors and reassign their posts to user 2 + $ wp user delete $(wp user list --role=contributor --format=ids) --reassign=2 + Success: Removed user 813 from http://example.com + Success: Removed user 578 from http://example.com + + + diff --git a/commands/user/generate/index.md b/commands/user/generate/index.md index 947db510..7209dc4e 100644 --- a/commands/user/generate/index.md +++ b/commands/user/generate/index.md @@ -1,4 +1,35 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/generate/ ---- \ No newline at end of file +layout: default +title: 'wp user generate' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » generate + +`wp user generate` - Generate users. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--count=<number>] +: How many users to generate. Default: 100 + +[\--role=<role>] +: The role of the generated users. Default: default role from WP + +[\--format=<format>] +: Accepted values: progress, ids. Default: ids. + +### EXAMPLES + + # Add meta to every generated user + $ wp user generate --format=ids --count=3 | xargs -0 -d ' ' -I % wp user meta add % foo bar + Success: Added custom field. + Success: Added custom field. + Success: Added custom field. + + + diff --git a/commands/user/get/index.md b/commands/user/get/index.md index 00539b88..b5c55efa 100644 --- a/commands/user/get/index.md +++ b/commands/user/get/index.md @@ -1,4 +1,39 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/get/ ---- \ No newline at end of file +layout: default +title: 'wp user get' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » get + +`wp user get` - Get a single user. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or user login. + +[\--field=<field>] +: Instead of returning the whole user, returns the value of a single field. + +[\--fields=<fields>] +: Get a specific subset of the user's fields. + +[\--format=<format>] +: Accepted values: table, json, csv, yaml. Default: table + +### EXAMPLES + + # Get user + $ wp user get 12 --field=login + supervisor + + # Get user and export to JSON file + $ wp user get bob --format=json > bob.json + + + diff --git a/commands/user/import-csv/index.md b/commands/user/import-csv/index.md index 49624d39..4b25cae3 100644 --- a/commands/user/import-csv/index.md +++ b/commands/user/import-csv/index.md @@ -1,4 +1,45 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/import-csv/ ---- \ No newline at end of file +layout: default +title: 'wp user import-csv' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » import-csv + +`wp user import-csv` - Import users from a CSV file. + +Quick links: Github issues + +
+ +### OPTIONS + +<file> +: The local or remote CSV file of users to import. + +[\--send-email] +: Send an email to new users with their account details. + +[\--skip-update] +: Don't update users that already exist. + +### EXAMPLES + + # Import users from local CSV file + $ wp user import-csv /path/to/users.csv + Success: bobjones created + Success: newuser1 created + Success: existinguser created + + # Import users from remote CSV file + $ wp user import-csv http://example.com/users.csv + + Sample users.csv file: + + user_login,user_email,display_name,role + bobjones,bobjones@example.com,Bob Jones,contributor + newuser1,newuser1@example.com,New User,author + existinguser,existinguser@example.com,Existing User,administrator + + + diff --git a/commands/user/index.md b/commands/user/index.md index 4a796672..c9c4eed4 100644 --- a/commands/user/index.md +++ b/commands/user/index.md @@ -1,4 +1,107 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/ ---- \ No newline at end of file +layout: default +title: 'wp user' +display_global_parameters: true +--- + +[Commands](/commands/) » user + +`wp user` - Manage users. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List user IDs + $ wp user list --field=ID + 1 + + # Create user + $ wp user create bob bob@example.com --role=author + Success: Created user 3. + Password: k9**&I4vNH(& + + # Update user + $ wp user update 123 --display_name=Mary --user_pass=marypass + Success: Updated user 123. + + # Delete user 123 and reassign posts to user 567 + $ wp user delete 123 --reassign=567 + Success: Removed user 123 from http://example.com + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
add-capAdd a capability for a user.
add-roleAdd a role for a user.
createCreate a user.
deleteDelete one or more users from the current site.
generateGenerate users.
getGet a single user.
import-csvImport users from a CSV file.
listList users.
list-capsList all user's capabilities.
metaManage user custom fields.
remove-capRemove a user's capability.
remove-roleRemove a user's role.
set-roleSet the user role (for a particular blog).
termManage user terms.
updateUpdate a user.
diff --git a/commands/user/list-caps/index.md b/commands/user/list-caps/index.md index 26e8b1d2..0e266d01 100644 --- a/commands/user/list-caps/index.md +++ b/commands/user/list-caps/index.md @@ -1,4 +1,40 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/list-caps/ ---- \ No newline at end of file +layout: default +title: 'wp user list-caps' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » list-caps + +`wp user list-caps` - List all user's capabilities. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or login. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: list +options: + - list + - table + - csv + - json + - count + - yaml +\--- + +### EXAMPLES + + $ wp user list-caps 21 + edit_product + create_premium_item + + + diff --git a/commands/user/list/index.md b/commands/user/list/index.md index cf171af0..2c7aca7c 100644 --- a/commands/user/list/index.md +++ b/commands/user/list/index.md @@ -1,4 +1,76 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/list/ ---- \ No newline at end of file +layout: default +title: 'wp user list' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » list + +`wp user list` - List users. + +Quick links: Github issues + +
+ +### OPTIONS + +[\--role=<role>] +: Only display users with a certain role. + +[\--<field>=<value>] +: Control output by one or more arguments of get_users(). + +[\--network] +: List all users in the network for multisite. + +[\--field=<field>] +: Prints the value of a single field for each user. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Accepted values: table, csv, json, count, yaml. Default: table + +### AVAILABLE FIELDS + +These fields will be displayed by default for each user: + +* ID +* user_login +* display_name +* user_email +* user_registered +* roles + +These fields are optionally available: + +* user_pass +* user_nicename +* user_url +* user_activation_key +* user_status +* spam +* deleted +* caps +* cap_key +* allcaps +* filter + +### EXAMPLES + + # List user IDs + $ wp user list --field=ID + 1 + + # List users with administrator role + $ wp user list --role=administrator --format=csv + ID,user_login,display_name,user_email,user_registered,roles + 1,supervisor,supervisor,supervisor@gmail.com,"2016-06-03 04:37:00",administrator + + # List users with only given fields + $ wp user list --fields=display_name,user_email --format=json + [{"display_name":"supervisor","user_email":"supervisor@gmail.com"}] + + + diff --git a/commands/user/meta/add/index.md b/commands/user/meta/add/index.md index fd972561..c3dfbb24 100644 --- a/commands/user/meta/add/index.md +++ b/commands/user/meta/add/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/meta/add/ ---- \ No newline at end of file +layout: default +title: 'wp user meta add' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [meta](/commands/user/meta/) » add + +`wp user meta add` - Add a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: The user login, user email, or user ID of the user to add metadata for. + +<key> +: The metadata key. + +<value> +: The new metadata value. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + +### EXAMPLES + + # Add user meta + $ wp user meta add 123 bio "Mary is an WordPress developer." + Success: Added custom field. + + + diff --git a/commands/user/meta/delete/index.md b/commands/user/meta/delete/index.md index e6577e1b..195c07b9 100644 --- a/commands/user/meta/delete/index.md +++ b/commands/user/meta/delete/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/meta/delete/ ---- \ No newline at end of file +layout: default +title: 'wp user meta delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [meta](/commands/user/meta/) » delete + +`wp user meta delete` - Delete a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: The user login, user email, or user ID of the user to delete metadata from. + +<key> +: The metadata key. + +[<value>] +: The value to delete. If omitted, all rows with key will deleted. + +### EXAMPLES + + # Delete user meta + $ wp user meta delete 123 bio + Success: Deleted custom field. + + + diff --git a/commands/user/meta/get/index.md b/commands/user/meta/get/index.md index 4529e883..5894d062 100644 --- a/commands/user/meta/get/index.md +++ b/commands/user/meta/get/index.md @@ -1,4 +1,33 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/meta/get/ ---- \ No newline at end of file +layout: default +title: 'wp user meta get' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [meta](/commands/user/meta/) » get + +`wp user meta get` - Get meta field value. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: The user login, user email, or user ID of the user to get metadata for. + +<key> +: The metadata key. + +[\--format=<format>] +: Accepted values: table, json, yaml. Default: table + +### EXAMPLES + + # Get user meta + $ wp user meta get 123 bio + Mary is an WordPress developer. + + + diff --git a/commands/user/meta/index.md b/commands/user/meta/index.md index 3998b2d0..6c6fdba4 100644 --- a/commands/user/meta/index.md +++ b/commands/user/meta/index.md @@ -1,4 +1,74 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/meta/ ---- \ No newline at end of file +layout: default +title: 'wp user meta' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » meta + +`wp user meta` - Manage user custom fields. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Add user meta + $ wp user meta add 123 bio "Mary is an WordPress developer." + Success: Added custom field. + + # List user meta + $ wp user meta list 123 --keys=nickname,description,wp_capabilities + +---------+-----------------+--------------------------------+ + | user_id | meta_key | meta_value | + +---------+-----------------+--------------------------------+ + | 123 | nickname | supervisor | + | 123 | description | Mary is a WordPress developer. | + | 123 | wp_capabilities | {"administrator":true} | + +---------+-----------------+--------------------------------+ + + # Update user meta + $ wp user meta update 123 bio "Mary is an awesome WordPress developer." + Success: Updated custom field 'bio'. + + # Delete user meta + $ wp user meta delete 123 bio + Success: Deleted custom field. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a meta field.
deleteDelete a meta field.
getGet meta field value.
listList all metadata associated with a user.
updateUpdate a meta field.
diff --git a/commands/user/meta/list/index.md b/commands/user/meta/list/index.md index 4191b53a..f84f144a 100644 --- a/commands/user/meta/list/index.md +++ b/commands/user/meta/list/index.md @@ -1,4 +1,42 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/meta/list/ ---- \ No newline at end of file +layout: default +title: 'wp user meta list' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [meta](/commands/user/meta/) » list + +`wp user meta list` - List all metadata associated with a user. + +Quick links: Github issues + +
+ +### OPTIONS + +<id> +: ID for the object. + +[\--keys=<keys>] +: Limit output to metadata of specific keys. + +[\--fields=<fields>] +: Limit the output to specific row fields. Defaults to id,meta_key,meta_value. + +[\--format=<format>] +: Accepted values: table, csv, json, count. Default: table + +### EXAMPLES + + # List user meta + $ wp user meta list 123 --keys=nickname,description,wp_capabilities + +---------+-----------------+--------------------------------+ + | user_id | meta_key | meta_value | + +---------+-----------------+--------------------------------+ + | 123 | nickname | supervisor | + | 123 | description | Mary is a WordPress developer. | + | 123 | wp_capabilities | {"administrator":true} | + +---------+-----------------+--------------------------------+ + + + diff --git a/commands/user/meta/update/index.md b/commands/user/meta/update/index.md index 35533144..fe7dc68a 100644 --- a/commands/user/meta/update/index.md +++ b/commands/user/meta/update/index.md @@ -1,4 +1,36 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/meta/update/ ---- \ No newline at end of file +layout: default +title: 'wp user meta update' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [meta](/commands/user/meta/) » update + +`wp user meta update` - Update a meta field. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: The user login, user email, or user ID of the user to update metadata for. + +<key> +: The metadata key. + +<value> +: The new metadata value. + +[\--format=<format>] +: The serialization format for the value. Default is plaintext. + +### EXAMPLES + + # Update user meta + $ wp user meta update 123 bio "Mary is an awesome WordPress developer." + Success: Updated custom field 'bio'. + + + diff --git a/commands/user/remove-cap/index.md b/commands/user/remove-cap/index.md index ab1faead..d5999b50 100644 --- a/commands/user/remove-cap/index.md +++ b/commands/user/remove-cap/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/remove-cap/ ---- \ No newline at end of file +layout: default +title: 'wp user remove-cap' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » remove-cap + +`wp user remove-cap` - Remove a user's capability. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or user login. + +<cap> +: The capability to be removed. + +### EXAMPLES + + $ wp user remove-cap 11 publish_newsletters + Success: Removed 'publish_newsletters' cap for supervisor (11). + + + diff --git a/commands/user/remove-role/index.md b/commands/user/remove-role/index.md index e5e03675..c273039f 100644 --- a/commands/user/remove-role/index.md +++ b/commands/user/remove-role/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/remove-role/ ---- \ No newline at end of file +layout: default +title: 'wp user remove-role' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » remove-role + +`wp user remove-role` - Remove a user's role. + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or user login. + +[<role>] +: A specific role to remove. + +### EXAMPLES + + $ wp user remove-role 12 author + Success: Removed 'author' role for johndoe (12). + + + diff --git a/commands/user/session/destroy/index.md b/commands/user/session/destroy/index.md deleted file mode 100644 index e9b02858..00000000 --- a/commands/user/session/destroy/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/session/destroy/ ---- \ No newline at end of file diff --git a/commands/user/session/index.md b/commands/user/session/index.md deleted file mode 100644 index 042918fb..00000000 --- a/commands/user/session/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/session/ ---- \ No newline at end of file diff --git a/commands/user/session/list/index.md b/commands/user/session/list/index.md deleted file mode 100644 index cf3718a7..00000000 --- a/commands/user/session/list/index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/session/list/ ---- \ No newline at end of file diff --git a/commands/user/set-role/index.md b/commands/user/set-role/index.md index 91ae263c..73a7a7e0 100644 --- a/commands/user/set-role/index.md +++ b/commands/user/set-role/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/set-role/ ---- \ No newline at end of file +layout: default +title: 'wp user set-role' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » set-role + +`wp user set-role` - Set the user role (for a particular blog). + +Quick links: Github issues + +
+ +### OPTIONS + +<user> +: User ID, user email, or user login. + +[<role>] +: Make the user have the specified role. If not passed, the default role is +used. + +### EXAMPLES + + $ wp user set-role 12 author + Success: Added johndoe (12) to http://example.com as author. + + + diff --git a/commands/user/term/add/index.md b/commands/user/term/add/index.md index 2d30ee79..49e76f95 100644 --- a/commands/user/term/add/index.md +++ b/commands/user/term/add/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/term/add/ ---- \ No newline at end of file +layout: default +title: 'wp user term add' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [term](/commands/user/term/) » add + +`wp user term add` - Add a term. Appends to existing set of terms on the object. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<taxonomy> +: The name of the taxonomy type to be added. + +<term>... +: The slug of the term or terms to be added. + + + diff --git a/commands/user/term/index.md b/commands/user/term/index.md index 475e9bfb..16b65338 100644 --- a/commands/user/term/index.md +++ b/commands/user/term/index.md @@ -1,4 +1,52 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/term/ ---- \ No newline at end of file +layout: default +title: 'wp user term' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » term + +`wp user term` - Manage user terms. + +Quick links: Github issues + +
+ +### EXAMPLES + + # Set user terms + $ wp user term set 123 test category + Set terms. + + + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a term. Appends to existing set of terms on the object.
listList all terms associated with an object.
removeRemove a term.
setSet terms. Replaces existing terms on the object.
diff --git a/commands/user/term/list/index.md b/commands/user/term/list/index.md index 478e0df0..d0b19e68 100644 --- a/commands/user/term/list/index.md +++ b/commands/user/term/list/index.md @@ -1,4 +1,45 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/term/list/ ---- \ No newline at end of file +layout: default +title: 'wp user term list' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [term](/commands/user/term/) » list + +`wp user term list` - List all terms associated with an object. + +Quick links: Github issues + +
+ +<id> +: ID for the object. + +<taxonomy>... +: One or more taxonomies to list. + +[\--fields=<fields>] +: Limit the output to specific row fields. + +[\--format=<format>] +: Accepted values: table, csv, json, count, ids. Default: table + +### AVAILABLE FIELDS + +These fields will be displayed by default for each term: + +* term_id +* name +* slug +* taxonomy + +These fields are optionally available: + +* term_taxonomy_id +* description +* term_group +* parent +* count + + + diff --git a/commands/user/term/remove/index.md b/commands/user/term/remove/index.md index eea3816c..5b033908 100644 --- a/commands/user/term/remove/index.md +++ b/commands/user/term/remove/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/term/remove/ ---- \ No newline at end of file +layout: default +title: 'wp user term remove' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [term](/commands/user/term/) » remove + +`wp user term remove` - Remove a term. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<taxonomy> +: The name of the taxonomy type to deleted. + +<term>... +: The name of the term or terms to deleted. + + + diff --git a/commands/user/term/set/index.md b/commands/user/term/set/index.md index 6071bdac..a4269a17 100644 --- a/commands/user/term/set/index.md +++ b/commands/user/term/set/index.md @@ -1,4 +1,25 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/term/set/ ---- \ No newline at end of file +layout: default +title: 'wp user term set' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » [term](/commands/user/term/) » set + +`wp user term set` - Set terms. Replaces existing terms on the object. + +Quick links: Github issues + +
+ +<id> +: The ID of the object. + +<taxonomy> +: The name of the taxonomy type to be updated. + +<term>... +: The slug of the term or terms to be updated. + + + diff --git a/commands/user/update/index.md b/commands/user/update/index.md index 5bacc5d5..f6310d44 100644 --- a/commands/user/update/index.md +++ b/commands/user/update/index.md @@ -1,4 +1,30 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/user/update/ ---- \ No newline at end of file +layout: default +title: 'wp user update' +display_global_parameters: true +--- + +[Commands](/commands/) » [user](/commands/user/) » update + +`wp user update` - Update a user. + +Quick links: Github issues + +
+ +### OPTIONS + +<user>... +: The user login, user email or user ID of the user(s) to update. + +\--<field>=<value> +: One or more fields to update. For accepted fields, see wp_update_user(). + +### EXAMPLES + + # Update user + $ wp user update 123 --display_name=Mary --user_pass=marypass + Success: Updated user 123. + + + diff --git a/commands/widget/add/index.md b/commands/widget/add/index.md index 6ba31d44..8123b7ac 100644 --- a/commands/widget/add/index.md +++ b/commands/widget/add/index.md @@ -1,4 +1,35 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/add/ ---- \ No newline at end of file +layout: default +title: 'wp widget add' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » add + +`wp widget add` - Add a widget to a sidebar. + +Quick links: Github issues + +
+ +### OPTIONS + +<name> +: Widget name. + +<sidebar-id> +: ID for the corresponding sidebar. + +[<position>] +: Widget's current position within the sidebar. Defaults to last + +[\--<field>=<value>] +: Widget option to add, with its new value + +### EXAMPLES + + $ wp widget add calendar sidebar-1 2 --title="Calendar" + Success: Added widget to sidebar. + + + diff --git a/commands/widget/deactivate/index.md b/commands/widget/deactivate/index.md index 6e100687..a9a2ab8e 100644 --- a/commands/widget/deactivate/index.md +++ b/commands/widget/deactivate/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/deactivate/ ---- \ No newline at end of file +layout: default +title: 'wp widget deactivate' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » deactivate + +`wp widget deactivate` - Deactivate one or more widgets from an active sidebar. + +Quick links: Github issues + +
+ +### OPTIONS + +<widget-id>... +: Unique ID for the widget(s) + +### EXAMPLES + + $ wp widget deactivate recent-comments-2 + Success: Widget(s) deactivated. + + + diff --git a/commands/widget/delete/index.md b/commands/widget/delete/index.md index 150dbfbf..a4727eab 100644 --- a/commands/widget/delete/index.md +++ b/commands/widget/delete/index.md @@ -1,4 +1,26 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/delete/ ---- \ No newline at end of file +layout: default +title: 'wp widget delete' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » delete + +`wp widget delete` - Delete one or more widgets from a sidebar. + +Quick links: Github issues + +
+ +### OPTIONS + +<widget-id>... +: Unique ID for the widget(s) + +### EXAMPLES + + $ wp widget delete recent-comments-2 + Success: Widget(s) removed from sidebar. + + + diff --git a/commands/widget/index.md b/commands/widget/index.md index dc0c96f4..5d7ab5e9 100644 --- a/commands/widget/index.md +++ b/commands/widget/index.md @@ -1,4 +1,79 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/ ---- \ No newline at end of file +layout: default +title: 'wp widget' +display_global_parameters: true +--- + +[Commands](/commands/) » widget + +`wp widget` - Manage sidebar widgets. + +Quick links: Github issues + +
+ +### EXAMPLES + + # List widgets on a given sidebar + $ wp widget list sidebar-1 + +----------+------------+----------+----------------------+ + | name | id | position | options | + +----------+------------+----------+----------------------+ + | meta | meta-6 | 1 | {"title":"Meta"} | + | calendar | calendar-2 | 2 | {"title":"Calendar"} | + +----------+------------+----------+----------------------+ + + # Add a calendar widget to the second position on the sidebar + $ wp widget add calendar sidebar-1 2 + Success: Added widget to sidebar. + + # Update option(s) associated with a given widget + $ wp widget update calendar-1 --title="Calendar" + Success: Widget updated. + + # Delete one or more widgets entirely + $ wp widget delete calendar-2 archive-1 + Success: Widget(s) removed from sidebar. + + + +### SUBCOMMANDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
addAdd a widget to a sidebar.
deactivateDeactivate one or more widgets from an active sidebar.
deleteDelete one or more widgets from a sidebar.
listList widgets associated with a sidebar.
moveMove a widget from one position on a sidebar to another.
resetReset sidebar.
updateUpdate a given widget's options.
diff --git a/commands/widget/list/index.md b/commands/widget/list/index.md index de12b972..f56f455e 100644 --- a/commands/widget/list/index.md +++ b/commands/widget/list/index.md @@ -1,4 +1,55 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/list/ ---- \ No newline at end of file +layout: default +title: 'wp widget list' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » list + +`wp widget list` - List widgets associated with a sidebar. + +Quick links: Github issues + +
+ +### OPTIONS + +<sidebar-id> +: ID for the corresponding sidebar. + +[\--fields=<fields>] +: Limit the output to specific object fields. + +[\--format=<format>] +: Render output in a particular format. +\--- +default: table +options: + - table + - csv + - ids + - json + - count + - yaml +\--- + +### AVAILABLE FIELDS + +These fields will be displayed by default for each widget: + +* name +* id +* position +* options + +There are no optionally available fields. + +### EXAMPLES + + $ wp widget list sidebar-1 --fields=name,id --format=csv + name,id + meta,meta-5 + search,search-3 + + + diff --git a/commands/widget/move/index.md b/commands/widget/move/index.md index 54233007..687fd12d 100644 --- a/commands/widget/move/index.md +++ b/commands/widget/move/index.md @@ -1,4 +1,37 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/move/ ---- \ No newline at end of file +layout: default +title: 'wp widget move' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » move + +`wp widget move` - Move a widget from one position on a sidebar to another. + +Quick links: Github issues + +
+ +### OPTIONS + +<widget-id> +: Unique ID for the widget + +[\--position=<position>] +: Assign the widget to a new position. + +[\--sidebar-id=<sidebar-id>] +: Assign the widget to a new sidebar + +### EXAMPLES + + # Change position of widget + $ wp widget move recent-comments-2 --position=2 + Success: Widget moved. + + # Move widget to Inactive Widgets + $ wp widget move recent-comments-2 --sidebar-id=wp_inactive_widgets + Success: Widget moved. + + + diff --git a/commands/widget/reset/index.md b/commands/widget/reset/index.md index afd346fd..43ebe40f 100644 --- a/commands/widget/reset/index.md +++ b/commands/widget/reset/index.md @@ -1,4 +1,43 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/reset/ ---- \ No newline at end of file +layout: default +title: 'wp widget reset' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » reset + +`wp widget reset` - Reset sidebar. + +Quick links: Github issues + +
+ +Removes all widgets from the sidebar and places them in Inactive Widgets. + +### OPTIONS + +[<sidebar-id>...] +: One or more sidebars to reset. + +[\--all] +: If set, all sidebars will be reset. + +### EXAMPLES + + # Reset a sidebar + $ wp widget reset sidebar-1 + Success: Sidebar 'sidebar-1' reset. + + # Reset multiple sidebars + $ wp widget reset sidebar-1 sidebar-2 + Success: Sidebar 'sidebar-1' reset. + Success: Sidebar 'sidebar-2' reset. + + # Reset all sidebars + $ wp widget reset --all + Success: Sidebar 'sidebar-1' reset. + Success: Sidebar 'sidebar-2' reset. + Success: Sidebar 'sidebar-3' reset. + + + diff --git a/commands/widget/update/index.md b/commands/widget/update/index.md index 5ec3a1df..01e544d0 100644 --- a/commands/widget/update/index.md +++ b/commands/widget/update/index.md @@ -1,4 +1,29 @@ --- -redirect_to: - - https://developer.wordpress.org/cli/commands/widget/update/ ---- \ No newline at end of file +layout: default +title: 'wp widget update' +display_global_parameters: true +--- + +[Commands](/commands/) » [widget](/commands/widget/) » update + +`wp widget update` - Update a given widget's options. + +Quick links: Github issues + +
+ +### OPTIONS + +<widget-id> +: Unique ID for the widget + +[\--<field>=<value>] +: Field to update, with its new value + +### EXAMPLES + + $ wp widget update calendar-1 --title="Our Calendar" + Success: Widget updated. + + + diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..1fd2cd34 --- /dev/null +++ b/composer.json @@ -0,0 +1,6 @@ +{ + "require-dev": { + "jaz303/phake": "0.5.1", + "mustache/mustache": "~2.4" + } +} diff --git a/config/index.md b/config/index.md new file mode 100644 index 00000000..e3f316fa --- /dev/null +++ b/config/index.md @@ -0,0 +1,123 @@ +--- +layout: default +title: Configuration +--- + +# Configuration + +

Quick links: Overview | Global parameters | Config files | Environment variables

+ +## Overview + +WP-CLI has a series of global parameters (e.g. `--path=` and `--user=`) which work with all commands. They are called *global parameters* because they affect how WP-CLI interacts with WordPress, and have the same behavior across all commands. + +``` +# `--user=` sets request to a specific WordPress user +$ wp --user=wpcli eval 'echo wp_get_current_user()->user_email;' +wpcli@example.com +``` + +For repeated usage, WP-CLI can also read options from a YAML configuration file (e.g. `wp-cli.yml`). These configuration files enable specifying default values for both global parameters and subcommand-specific arguments. + +``` +# WordPress develop includes a `wp-cli.yml` to enable easy use of WP-CLI +$ pwd +/srv/www/wordpress-develop.dev +$ cat wp-cli.yml +path: src/ +``` + +Arguments are interpreted following an order of precedence, from highest priority to lowest: + +1. Command-line arguments. +1. `wp-cli.local.yml` file inside the current working directory (or upwards). +1. `wp-cli.yml` file inside the current working directory (or upwards). +1. `~/.wp-cli/config.yml` file (path can be changed by setting the `WP_CLI_CONFIG_PATH` environment variable). +1. WP-CLI defaults. + +## Global parameters + +The table below lists the available arguments (specified on the command-line) and options (specified in the configuration file). + + + + + + + + + + + {% include param-list.html %} + +
DescriptionArgumentOption
+ +## Config files + +WP-CLI can read options from a few configuration file types (when present): + +1. `wp-cli.local.yml` file inside the current working directory (or upwards). +1. `wp-cli.yml` file inside the current working directory (or upwards). +1. `~/.wp-cli/config.yml` file (path can be changed by setting the `WP_CLI_CONFIG_PATH` environment variable). + +Besides the global parameters described above, configuration files can also contain defaults for any subcommand, as well as aliases to one or more WordPress installs. + +Here's an annotated example `wp-cli.yml` file: + + # Global parameter defaults + path: wp-core + url: http://example.com + user: admin + color: false + disabled_commands: + - db drop + - plugin install + require: + - path-to/command.php + + # Subcommand defaults (e.g. `wp core config`) + core config: + dbuser: root + dbpass: + extra-php: | + define( 'WP_DEBUG', true ); + define( 'WP_POST_REVISIONS', 50 ); + + # Aliases to other WordPress installs (e.g. `wp @staging rewrite flush`) + # An alias can include 'user', 'url', 'path', 'ssh', or 'http' + @staging: + ssh: wpcli@staging.wp-cli.org + user: wpcli + path: /srv/www/staging.wp-cli.org + @production: + ssh: wpcli@wp-cli.org:2222 + user: wpcli + path: /srv/www/wp-cli.org + + # '_' is a special value denoting configuration options for this wp-cli.yml + _: + # Merge subcommand defaults from the upstream config.yml, instead of overriding + merge: true + # Inherit configuration from an arbitrary YAML file + inherit: prod.yml + +## Environment variables + +WP-CLI's behavior can be changed at runtime through the use of environment variables: + +* `WP_CLI_CACHE_DIR` - Directory to store the WP-CLI file cache. Default is `~/.wp-cli/cache/`. +* `WP_CLI_CONFIG_PATH` - Path to the global `config.yml` file. Default is `~/.wp-cli/config.yml`. +* `WP_CLI_DISABLE_AUTO_CHECK_UPDATE` - Disable WP-CLI automatic checks for updates. +* `WP_CLI_PACKAGES_DIR` - Directory to store packages installed through WP-CLI's package management. Default is `~/.wp-cli/packages/`. +* `WP_CLI_SSH_PRE_CMD` - When using `--ssh=`, perform a command before WP-CLI calls WP-CLI on the remote server. +* `WP_CLI_STRICT_ARGS_MODE` - Avoid ambiguity by telling WP-CLI to treat any arguments before the command as global, and after the command as local. + +To set an environment variable on demand, simply place the environment variable definition before the WP-CLI command you mean to run. + + # Use vim to edit a post + $ EDITOR=vim wp post edit 1 + +To set the same environment variable value for every shell session, you’ll need to include the environment variable definition in your `~/.bashrc` or `~/.zshrc` file + + # Always use vim to edit a post + export EDITOR=vim diff --git a/de/index.md b/de/index.md index 0e845141..d530639a 100644 --- a/de/index.md +++ b/de/index.md @@ -1,228 +1,160 @@ -WP-CLI -====== +--- +layout: default +title: Kommandozeilen-Interface für WordPress +--- -[WP-CLI](https://wp-cli.org/) ist das Kommandozeilen-Werkzeug für [WordPress](https://de.wordpress.org/). Du kannst Plugins aktualisieren, Multisite-Installationen konfigurieren und vieles mehr, ohne einen Browser zu benutzen. +[WP-CLI](https://wp-cli.org/) ist eine Sammlung von Kommandozeilen-Tools zur Verwaltung von [WordPress](https://wordpress.org/) Installationen. Du kannst Plugins aktualisieren, Multisite Installationen konfigurieren und vieles mehr, ohne einen Browser zu verwenden. -Die laufende Pflege wird ermöglicht durch: +Um stets auf dem Laufenden zu bleiben, folge [@wpcli auf Twitter](https://twitter.com/wpcli) oder [abonniere den Newsletter](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). + +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Abhängigkeiten Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Durchschnittliche Zeit bis zur Lösung eines Issues](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Durchschnittliche Zeit bis zur Lösung eines Issues") [![Prozentsatz noch offener Issues](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Prozentsatz noch offener Issues")
- - Automattic - - - Bluehost - - - Pantheon - - - SiteGround - - - WP Engine - - - Cloudways - + border: 1px solid #7AD03A; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-left: 10px; + padding-right: 10px; +"> +

A more RESTful WP-CLI versucht das Potenzial der WP REST API auf der Kommandozeile auszuschöpfen. Das Projekt wird unterstützt von Pressed, Chris Lema, Human Made, Pagely, Pantheon und vielen mehr. Mehr erfahren →

-Das aktuelle stabile Release ist [Version 2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/) (engl.). Folge für Ankündigungen [@wpcli auf Twitter](https://twitter.com/wpcli) oder [registriere dich für Aktualisierungen per E-Mail](https://make.wordpress.org/cli/subscribe/) (engl.). [Sieh dir die Roadmap an](https://make.wordpress.org/cli/handbook/roadmap/) (engl.), um einen Überblick zu erhalten, was in zukünftigen Releases geplant ist. - -[![Testing](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Durchschnittliche Zeit, bis ein Problem behoben wurde](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Durchschnittliche Zeit, bis ein Problem behoben wurde") [![Prozentuale Anzahl an offenen Problemen](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Prozentuale Anzahl an offenen Problemen") - Quick links: [Benutzung](#benutzung) | [Installation](#installation) | [Support](#support) | [Erweitern](#erweitern) | [Mitwirken](#mitwirken) | [Credits](#credits) ## Benutzung -WP-CLI bietet eine Kommandozeilen-Benutzeroberfläche für viele Aktionen, die du eigentlich im WordPress-Administrationsbereich durchführst. `wp plugin install --activate` ([Dok.](https://developer.wordpress.org/cli/commands/plugin/install/)) lässt dich beispielsweise ein WordPress-Plugin installieren und aktivieren: +Das Ziel von WP-CLI ist es, für jede Aktion ein Kommandozeilen-Interface zur Verfügung zu stellen, die man auch über den Adminbereich ausführen kann. Mit `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) kann man zum Beispiel ein WordPress Plugin installieren und aktivieren: -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... +``` +$ wp plugin install rest-api --activate +Installing WordPress REST API (Version 2) (2.0-beta13) +Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. +Activating 'rest-api'... +Success: Plugin 'rest-api' activated. ``` -WP-CLI enthält auch Befehle für viele Dinge, die du im WordPress-Administrationsbereich nicht tun kannst. Mit `wp transient delete-all` ([Dok.](https://developer.wordpress.org/cli/commands/transient/delete/)) kannst du beispielsweise bestimmte oder alle Transients löschen: +WP-CLI enthält auch Befehle für viele Dinge, die man im Adminbereich nicht tun kann. Mit `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) kannst du z.B. bestimmte oder alle Transients löschen: -```bash -$ wp transient delete --all +``` +$ wp transient delete-all Success: 34 transients deleted from the database. ``` -Für eine umfassendere Einführung in die Benutzung von WP-CLI, lies am besten die [Schnellstartanleitung](https://make.wordpress.org/cli/handbook/quick-start/) (engl.), oder sieh dir [Shell-Freunde](https://make.wordpress.org/cli/handbook/shell-friends/) (engl.) an, um mehr über die Kommandozeilen-Helferlein zu erfahren. +Für eine umfassendere Einführung in die Benutzung von WP-CLI, lies am besten den [Quick Start guide](https://wp-cli.org/docs/quick-start/). -Bereits genug von den Basics? Sieh dir die [komplette Liste an Befehlen](https://developer.wordpress.org/cli/commands/) (engl.) für detailliertere Informationen zur Verwaltung von Themes und Plugins, Datenimport und -export, Suchen/Ersetzen-Operationen in der Datenbank und mehr an. +Bereits genug von den Basics? Sieh dir die [komplette Liste an Befehlen](https://wp-cli.org/commands/) an für detailliertere Informationen zur Verwaltung von Themes und Plugins, Datenimport und -export, Suchen/Ersetzen-Operationen in der Datenbank und mehr. ## Installation -Das Herunterladen der Phar Datei ist unsere empfohlene Installationsweise. Falls nötig, gibt es auch eine Dokumentation zu [alternativen Installationsmethoden](https://make.wordpress.org/cli/handbook/installing/) (engl.) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer) (engl.), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew) (engl.), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker) (engl.)). +Das Herunterladen der Phar Datei ist unsere empfohlene Installationsweise. Falls nötig, gibt es auch eine Dokumentation zu [alternativen Installationsmethoden](https://wp-cli.org/docs/installing/). Bevor du WP-CLI installierst, stell bitte sicher, dass dein System die Mindestanforderungen erfüllt: - UNIX-ähnliche Umgebung (OS X, Linux, FreeBSD, Cygwin); eingeschränkter Support in Windows-Umgebungen -- PHP 5.6 oder neuer -- WordPress 3.7 oder neuer. Ältere Versionen als das aktuelle WordPress-Release haben funktionelle Einschränkungen +- PHP 5.3.29 oder höher +- WordPress 3.7 oder höher -Sobald du die Mindestanforderungen geprüft hast, lade die [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar)-Datei mittels `wget` oder `curl` herunter: +Wenn du das erledigt hast, lade die [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) Datei mittels `wget` oder `curl` herunter: -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` +$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` -Prüfe als nächstes, ob die Phar-Datei funktioniert: +Prüfe als nächstes, ob es funktioniert: -```bash -php wp-cli.phar --info +``` +$ php wp-cli.phar --info ``` -Um WP-CLI auf der Kommandozeile durch blosses Eintippen von `wp` zu benutzen, mach die Datei ausführbar und verschiebe sie irgendwo hin innerhalb deines PATH. Zum Beispiel: +Um WP-CLI auf der Kommandozeile durch blosses Tippen von `wp` zu nutzen, mache die Datei ausführbar und verschiebe es irgendwo hin innerhalb deines PATH. Zum Beispiel: -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp +``` +$ chmod +x wp-cli.phar +$ sudo mv wp-cli.phar /usr/local/bin/wp ``` Wenn WP-CLI erfolgreich installiert wurde, solltest du bei der Ausführung von `wp --info` etwas wie hier sehen: -```bash +``` $ wp --info -OS: Linux 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 -Shell: /usr/bin/zsh -PHP binary: /usr/bin/php8.1 -PHP version: 8.1.0 -php.ini used: /etc/php/8.1/cli/php.ini -MySQL binary: /usr/bin/mysql -MySQL version: mysql Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) -SQL modes: -WP-CLI root dir: /home/wp-cli/ -WP-CLI vendor dir: /home/wp-cli/vendor -WP_CLI phar path: +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: -WP-CLI project config: /home/wp-cli/wp-cli.yml -WP-CLI version: 2.12.0 +WP-CLI global config: /home/wp-cli/.wp-cli/config.yml +WP-CLI project config: +WP-CLI version: 0.23.0 ``` ### Aktualisieren -Du kannst WP-CLI mittels `wp cli update` ([Dok.](https://developer.wordpress.org/cli/commands/cli/update/) (engl.)) aktualisieren oder indem du die obigen Installationsschritte wiederholst. - -Wenn WP-CLI dem root-Benutzer oder einem anderen Systembenutzer gehört, musst du `sudo wp cli update` ausführen. +Du kannst WP-CLI mittels `wp cli update` ([doc](https://wp-cli.org/commands/cli/update/)) aktualisieren oder indem du die obigen Installationsschritte wiederholst. -Lebst du gerne gefährlich? Führe `wp cli update --nightly` aus, um den letzten Nightly Build von WP-CLI zu benutzen. Der Nightly Build ist mehr oder weniger stabil genug für die Nutzung in deiner Entwicklungsumgebung und enthält jeweils die neusten und besten Funktionen von WP-CLI. +Lebst du gerne gefährlich? Führe `wp cli update --nightly` aus um den aktuellsten Nightly Build von WP-CLI zu nutzen. Der Nightly Build ist mehr oder weniger stabil genug für die Nutzung in deiner Entwicklungsumgebung und enthält jeweils die neusten und besten Features von WP-CLI. ### Tab-Vervollständigung -Für WP-CLI gibt es auch ein Skript zur Autovervollständigung von Befehlen für Bash und ZSH. Lade einfach die [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) herunter und referenziere sie in der `~/.bash_profile`-Datei: +Für WP-CLI gibt es auch ein Skript zur Autovervollständigung von Befehlen für Bash und ZSH. Lade einfach [wp-completion.bash](https://github.com/wp-cli/wp-cli/raw/master/utils/wp-completion.bash) herunter und referenziere es in der `~/.bash_profile` Datei: -```bash -source /ABSOLUTER/PFAD/ZUR/wp-completion.bash +``` +source /FULL/PATH/TO/wp-completion.bash ``` Vergiss nicht, danach `source ~/.bash_profile` auszuführen. -Wenn du zsh für deine Shell benutzt, musst du möglicherweise erst `bashcompinit` laden und starten, bevor du den `source`-Befehl nutzt. Füge das folgende in deine `.zshrc` ein: - -```bash -autoload bashcompinit -bashcompinit -source /ABSOLUTER/PFAD/ZUR/wp-completion.bash -``` - ## Support -Die Betreuer und Mitwirkenden hinter WP-CLI sind Freiwillige und haben nur begrenzt Zeit, um generelle Supportanfragen zu beantworten. Die [aktuelle Version von WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) (engl.) ist die einzig offizielle unterstützte Version. - -Prüfe zunächst, ob es bereits auf einer dieser Seiten eine Antwort auf deine Frage gibt: +Die Betreuer und Mitwirkenden hinter WP-CLI tun ihr bestes um schnellstmöglich auf neue Issues zu antworten. Um ihre Arbeit zu erleichtern, prüfe zunächst ob es bereits an einem dieser Orte eine Antwort auf deine Frage gibt: -- [Gängige Probleme und deren Lösungen](https://make.wordpress.org/cli/handbook/common-issues/) (engl.) -* [WP-CLI-Handbuch](https://make.wordpress.org/cli/handbook/) (engl.) -* [Offene oder geschlossene Probleme in der WP-CLI-GitHub-Organisation](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) (engl.) -* [Themen mit dem Tag 'WP-CLI' im WordPress.org-Supportforum](https://wordpress.org/support/topic-tag/wp-cli/) (engl.) -* [Fragen mit dem Tag 'WP-CLI' im WordPress-StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) (engl.) +- [Gängige Fehler und deren Lösungen](https://wp-cli.org/docs/common-issues/) +- [Best Practices beim Erstellen eines Bug Reports](https://wp-cli.org/docs/bug-reports/) +- [Dokumentationsportal](https://wp-cli.org/docs/) +- [Offene oder geschlossene Issues auf Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [WordPress StackExchange Foren](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -Wenn du auf keiner dieser Seiten eine Antwort findest, kannst du folgendes tun: +Wenn du deine Antwort auf keiner dieser Seiten finden kannst, [erstelle ein Issue](https://github.com/wp-cli/wp-cli/issues/new) mit deiner Frage. -* Tritt dem `#cli`-Kanal im [WordPress.org Slack](https://make.wordpress.org/chat/) (engl.) bei, um mit jemandem zu chatten, der gerade da ist. Das ist die beste Möglichkeit für kleine Fragen. -* [Erstelle ein neues Thema](https://wordpress.org/support/forum/wp-advanced/#new-post) (engl.) im WordPress.org-Supportforum und füge den Tag 'WP-CLI' hinzu, sodass die Community es sieht. - -GitHub Issues sind nur für das Verwalten von Erweiterungen und Bugs existierender Befehle gedacht, nicht für allgemeinen Support. Sieh dir [unsere Best Practices](https://make.wordpress.org/cli/handbook/bug-reports/) (engl.) an, bevor du einen Fehler meldest, damit dein Issue in angemessener Zeit bearbeitet werden kann. - -Bitte stell keine Supportfragen auf Twitter. Twitter ist kein akzeptabler Ort für Support weil: 1) es ist schwierig Konversationen unter 280 Zeichen zu führen und 2) Twitter ist kein Ort, an dem jemand mit der gleichen Frage frühere Antworten in einer Konversation finden kann. - -Denk daran, frei != gratis. Die Open-Source-Lizenz garantiert dir die Freiheit zur Nutzung und Bearbeitung, aber nicht anderer Leute Zeit. Bitte sei respektvoll und setze deine Erwartungen dementsprechend. +Falls du einen WordPress.org Account hast, ziehe in Erwägung dem `#cli` Channel des [WordPress.org Slack Teams](https://make.wordpress.org/chat/) beizutreten. ## Erweitern -Ein **Befehl** ist die atomare Einheit der WP-CLI Funktionalität. `wp plugin install` ([Dok.](https://developer.wordpress.org/cli/commands/plugin/install/) (engl.)) ist ein Befehl. `wp plugin activate` ([Dok.](https://developer.wordpress.org/cli/commands/plugin/activate/) (engl.)) ist ein anderer. - -WP-CLI unterstützt das Registrieren jeder aufrufbaren Klasse, Funktion oder Closure als Befehl. Es liest die Informationen zur Nutzung aus der PHPdoc des Callbacks aus. `WP_CLI::add_command()` ([Dok.](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/) (engl.)) wird sowohl für die Registrierung interner als auch für Befehle von Dritten verwendet. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` +Ein **Befehl** ist die atomare Einheit der WP-CLI Funktionalität. `wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) ist ein solcher Befehl. `wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) ein anderer. -WP-CLI enthält Dutzende Befehle. Es ist auch einfacher, als es aussieht, eigene Befehle zu erstellen. Lies dazu das [Befehle-Kochbuch](https://make.wordpress.org/cli/handbook/commands-cookbook/) (engl.), um mehr zu erfahren. Stöbere in der [internen API-Dokumentation](https://make.wordpress.org/cli/handbook/internal-api/) (engl.), um eine Vielzahl hilfreicher Funktionen zu entdecken, die du in deinem eigenen WP-CLI Befehl benutzen kannst. +WP-CLI enthält Dutzende Befehle. Es ist auch sehr einfach eigene Befehle zu erstellen. Lies dazu das [Commands Cookbook](https://wp-cli.org/docs/commands-cookbook/) um mehr zu erfahren. Stöbere in der [internen API-Dokumentation](https://wp-cli.org/docs/internal-api/) um eine Vielzahl hilfreicher Funktionen zu entdecken, welche du in deinem eigenen WP-CLI Befehl nutzen kannst. ## Mitwirken -Wir schätzen es sehr, dass du interessiert bist, an WP-CLI mitzuwirken. Nur wegen dir und der Community um dich herum ist WP-CLI so ein tolles Projekt. +Willkommen und danke! + +Wir schätzen es sehr, dass du interessiert bist an WP-CLI mitzuwirken. Nur wegen dir und der Community um dich herum ist WP-CLI so ein tolles Projekt. -**Mitwirken beschränkt sich nicht nur auf’s Programmieren.** Wir möchten dich dazu ermutigen, das beizutragen, was du am besten kannst. Sei es durch das Schreiben von Tutorials, das Vorstellen von WP-CLI bei einem lokalen Meetup, anderen Nutzern bei ihren Supportfragen zu helfen oder unsere Dokumentation zu pflegen. +**Mitwirken beschränkt sich nicht nur aufs Programmieren.** Wir möchten dich dazu ermutigen, das beizutragen, was du am besten kannst. Sei es durch das Schreiben von Tutorials, das Vorstellen von WP-CLI an einem lokalen Meetup, anderen Nutzern bei ihren Supportfragen zu helfen oder unsere Dokumentation zu pflegen. -Lies unsere [Guidelines im Handbuch](https://make.wordpress.org/cli/handbook/contributing/) (engl.), um eine Einführung zu bekommen, wie du mitwirken kannst. Das Einhalten dieser Guidelines zeigt, dass du die Zeit respektierst, die andere in dieses Projekt investieren. Im Gegensatz werden andere Betreuer rund um den Globus diesen Respekt erwidern. +Nimm dir bitte einen Moment Zeit um [unsere Guidelines in Ruhe durchzulesen](https://wp-cli.org/docs/contributing/). Das Einhalten dieser Guidelines zeigt, dass du die Zeit respektierst, welche andere in dieses Projekt investieren. Im Gegensatz werden andere Betreuer rund um den Globus diesen Respekt erwidern. ## Projektleitung -WP-CLI hat einen Projektbetreuer: [schlessera](https://github.com/schlessera) (engl.). +WP-CLI wird von folgenden Personen geleitet: -Gelegentlich [vergeben wir Schreibzugriff an Mitwirkende](https://make.wordpress.org/cli/handbook/committers-credo/), die über längere Zeit gezeigt haben, dass sie in der Lage sind, in das Projekt zu investieren und es voranzubringen. +* [Daniel Bachhuber](https://github.com/danielbachhuber/) - aktueller Betreuer +* [Cristi Burcă](https://github.com/scribu) - vorheriger Betreuer +* [Andreas Creten](https://github.com/andreascreten) - Gründer -Lies dir das [Verwaltungsdokument im Handbuch](https://make.wordpress.org/cli/handbook/governance/) (engl.) für mehr operative Informationen bezüglich dieses Projekts durch. +Lies mehr über die [Projektstruktur](https://wp-cli.org/docs/governance/) und schau dir die [komplette Liste von Mitwirkenden](https://github.com/wp-cli/wp-cli/contributors) an. ## Credits -Neben den Bibliotheken, die in der [composer.json](composer.json)-Datei erwähnt werden, benutzen wir Code oder Ideen von folgenden Projekten: +Neben den Bibliotheken, die in der [composer.json](composer.json) Datei erwähnt werden, nutzen wir Code oder Ideen von folgenden Projekten: -* [Drush](https://github.com/drush-ops/drush) (engl.) für… viele Dinge -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) (engl.) für `wp shell` -* [Regenerate Thumbnails](https://de.wordpress.org/plugins/regenerate-thumbnails/) für `wp media regenerate` -* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) (engl.) für `wp search-replace` -* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) (engl.) für `wp export` -* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) (engl.) für `wp import` -* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) (engl.) für `wp scaffold plugin-tests` +* [Drush](http://drush.ws/) für... viele Dinge +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) für `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) für `wp media regenerate` +* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) für `wp search-replace` +* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) für `wp export` +* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) für `wp import` +* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) für `wp scaffold plugin-tests` diff --git a/docs/bug-reports/index.md b/docs/bug-reports/index.md new file mode 100644 index 00000000..c283118f --- /dev/null +++ b/docs/bug-reports/index.md @@ -0,0 +1,45 @@ +--- +layout: doc +title: Bug reports +category: Contributing +description: Help ensure your issue is resolved in a timely manner. +--- + +Think you've found a bug? We'd love for you to help us get it fixed. + +Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue+bug) to see if there's an existing resolution to it, or if it's already been fixed in a newer version of WP-CLI. You should also check our documentation on [common issues and their fixes](http://wp-cli.org/docs/common-issues/). + +Once you've done a bit of searching and discovered there isn't an open or fixed issue for your bug, please [create a new Github issue](https://github.com/wp-cli/wp-cli/issues/new) with: + +* What you were doing. +* What you expected to see. +* What you actually saw. + +For instance, instead of: + +> I think WP-CLI is broken. Can you help me? + +It's more helpful to give as much detail as you can: + +> When I run `wp post list`, I see a fatal error about a class being undefined. I expected to see the list of posts. + +If you include the `--debug` flag when executing WP-CLI (e.g. `wp post list --debug`), you may get more verbosity into the source of the error. + +Your bug may also be environment-specific. Because WP-CLI is a tool whose behavior is different from system to system, it never hurts to include some environmental details in your issue if you think they're relevant. + + # What is your system? + lsb_release -a + uname -a + # Which version of PHP are you using? + which -a php + php -v + # Are you running suhosin? If so, make sure you've added `suhosin.executor.include.whitelist = phar` to your php.ini + php -m | grep -i suhosin + # Which version of WordPress are you using? + grep '^\$wp_version\s' wp-includes/version.php + # Can you share the results of which wp ? + which -a wp + stat $(which wp) + # Are you running any packages? If one is causing a problem, you can use `--skip-packages` to skip loading them + wp package list + diff --git a/docs/commands-cookbook/index.md b/docs/commands-cookbook/index.md new file mode 100644 index 00000000..c68ea0f4 --- /dev/null +++ b/docs/commands-cookbook/index.md @@ -0,0 +1,499 @@ +--- +layout: doc +title: Commands cookbook +description: The full 101 how commands work, writing your own, and sharing them with the world. +category: Guides +quick_links: + - Anatomy of a command + - Annotating with PHPDoc + - Command internals + - Writing tests + - Add to the package index +--- + +Creating your own custom WP-CLI command can be easier than it looks — and you can use `wp scaffold package` ([repo](https://github.com/wp-cli/scaffold-package-command)) to dynamically generate everything but the command itself. + +## Overview + +WP-CLI's goal is to offer a complete alternative to the WordPress admin; for any action you might want to perform in the WordPress admin, there should be an equivalent WP-CLI command. A **command** is an atomic unit of WP-CLI functionality. `wp plugin install` ([doc](/commands/plugin/install/)) is one such command, as is `wp plugin activate` ([doc](/commands/plugin/activate/)). Commands are useful to WordPress users because they can offer simple, precise interfaces for performing complex tasks. + +_But_, the WordPress admin is a Swiss Army knife of infinite complexity. There's no way just this project could handle every use case. This is why WP-CLI includes a set of [common internal commands](/commands/), while also offering a [rich internal API](/docs/internal-api/) for third-parties to write and register their own commands. + +WP-CLI commands can be [distributed as standalone packages](/package-index/), or bundled with WordPress plugins or themes. For the former, you can use `wp scaffold package` ([repo](https://github.com/wp-cli/scaffold-package-command)) to dynamically generate everything but the command itself. + +#### Command types + +Internal commands: + +* Usually cover functionality offered by a standard install WordPress. There are exceptions to this rule though, notably `wp search-replace` ([doc](/commands/search-replace/)). +* Do not depend on other components such as plugins, themes etc. +* Are maintained by the WP-CLI team. + +Third-party commands: + +* Can be defined in plugins or themes. +* Can be easily scaffolded as standalone projects with `wp scaffold package` ([repo](https://github.com/wp-cli/scaffold-package-command)). +* Can be distributed independent of a plugin or theme in the [Package Index](/package-index/). + +## Anatomy of a command + +WP-CLI supports registering any callable class, function, or closure as a command. `WP_CLI::add_command()` ([doc](/docs/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration. + +The **synopsis** of a command defines which **positional** and **associative** arguments a command accepts. Let's take a look at the synopsis for `wp plugin install`: + + $ wp plugin install + usage: wp plugin install ... [--version=] [--force] [--activate] [--activate-network] + +In this example, `...` is the accepted **positional** argument. In fact, `wp plugin install` accepts the same positional argument (the slug, ZIP, or URL of a plugin to install) multiple times. `[--version=]` is one of the accepted **associative** arguments. It's used to denote the version of the plugin to install. Notice, too, the square brackets around the argument definition; square brackets mean the argument is optional. + +WP-CLI also has a [series of global arguments](/config/) which work with all commands. For instance, including `--debug` means your command execution will display all PHP errors, and add extra verbosity to the WP-CLI bootstrap process. + +### Required registration arguments + +When registering a command, `WP_CLI::add_command()` requires two arguments:: + +1. `$name` is the command's name within WP-CLI's namespace (e.g. `plugin install` or `post list`). +2. `$callable` is the implementation of the command, as a callable class, function, or closure. + +In the following example, each instance of `wp foo` is functionally equivalent: + +``` +// 1. Command is a function +function foo_command( $args ) { + WP_CLI::success( $args[0] ); +} +WP_CLI::add_command( 'foo', 'foo_command' ); + +// 2. Command is a closure +$foo_command = function( $args ) { + WP_CLI::success( $args[0] ); +} +WP_CLI::add_command( 'foo', $foo_command ); + +// 3. Command is a method on a class +class Foo_Command { + public function __invoke( $args ) { + WP_CLI::success( $args[0] ); + } +} +WP_CLI::add_command( 'foo', 'Foo_Command' ); + +// 4. Command is a method on a class with constructor arguments +class Foo_Command { + protected $bar; + public function __construct( $bar ) { + $this->bar = $bar; + } + public function __invoke( $args ) { + WP_CLI::success( $this->bar . ':' . $args[0] ); + } +} +$instance = new Foo_Command( 'Some text' ); +WP_CLI::add_command( 'foo', $instance ); +``` + +Importantly, classes behave a bit differently than functions and closures in that: + +* Any public methods on a class are registered as subcommands of the command. For instance, given the examples above, a method `bar()` on the class `Foo` would be registered as `wp foo bar`. But... +* `__invoke()` is treated as a magic method. If a class implements `__invoke()`, the command name will be registered to that method and no other methods of that class will be registered as commands. + +### Quick and dirty execution + +Writing a short script for a one-off task, and don't need to register it formally with `WP_CLI::add_command()`? `wp eval-file` is your ticket ([doc](http://wp-cli.org/commands/eval-file/)). + +Given a `simple-command.php` file: + +``` + + * : The name of the person to greet. + * + * [--type=] + * : Whether or not to greet the person with success or error. + * --- + * default: success + * options: + * - success + * - error + * --- + * + * ## EXAMPLES + * + * wp example hello Newman + * + * @when before_wp_load + */ + function hello( $args, $assoc_args ) { + list( $name ) = $args; + + // Print the message with type + $type = $assoc_args['type']; + WP_CLI::$type( "Hello, $name!" ); + } +} + +WP_CLI::add_command( 'example', 'Example_Command' ); +``` + +This command's PHPDoc is interpreted in three ways: + +#### Shortdesc + +The shortdesc is the first line in the PHPDoc: + +``` + /** + * Prints a greeting. +``` + +#### Longdesc + +The longdesc is middle part of the PHPDoc: + +``` + * ## OPTIONS + * + * + * : The name of the person to greet. + * + * [--type=] + * : Whether or not to greet the person with success or error. + * --- + * default: success + * options: + * - success + * - error + * --- + * + * ## EXAMPLES + * + * wp example hello Newman +``` + +Options defined in the longdesc are interpreted as the command's **synopsis**: + +* `` is a required positional argument. Changing it to `..` would mean the command could accept one or more positional arguments. +* `[--type=]` is an optional associative argument which defaults to 'success' and accepts either 'success' or 'error'. Changing it to `[--error]` would change the argument to behave as an optional boolean flag. + +*Note*: To accept arbitrary/unlimited number of optional associative arguments you would use the annotation `[--=]`. So for example: + +``` + * [--=] + * : Allow unlimited number of associative parameters. +``` +A command's synopsis is used for validating the arguments, before passing them to the implementation. + +The longdesc is also displayed when calling the `help` command, for example, `wp help example hello`. Its syntax is [Markdown Extra](http://michelf.ca/projects/php-markdown/extra/) and here are a few more notes on how it's handled by WP-CLI: + +* The longdesc is generally treated as a free-form text. The `OPTIONS` and `EXAMPLES` section names are not enforced, just common and recommended. +* Sections names (`## NAME`) are colorized and printed with zero indentation. +* Everything else is indented by 2 characters, option descriptions are further indented by additional 2 characters. +* Word-wrapping is a bit tricky. If you want to utilize as much space on each line as possible and don't get word-wrapping artifacts like one or two words on the next line, follow these rules: + * Hard-wrap option descriptions at **75 chars** after the colon and a space. + * Hard-wrap everything else at **90 chars**. + +#### Docblock tags + +This is the last section and it starts immediately after the longdesc: + +``` + * @when before_wp_load + */ +``` + +Here's the list of defined tags: + +**@subcommand** + +There are cases where you can't make the method name have the name of the subcommand. For example, you can't have a method named `list`, because `list` is a reserved keyword in PHP. + +That's when the `@subcommand` tag comes to the rescue: + +``` + /** + * @subcommand list + */ + function _list( $args, $assoc_args ) { + ... + } + + /** + * @subcommand do-chores + */ + function do_chores( $args, $assoc_args ) { + ... + } +``` + +**@alias** + +With the `@alias` tag, you can add another way of calling a subcommand. Example: + +``` + /** + * @alias hi + */ + function hello( $args, $assoc_args ) { + ... + } +``` + +``` +$ wp example hi Joe +Success: Hello, Joe! +``` + +**@when** + +This is a special tag that tells WP-CLI when to execute the command. It supports [all registered hooks](/docs/internal-api/wp-cli-add-hook/). + +``` +@when before_wp_load +``` + +Do keep in mind most WP-CLI hooks fire before WordPress is loaded. If your command is loaded from a plugin or theme, `@when` will be essentially ignored. + +It has no effect if the command using it is loaded from a plugin or a theme, because by that time WordPress itself will have already been loaded. + +#### WP_CLI::add_command()'s third $args parameter + +Each of the configuration options supported by PHPDoc can instead be passed as the third argument in command registration: + +``` +$hello_command = function( $args, $assoc_args ) { + list( $name ) = $args; + $type = $assoc_args['type']; + WP_CLI::$type( "Hello, $name!" ); +} +WP_CLI::add_command( 'example hello', $hello_command, array( + 'shortdesc' => 'Prints a greeting.', + 'synopsis' => array( + array( + 'type' => 'positional', + 'name' => 'name', + 'optional' => false, + 'multiple' => false, + ), + array( + 'type' => 'assoc', + 'name' => 'type', + 'optional' => true, + 'default' => 'success', + 'options' => array( 'success', 'error' ), + ), + ), + 'when' => 'before_wp_load', +) ); +``` + +### Command internals + +Now that you know how to register a command, the world is your oyster. Inside your callback, your command can do whatever it wants. + +#### Accepting arguments + +In order to handle runtime arguments, you have to add two parameters to your callable: `$args` and `$assoc_args`. + +``` +function hello( $args, $assoc_args ) { + /* Code goes here*/ +} +``` + +`$args` variable will store all the positional arguments: + +``` +$ wp example hello Joe Doe +``` + +``` +WP_CLI::line( $args[0] ); // Joe +WP_CLI::line( $args[1] ); // Doe +``` + +`$assoc_args` variable will store all the arguments defined like `--key=value` or `--flag` or `--no-flag` + +``` +$ wp example hello --name='Joe Doe' --verbose --no-option +``` + +``` +WP_CLI::line( $assoc_args['name'] ); // Joe Doe +WP_CLI::line( $assoc_args['verbose'] ); // true +WP_CLI::line( $assoc_args['option'] ); // false +``` + +Also, you can combine argument types: + +``` +$ wp example hello --name=Joe foo --verbose bar +``` + +``` +WP_CLI::line( $assoc_args['name'] ); // Joe +WP_CLI::line( $assoc_args['verbose'] ); // true +WP_CLI::line( $args[0] ); // foo +WP_CLI::line( $args[1] ); // bar +``` + +#### Effectively reusing WP-CLI internal APIs + +As an example, say you were tasked with finding all unused themes on a multisite network ([#2523](https://github.com/wp-cli/wp-cli/issues/2523)). If you had to perform this task manually through the WordPress admin, it would probably take hours, if not days, of effort. However, if you're familiar with writing WP-CLI commands, you could complete the task in 15 minutes or less. + +Here's what such a command looks like: + +``` +/** + * Find unused themes on a multisite network. + * + * Iterates through all sites on a network to find themes which aren't enabled + * on any site. + */ +$find_unused_themes_command = function() { + $response = WP_CLI::launch_self( 'site list', array(), array( 'format' => 'json' ), false, true ); + $sites = json_decode( $response->stdout ); + $unused = array(); + $used = array(); + foreach( $sites as $site ) { + WP_CLI::log( "Checking {$site->url} for unused themes..." ); + $response = WP_CLI::launch_self( 'theme list', array(), array( 'url' => $site->url, 'format' => 'json' ), false, true ); + $themes = json_decode( $response->stdout ); + foreach( $themes as $theme ) { + if ( 'no' == $theme->enabled && 'inactive' == $theme->status && ! in_array( $theme->name, $used ) ) { + $unused[ $theme->name ] = $theme; + } else { + if ( isset( $unused[ $theme->name ] ) ) { + unset( $unused[ $theme->name ] ); + } + $used[] = $theme->name; + } + } + } + WP_CLI\Utils\format_items( 'table', $unused, array( 'name', 'version' ) ); +}; +WP_CLI::add_command( 'find-unused-themes', $find_unused_themes_command, array( + 'before_invoke' => function(){ + if ( ! is_multisite() ) { + WP_CLI::error( 'This is not a multisite install.' ); + } + }, +) ); +``` + +Let's run through the [internal APIs](/docs/internal-api/) this command uses to achieve its goal: + +* `WP_CLI::add_command()` ([doc](/docs/internal-api/wp-cli-add-command/)) is used to register a `find-unused-themes` command to the `$find_unused_themes_command` closure. The `before_invoke` argument makes it possible to verify the command is running on a multisite install, and error if not. +* `WP_CLI::error()` ([doc](/docs/internal-api/wp-cli-error/)) renders a nicely formatted error message and exits. +* `WP_CLI::launch_self()` ([doc](/docs/internal-api/wp-cli-launch-self/)) initially spawns a process to get a list of all sites, then is later used to get the list of themes for a given site. +* `WP_CLI::log()` ([doc](/docs/internal-api/wp-cli-log/)) renders informational output to the end user. +* `WP_CLI\Utils\format_items()` ([doc](/docs/internal-api/wp-cli-utils-format-items/)) renders the list of unused themes after the command has completed its discovery. + +### Help rendering + +Your command's PHPDoc (or registered definition) is rendered using the `help` command. The output is ordered like this: + + 1. Short description + 2. Synopsis + 3. Long description (OPTIONS, EXAMPLES etc.) + 4. Global parameters + +## Writing tests + +WP-CLI makes use of a Behat-based testing framework, which you should use too. Behat is a great choice for your WP-CLI commands because: + +* It's easy to write new tests, which means they'll actually get written. +* The tests interface with your command in the same manner as your users interface with your command. + +Behat tests live in the `features/` directory of your project. Here's an example from `features/cli-info.feature`: + +``` +Feature: Review CLI information + + Scenario: Get the path to the packages directory + Given an empty directory + + When I run `wp cli info --format=json` + Then STDOUT should be JSON containing: + """ + {"wp_cli_packages_dir_path":"/tmp/wp-cli-home/.wp-cli/packages/"} + """ + + When I run `WP_CLI_PACKAGES_DIR=/tmp/packages wp cli info --format=json` + Then STDOUT should be JSON containing: + """ + {"wp_cli_packages_dir_path":"/tmp/packages/"} + """ +``` + +Functional tests typically follow this pattern: + +* **Given** some background, +* **When** a user performs a specific action, +* **Then** the end result should be X (and Y and Z). + +Convinced? Head on over to [wp-cli/scaffold-package-command](https://github.com/wp-cli/scaffold-package-command) to get started. + +## Distribution + +Now that you've produce a command you're proud of, it's time to share it with the world. There are two common ways of doing so. + +### Include in a plugin or theme + +One way to share WP-CLI commands is by packaging them in your plugin or theme. Many people do so by conditionally loading (and registering) the command based on the presence of the `WP_CLI` constant. + +``` +if ( defined( 'WP_CLI' ) && WP_CLI ) { + require_once dirname( __FILE__ ) . '/inc/class-plugin-cli-command.php'; +} +``` + +### Add to the package index + +Standalone WP-CLI commands can be added to and installed from the [package index](/package-index/). The only technical requirement for being listed in the package index is to include a valid composer.json file with an autoload declaration. + +Here's a full composer.json example from the server command: + +``` + +{ + "name": "wp-cli/server-command", + "description": "Start a development server for WordPress", + "homepage": "https://github.com/wp-cli/server-command", + "license": "MIT", + "require": { + "php": ">=5.4" + }, + "autoload": { + "files": [ "command.php" ] + } +} +``` + +Note the `autoload` declaration, which loads `command.php`. + +Once you've added a valid composer.json file to your project repository, you can submit your project to the package index by [editing repositories.txt to include the URL to your project](https://github.com/wp-cli/package-index/blob/master/repositories.txt). Please make sure to add yours in alphabetical order. diff --git a/docs/common-issues/index.md b/docs/common-issues/index.md new file mode 100644 index 00000000..81287842 --- /dev/null +++ b/docs/common-issues/index.md @@ -0,0 +1,120 @@ +--- +layout: doc +title: Common issues and their fixes +description: In case of fire, break glass. +category: Guides +--- + +### Error: Can't connect to the database + +A few possibilities: + +a) you're using MAMP, but WP-CLI is not using the MAMP PHP binary. + +You can check which PHP WP-CLI is using by running `wp --info`. + +If you need to specify an alternate PHP binary, see [using a custom PHP binary](http://wp-cli.org/docs/installing/#using-a-custom-php-binary). + +b) it's a WordPress multisite install. + +c) the database credentials in `wp-config.php` are actually incorrect. + +### PHP Fatal error: Cannot redeclare wp_unregister_GLOBALS() + +If you get this fatal error running the `wp` command, you may have moved or edited `wp-config.php` beyond what wp-cli supports: + +``` +PHP Fatal error: Cannot redeclare wp_unregister_GLOBALS() (previously declared in /var/www/foo.com/wp-includes/load.php:18) in /var/www/foo.com/wp-includes/load.php on line 33 +``` + +One of WP-CLI's requirements is that the line: + +```php +require_once(ABSPATH . 'wp-settings.php'); +``` + +remains in the `wp-config.php` file, so if you've modified or moved it, put it back there. It gets matched by a regex when WP-CLI runs. + +See also: [#1631](https://github.com/wp-cli/wp-cli/issues/1631) + +### PHP Fatal error: Call to undefined function cli\posix_isatty() + +Please ensure you have the php-process extension installed. For example for Centos 6: `yum install php-process` + +### Error: YIKES! It looks like you're running this as root. + +Running WP-CLI as root is extremely dangerous. When you execute WP-CLI as root, any code within your WordPress instance (including third-party plugins and themes you've installed) will have full privileges to the entire server. This can enable malicious code within the WordPress instance to compromise the entire server. + +The WP-CLI project strongly discourages running WP-CLI as root. + +See also: [#973](https://github.com/wp-cli/wp-cli/pull/973#issuecomment-35842969) + +### PHP notice: Undefined index on `$_SERVER` superglobal + +The `$_SERVER` superglobal is an array typically populated by a web server with information such as headers, paths, and script locations. PHP CLI doesn't populate this variable, nor does WP-CLI, because many of the variable details are meaningless at the command line. + +Before accessing a value on the `$_SERVER` superglobal, you should check if the key is set: + + if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) { + $_SERVER['HTTPS']='on'; + } + +When using `$_SERVER['HTTP_HOST']` in your `wp-config.php`, you'll need to set a default value in WP-CLI context: + + if ( defined( 'WP_CLI' ) && WP_CLI && ! isset( $_SERVER['HTTP_HOST'] ) ) { + $_SERVER['HTTP_HOST'] = 'wp-cli.org'; + } + +See also: [#730](https://github.com/wp-cli/wp-cli/issues/730) + +### Can't find wp-content directory / use of `$_SERVER['document_root']` + +`$_SERVER['document_root']` is defined by the webserver based on the incoming web request. Because this type of context is unavailable to PHP CLI, `$_SERVER['document_root']` is unavailable to WP-CLI. Furthermore, WP-CLI can't safely mock `$_SERVER['document_root']` as it does with `$_SERVER['http_host']` and a few other `$_SERVER` values. + +If you're using `$_SERVER['document_root']` in your `wp-config.php` file, you should instead use `dirname( __FILE__ )` or similar. + +See also: [#785](https://github.com/wp-cli/wp-cli/issues/785) + +### Conflict between global parameters and command arguments + +All of the [global parameters](http://wp-cli.org/config/) (e.g. `--url=`) may conflict with the arguments you'd like to accept for your command. For instance, adding a RSS widget to a sidebar will not populate the feed URL for that widget: + + + $ wp widget add rss sidebar-1 1 --url="http://www.smashingmagazine.com/feed/" --items=3 + Success: Added widget to sidebar. + +* Expected result: widget has the feed URL set. +* Actual result: widget is added with the number of items set to 3, but with empty feed URL. + +Use the `WP_CLI_STRICT_ARGS_MODE` environment variable to tell WP-CLI to treat any arguments before the command as global, and after the command as local: + + WP_CLI_STRICT_ARGS_MODE=1 wp --url=wp.dev/site2 widget add rss sidebar-1 1 --url="http://wp-cli.org/feed/" + +In this example, `--url=wp.dev/site2` is the global argument, setting WP-CLI to run against 'site2' on a WP multisite install. `--url="http://wp-cli.org/feed/"` is the local argument, setting the RSS feed widget with the proper URL. + +See also: [#3128](https://github.com/wp-cli/wp-cli/pull/3128) + +### Warning: Some code is trying to do a URL redirect + +Most of the time, it's some plugin or theme code that disables wp-admin access to non-admins. + +Quick fix, other than disabling the protection, is to pass the user parameter: `--user=some_admin` + +See also: [#477](https://github.com/wp-cli/wp-cli/issues/477) + +### The installation hangs + +If the installation seems to hang forever while trying to clone the resources from GitHub, please ensure that you are allowed to connect to Github using SSL (port 443) and Git (port 9418) for outbound connections. + +### W3 Total Cache Error: some files appear to be missing or out of place. + +W3 Total Cache object caching can cause this problem. Disabling object caching and optionally removing `wp-content/object-cache.php` will allow WP-CLI to work again. + +See also: [#587](https://github.com/wp-cli/wp-cli/issues/587) + +### The automated updater doesn't work for versions before 3.4 + +The `wp core update` command is designed to work for WordPress 3.4 and above. To be able to update an older website to latest WordPress, you could try one of the following alternatives: + +1. **Fully-automated:** Run `wp core download --force` to download latest WordPress and replace it with your files (don't worry, `wp-config.php` will remain intact). Then, run `wp core update-db` to update the database. Since the procedure isn't ideal, run once again `wp core download --force` and the new version should be available. +2. **Semi-automated:** Run `wp core download --force` to download all files and replace them in your current installation, then navigate to `/wp-admin/` and run the database upgrade when prompted. diff --git a/docs/contributing/index.md b/docs/contributing/index.md new file mode 100644 index 00000000..387fb1a7 --- /dev/null +++ b/docs/contributing/index.md @@ -0,0 +1,51 @@ +--- +layout: doc +title: Contributing +category: Contributing +description: An introduction to the contributing process. +quick_links: + - Reporting a bug + - Creating a pull request + - Improving our documentation +--- + +Welcome and thanks! + +We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project. + +**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. + +Please take a moment to read these guidelines at depth. Following the guidelines helps to communicate that you respect the time of the other contributors to the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. + +### Reporting a bug + +Think you’ve found a bug? We’d love for you to help us get it fixed. + +Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version of WP-CLI. You should also check our [documentation on common issues and their fixes](https://wp-cli.org/docs/common-issues/). + +Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [follow our guidelines for submitting a bug report](http://wp-cli.org/docs/bug-reports/) to make sure it gets addressed in a timely manner. + +### Creating a pull request + +Want to contribute a new feature? WP-CLI is a mature project, and already chock-full of useful functionality. Please first [open a new issue](https://github.com/wp-cli/wp-cli/issues/new) to discuss whether the feature is a good fit for WP-CLI core, or might be better suited as a [community package](https://wp-cli.org/package-index/). + +New to the WP-CLI codebase? Check out [issues labeled 'good-first-issue'](https://github.com/wp-cli/wp-cli/labels/good-first-issue) for a place to start. These issues are specially earmarked for new contributors. + +Once you've decided to commit the time to seeing your pull request through, please [follow our guidelines for creating a pull request](https://wp-cli.org/docs/pull-requests/) to make sure it's a pleasant experience. + +### Improving our documentation + +Is documentation your strength? Take a look at the currently open [documentation issues](https://github.com/wp-cli/wp-cli/issues?q=is%3Aopen+is%3Aissue+label%3Ascope%3Adocumentation) and see if you can tackle any of those. + +If you believe you’ve found an issue with the documentation, you should [search existing issues](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version of WP-CLI. + +There are a couple different types of documentation currently part of WP-CLI: + +* Documentation for individual WP-CLI commands (anything underneath [http://wp-cli.org/commands](http://wp-cli.org/commands)) is contained in the PHPDoc for each command. This means that to edit the documentation for a command, you will need to edit the file that actually provides the functionality for that command. The web documentation is generated from these files at the time of release, so you may not see your changes until the next release. +* Individual documentation pages (anything under [http://wp-cli.org/docs/](http://wp-cli.org/docs/) can be edited by contributing to the [wp-cli.github.com repository on GitHub](https://github.com/wp-cli/wp-cli.github.com). You don't necessarily need to navigate the Github repo though; any page that is part of this repository will have an 'Edit' link in the top right of the page which will take you to the corresponding file on GitHub. + +### Contributing in other ways + +Feel free to [create an issue](https://github.com/wp-cli/wp-cli/issues/new) with your question, and we'll see if we can find an answer for it. + +Alternatively, if you have a WordPress.org account, you may also consider joining the `#cli` channel on the [WordPress.org Slack organization](https://make.wordpress.org/chat/). diff --git a/docs/external-resources/index.md b/docs/external-resources/index.md new file mode 100644 index 00000000..431f1ec8 --- /dev/null +++ b/docs/external-resources/index.md @@ -0,0 +1,31 @@ +--- +layout: doc +title: External resources +description: Blog posts, slides and videos from users. +category: Guides +--- + +## Blog posts & tutorials + +* [scribu: A Command-Line Interface for WordPress](http://scribu.net/wordpress/a-command-line-interface-for-wordpress.html) +* [A bit of bits: WP-CLI: WordPress Command Line Tools](http://madewithlove.be/abob/2011/12/wp-cli-wordpress-command-line-tools/) +* [Mika Epstein: Command Line WP](http://halfelf.org/2012/command-line-wp/) +* [Treehouse Blog: Tame WordPress from the Command Line with wp-cli](http://blog.teamtreehouse.com/tame-wordpress-from-the-command-line-with-wp-cli) +* [Matt Wiebe: Why You Should Develop Plugins With wp-cli](http://wp.mattwie.be/2014/01/15/why-you-should-develop-plugins-with-wp-cli/) +* [Arnaud Sellenet: A Decent Wordpress Deploy Workflow](http://demental.info/blog/2013/04/09/a-decent-wordpress-deploy-workflow/) +* [Torque: Using WP CLI to Set Up a Test Version of Your Site](http://torquemag.io/using-wp-cli-to-set-up-a-test-version-of-your-site/) + +## Slides + +* [Francesco Laffi: WPday Bologna 2013: wp-cli](https://speakerdeck.com/francescolaffi/wpday-bologna-2013-wp-cli) +* [Michael Bastos: Command Line WordPress Step by Step](https://docs.google.com/presentation/d/1iDYvmM_52ww_iB4aGMAYL_KJ1pnElAVm40c7IrZtyz8/edit) +* [Kelly Dwan: Importing (any!) Content with WP-CLI](//redradar.net/slides/wp-cli/) +* [Jaime Martinez: Simplify your day to day tasks with WP-CLI](http://slid.es/jmslbam/wp-cli-wp-meetup010-25-nov-2013) + +## Videos + +* [scribu: Command Line Learnings For Make Benefit Glorious Nation Of WordPress](http://wordpress.tv/2013/02/23/cristi-burka-command-line-learnings-for-make-benefit-glorious-nation-of-wordpress/) +* [Mike Schroder: Magical WordPress Management using WP-CLI](http://wordpress.tv/2013/08/06/mike-schroder-magical-wordpress-management-using-wp-cli/) +* [Daniel Bachhuber: WordPress at the Command Line](http://wordpress.tv/2012/08/21/daniel-bachhuber-wordpress-at-the-command-line/) +* [AJ Morris: Managing WordPress from the Command Line](http://ajmorris.me/managing-wordpress-command-line/) +* [Shawn Hooper: WP-CLI – Save Time by Managing WordPress from the Command Line](https://wordpress.tv/2015/09/15/shawn-hooper-wp-cli-save-time-managing-command-line/) diff --git a/docs/governance/index.md b/docs/governance/index.md new file mode 100644 index 00000000..625c65fb --- /dev/null +++ b/docs/governance/index.md @@ -0,0 +1,40 @@ +--- +layout: doc +title: Governance +category: Contributing +description: Summary of those behind WP-CLI. +--- + +### Who runs things? + +[andreascreten](https://github.com/andreascreten), [danielbachhuber](https://github.com/danielbachhuber), and [scribu](https://github.com/scribu) are currently the three people with administrator access to the following properties: + +* [wp-cli](https://github.com/wp-cli) github organization +* [wpcli](https://twitter.com/wpcli) twitter account +* [wp-cli-commits](https://groups.google.com/forum/?fromgroups#!forum/wp-cli-commits) mailing list +* [Cloudflare](https://www.cloudflare.com/) CDN account +* [Mailchimp](http://mailchimp.com/) email newsletter account + +### Who controls the wp-cli.org site? + +The domain currently owned by [andreascreten](https://github.com/andreascreten). + +The entire site is hosted on Github Pages, using Cloudflare for SSL: + +| **URL** | **Repository** | **Branch** | **Updates** +|:---------------------------------|:------------------------------|:-----------|:------------ +| http://wp-cli.org/ | [wp-cli/wp-cli.github.com][1] | master | manual +| http://wp-cli.org/package-index/ | [wp-cli/package-index][2] | gh-pages | cron job hosted on separate server (owned by daniel) +| http://wp-cli.org/builds/ | [wp-cli/builds][3] | gh-pages | automatically by Travis CI + +[1]: http://github.com/wp-cli/wp-cli.github.com +[2]: http://github.com/wp-cli/package-index +[3]: http://github.com/wp-cli/builds + +### Why are some contributors [members](https://github.com/orgs/wp-cli/people) of the wp-cli organization? + +Because they have demonstrated, over a period of time, that they are capable and invested in moving the project forward: + +* contributing to the wp-cli codebase +* promoting wp-cli (speaking at WordCamps, writing blog posts etc.) +* helping other users and/or contributors diff --git a/docs/hosting-companies/index.md b/docs/hosting-companies/index.md new file mode 100644 index 00000000..e280814b --- /dev/null +++ b/docs/hosting-companies/index.md @@ -0,0 +1,35 @@ +--- +layout: doc +title: Hosting companies +category: References +description: List of hosting companies where WP-CLI is installed by default. +--- + +The following is a list of hosting companies that have WP-CLI installed by default for their customers, i.e. when they first SSH into their server, the `wp` command is already available. + +In alphabetical order: + +* [1&1](http://1and1.com/) +* [A2 Hosting](https://www.a2hosting.com/) +* [Amimoto](http://megumi-cloud.com/) +* [Bluehost](http://www.bluehost.com/) +* [Byte](https://www.byte.nl) +* [Cloudways](http://cloudways.com) +* [Dreamhost](http://dreamhost.com) +* [FatCow](http://www.fatcow.com/wordpress-hosting/) +* [GoDaddy](https://www.godaddy.com/help/accessing-wp-cli-on-your-managed-wordpress-account-12066) +* [HostGator](http://www.hostgator.com) +* [iPage](http://www.ipage.com/ipage/index.html) +* [LiquidWeb](https://liquidweb.com/wordpress) +* [Kinsta](https://kinsta.com) +* [Media Temple](http://mediatemple.net) +* [Monarobase](https://monarobase.net/wordpress) +* [NearlyFreeSpeech.NET](https://www.nearlyfreespeech.net/) +* [Pantheon](https://pantheon.io) +* [RoseHosting](https://www.rosehosting.com) +* [Site5](http://www.site5.com/) +* [SiteGround](http://www.siteground.com/) +* [Synthesis](http://websynthesis.com/) +* [TVC.Net](http://TVC.Net/) +* [WordPress.com VIP](http://vip.wordpress.com/) +* [WPEngine.com](http://wpengine.com) diff --git a/docs/implementation-details/index.md b/docs/implementation-details/index.md new file mode 100644 index 00000000..6b05da66 --- /dev/null +++ b/docs/implementation-details/index.md @@ -0,0 +1,38 @@ +--- +layout: doc +title: Implementation details +description: Catalog of historical design decisions. +category: Contributing +--- + +This page contains some history on various implementation details of WP-CLI. + +### Command Help Text + +The `wp help ` has been through several incarnations. + +Since WP-CLI 0.3, it invoked a static `help()` method in the command class, if it existed. ([48a8887d](https://github.com/wp-cli/wp-cli/commit/48a8887d46be25e0c0ad326975729ec816c17331)) + +Since WP-CLI 0.6, it looked for a `.1` ROFF file and displayed it using `man`. The ROFF file was compiled from a corresponding `.txt` markdown file and from PHPDoc metadata. ([#24](https://github.com/wp-cli/wp-cli/issues/24)). + +Since WP-CLI 0.11, it generates the help text on the fly. ([#548](https://github.com/wp-cli/wp-cli/pull/548)) + +### WP_ADMIN + +Most WP-CLI commands perform administrative actions and they need access to code defined in `wp-admin/includes`. This code can be loaded on-demand or preemptively. + +The question is: should the `WP_ADMIN` constant be set to `true` or `false`? + +Initially, WP-CLI just loaded the wp-admin code and didn't mess with the WP_ADMIN constant at all. + +Then, it sort of pretended it was doing a front-end page load, for doing integration testing ([#69](https://github.com/wp-cli/wp-cli/issues/69)). [1] + +Then it pretended it was loading wp-admin, to side-step caching plugins ([#164](https://github.com/wp-cli/wp-cli/issues/164)). + +Then it stopped pretending it was loading wp-admin ([#352](https://github.com/wp-cli/wp-cli/issues/352)), because we found a better way to side-step caching plugins. [2] + +---- + +* [1]: It turned out that the official WordPress testing suite had a better solution: the `go_to()` method. +* [2]: The solution was rolling our own `wp-settings.php` file. + diff --git a/docs/index.md b/docs/index.md index 34f08659..d8279b35 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,11 @@ --- -redirect_to: - - https://make.wordpress.org/cli/handbook/ +layout: doc +title: Documentation +description: Helpful guides and resources for using WP-CLI. --- + +Here are some helpful guides and resources for using WP-CLI. + +Can't find what you're looking for? [Open an issue](https://github.com/wp-cli/wp-cli/issues) to request improvements. + +{% include doc-list.html %} diff --git a/docs/installing/index.md b/docs/installing/index.md new file mode 100644 index 00000000..ba839a99 --- /dev/null +++ b/docs/installing/index.md @@ -0,0 +1,223 @@ +--- +layout: doc +title: Installing +category: Guides +description: Recommended and alternative installation mechanisms. +quick_links: + - Recommended Installation + - Installing nightly via Phar + - Installing via Composer +--- + +## Recommended installation + +The recommended way to install WP-CLI is by downloading the Phar build, marking it executable, and placing it on your PATH. + +First, download [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) using `wget` or `curl`. For example: + +``` +curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` + +Then, check if it works: + +``` +php wp-cli.phar --info +``` + +To be able to type just `wp`, instead of `php wp-cli.phar`, you need to make the file executable and move it to somewhere in your PATH. For example: + +``` +chmod +x wp-cli.phar +sudo mv wp-cli.phar /usr/local/bin/wp +``` + +Now try running `wp --info`. If WP-CLI is installed successfully, you'll see output like this: + +``` +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli +WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ +WP-CLI global config: /home/wp-cli/.wp-cli/config.yml +WP-CLI project config: +WP-CLI version: 0.23.0 +``` + +Voila! You're now an official WP-CLI user. + +Wondering what to do next? Check out the [quick start guide](/docs/quick-start/) for a short introduction and some example usage. + +### Updating WP-CLI + +If you have installed WP-CLI using the recommended Phar method, you can update it at any time by running `wp cli update`. If you installed WP-CLI using the Git or Composer-based installations, see the specific instructions for updating associated with each method below. + +When you run `wp cli update`, you'll be prompted to confirm that you wish to update with a message similar to the following: + +``` +You have version 0.21.1. Would you like to update to 0.23.1? [y/n] +``` + +After you accept, you should see a success message: + +``` +Success: Updated WP-CLI to 0.23.1 +``` + +If you're already running the latest version of WP-CLI, you'll see this message: + +``` +WP-CLI is at the latest version. +``` + +Want to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of WP-CLI. The nightly build is more or less stable enough for you to use in your local environment, and always includes the latest and greatest. + +For more information about `wp cli update`, including flags and options that can be used, read the full [docs page on the update command](https://wp-cli.org/commands/cli/update/). + +### Tab completions + +WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://github.com/wp-cli/wp-cli/raw/master/utils/wp-completion.bash) and source it from `~/.bash_profile`: + +``` +source /FULL/PATH/TO/wp-completion.bash +``` + +Don't forget to run `source ~/.bash_profile` afterwards. + +## Alternative installation methods + +### Installing nightly via Phar + +The "nightly" is the bleeding-edge version of WP-CLI, built straight from the [master branch](https://github.com/wp-cli/wp-cli/commits/master). + +Just follow the normal [installation instructions](/#install), except change the URL to the phar file: + + + +### Installing via Composer + +**As part of a project** + +Add the following line to your projects `composer.json` file: + + "require" : { + "wp-cli/wp-cli" : "~0.22", + "psy/psysh" : "~0.6" + } + +where the `psy/psysh` package is just a _suggestion_ by the WP CLI package and _optional_. + +Optionally (if run on a server or for e.g. in a virtual machine locally) you can automate setting up the command and making it available in the users path. Let's assume _Composer_ installed into `/var/www/vendor`, we can add the following `scripts`/commands to the `composer.json` file. The second and third line set up [bash completion](https://github.com/wp-cli/wp-cli/blob/master/utils/wp-completion.bash) so we don't have to remember every single command: + + "scripts" : { + "post-install-cmd" : [ + "sudo ln -s /var/www/vendor/wp-cli/wp-cli/bin/wp /usr/bin/wp", + "source /var/www/vendor/wp-cli/wp-cli/utils/wp-completion.bash", + "source ~/.bash_profile" + ] + } + +**As a project** + +Needs `php` and `composer` (or `php composer.phar`) set up as console commands. + + composer create-project wp-cli/wp-cli --prefer-source + +Then run `wp-cli/bin/wp` or add `wp-cli/bin` folder to `PATH` for global `wp` command (on Windows, use `wp-cli/bin/wp.bat` instead). + +To update, you'll need to: + + cd wp-cli + git pull origin master + composer install + +**Global require** + +If you prefer to have PHP tools installed globally via Composer and have something like `~/.composer/vendor/bin` in your PATH (or `C:\Users\you\AppData\Roaming\Composer\vendor\bin` on Windows), you can just run: + + composer global require wp-cli/wp-cli + +To update everything globally, run `composer global update`. + +**Installing a specific version** + +If you want to install a specific version of WP-CLI then append the version numbers behind the packages + + + composer create-project wp-cli/wp-cli:0.22.0 --no-dev + +The version must be in a [format](https://getcomposer.org/doc/04-schema.md#version) that Composer can understand and can be found on [packagist.org](https://packagist.org/packages/wp-cli/wp-cli). + +**Installing bleeding-edge** + +If you want to install bleeding-edge then use `dev-master`: + + composer create-project wp-cli/wp-cli:dev-master --no-dev + +#### Installing globally as a project + +You can specify a custom install path for WP-CLI, like so: + + composer create-project wp-cli/wp-cli /usr/share/wp-cli --no-dev + +Then, just symlink the binary: + + sudo ln -s /usr/share/wp-cli/bin/wp /usr/bin/wp + +### Installing via Homebrew + + brew install homebrew/php/wp-cli + +Here's the [formula](https://github.com/homebrew/homebrew-php/blob/master/Formula/wp-cli.rb). + +### Installing on Windows + +Install via [composer as described above](#installing-via-composer) or use the following method. + +Make sure you have php installed and [in your path](http://php.net/manual/en/faq.installation.php#faq.installation.addtopath) so you can execute it globally. + +Download [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) manually and save it to a folder, for example `c:\wp-cli` + +Create a file named `wp.bat` in `c:\wp-cli` with the following contents: + + @ECHO OFF + php "c:/wp-cli/wp-cli.phar" %* + +Add `c:\wp-cli` to your path: + + setx path "%path%;c:\wp-cli" + +You can now use WP-CLI from anywhere in Windows command line. + +### Installing via .deb package + +On Debian or Ubuntu, just download and open one of the .deb packages: + + +### Using a custom PHP binary + +In some cases, like for MAMP installs, you might not want to use the default PHP binary. + +To use the latest PHP version provided by MAMP, you'll need to modify your `PATH` environment variable with the following added to your `~/.bash_profile` or `~/.zsh_profile`: + + PHP_VERSION=ls /Applications/MAMP/bin/php/ | sort -n | tail -1 + export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH + +To use a specific PHP version provided by MAMP, you'll need to determine the path to the PHP version's executable, and modify your `PATH` environment variable with the following added to your `~/.bash_profile` or `~/.zsh_profile`: + + export PATH=/Applications/MAMP/bin/php/php5.5.26/bin:$PATH + +Note there's no assignment of the `PHP_VERSION` variable in this case, because we aren't dynamically looking up the latest PHP version. + +Once you have added that and saved the file, reload the file with: + + source ~/.bash_profile + +After you've done that, run `wp --info` to make sure the change has been applied correctly. + +For Git and Composer-based WP-CLI installation, you can alternatively set the `WP_CLI_PHP` environment variable, if you don't want to modify `PATH` for some reason. + +### Installing on MediaTemple + +See [http://razorfrog.com/installing-wp-cli-on-mediatemple-grid-server/](http://razorfrog.com/installing-wp-cli-on-mediatemple-grid-server/) diff --git a/docs/internal-api/index.md b/docs/internal-api/index.md new file mode 100644 index 00000000..4a5cb504 --- /dev/null +++ b/docs/internal-api/index.md @@ -0,0 +1,14 @@ +--- +layout: doc +title: Internal API +category: References +description: Stable utilities considered safe to use in community commands. +--- + +WP-CLI includes a number of utilities which are considered stable and meant to be used by commands. + +This also means functions and methods not listed here are considered part of the private API. They may change or disappear at any time. + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + +{% include internal-api-list.html %} diff --git a/docs/internal-api/wp-cli-add-command/index.md b/docs/internal-api/wp-cli-add-command/index.md new file mode 100644 index 00000000..3343d817 --- /dev/null +++ b/docs/internal-api/wp-cli-add-command/index.md @@ -0,0 +1,82 @@ +--- +layout: default +title: WP_CLI::add_command() +description: "Register a command to WP-CLI." +--- + +Docs » Internal API » Registration + +## WP_CLI::add_command() + +Register a command to WP-CLI. + +*** + +### Usage + + WP_CLI::add_command( $name, $callable, $args = array() ) + +
+$name (string) Name for the command (e.g. "post list" or "site empty").
+$callable (string) Command implementation as a class, function or closure.
+$args (array) {
Optional An associative array with additional registration parameters.
'before_invoke' => callback to execute before invoking the command,
'after_invoke' => callback to execute after invoking the command,
'shortdesc' => short description (80 char or less) for the command,
'synopsis' => the synopsis for the command (string or array),
'when' => execute callback on a named WP-CLI hook (e.g. before_wp_load),
}
+@return (true) on success, hard error if registration failed.
+
+ + +*** + +### Notes + +WP-CLI supports using any callable class, function, or closure as a +command. `WP_CLI::add_command()` is used for both internal and +third-party command registration. + +Command arguments are parsed from PHPDoc by default, but also can be +supplied as an optional third argument during registration. + + + # Register a custom 'foo' command to output a supplied positional param. + # + # $ wp foo bar + # Success: bar + + /** + * My awesome closure command + * + * + * : An awesome message to display + * + * @when before_wp_load + */ + $foo = function( $args ) { + WP_CLI::success( $args[0] ); + }; + WP_CLI::add_command( 'foo', $foo ); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-add-hook/index.md b/docs/internal-api/wp-cli-add-hook/index.md new file mode 100644 index 00000000..f028c010 --- /dev/null +++ b/docs/internal-api/wp-cli-add-hook/index.md @@ -0,0 +1,79 @@ +--- +layout: default +title: WP_CLI::add_hook() +description: "Schedule a callback to be executed at a certain point." +--- + +Docs » Internal API » Registration + +## WP_CLI::add_hook() + +Schedule a callback to be executed at a certain point. + +*** + +### Usage + + WP_CLI::add_hook( $when, $callback ) + +
+$when (string) Identifier for the hook.
+$callback (mixed) Callback to execute when hook is called.
+@return (null)
+
+ + +*** + +### Notes + +Hooks conceptually are very similar to WordPress actions. WP-CLI hooks +are typically called before WordPress is loaded. + +WP-CLI hooks include: + +* `before_invoke:` - Just before a command is invoked. +* `after_invoke:` - Just after a command is involved. +* `before_wp_load` - Just before the WP load process begins. +* `before_wp_config_load` - After wp-config.php has been located. +* `after_wp_config_load` - After wp-config.php has been loaded into scope. +* `after_wp_load` - Just after the WP load process has completed. + +WP-CLI commands can create their own hooks with `WP_CLI::do_hook()`. + + + # `wp network meta` confirms command is executing in multisite context. + WP_CLI::add_command( 'network meta', 'Network_Meta_Command', array( + 'before_invoke' => function () { + if ( !is_multisite() ) { + WP_CLI::error( 'This is not a multisite install.' ); + } + } + ) ); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-add-wp-hook/index.md b/docs/internal-api/wp-cli-add-wp-hook/index.md new file mode 100644 index 00000000..7b66d272 --- /dev/null +++ b/docs/internal-api/wp-cli-add-wp-hook/index.md @@ -0,0 +1,60 @@ +--- +layout: default +title: WP_CLI::add_wp_hook() +description: "Add a callback to a WordPress action or filter." +--- + +Docs » Internal API » Registration + +## WP_CLI::add_wp_hook() + +Add a callback to a WordPress action or filter. + +*** + +### Usage + + WP_CLI::add_wp_hook( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) + +
+$tag (string) Named WordPress action or filter.
+$function_to_add (mixed) Callable to execute when the action or filter is evaluated.
+$priority (integer) Priority to add the callback as.
+$accepted_args (integer) Number of arguments to pass to callback.
+@return (true)
+
+ + +*** + +### Notes + +`add_action()` without needing access to `add_action()`. If WordPress is +already loaded though, you should use `add_action()` (and `add_filter()`) +instead. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-colorize/index.md b/docs/internal-api/wp-cli-colorize/index.md new file mode 100644 index 00000000..2a561a47 --- /dev/null +++ b/docs/internal-api/wp-cli-colorize/index.md @@ -0,0 +1,115 @@ +--- +layout: default +title: WP_CLI::colorize() +description: "Colorize a string for output." +--- + +Docs » Internal API » Output + +## WP_CLI::colorize() + +Colorize a string for output. + +*** + +### Usage + + WP_CLI::colorize( $string ) + +
+$string (string) String to colorize for output, with color tokens.
+@return (string) string.
+
+ + +*** + +### Notes + +Yes, you too can change the color of command line text. For instance, +here's how `WP_CLI::success()` colorizes "Success: " + + + WP_CLI::colorize( "%GSuccess:%n " ) + + +Uses `\cli\Colors::colorize()` to transform color tokens to display +settings. Choose from the following tokens (and note 'reset'): + +* %y => ['color' => 'yellow'], +* %g => ['color' => 'green'], +* %b => ['color' => 'blue'], +* %r => ['color' => 'red'], +* %p => ['color' => 'magenta'], +* %m => ['color' => 'magenta'], +* %c => ['color' => 'cyan'], +* %w => ['color' => 'grey'], +* %k => ['color' => 'black'], +* %n => ['color' => 'reset'], +* %Y => ['color' => 'yellow', 'style' => 'bright'], +* %G => ['color' => 'green', 'style' => 'bright'], +* %B => ['color' => 'blue', 'style' => 'bright'], +* %R => ['color' => 'red', 'style' => 'bright'], +* %P => ['color' => 'magenta', 'style' => 'bright'], +* %M => ['color' => 'magenta', 'style' => 'bright'], +* %C => ['color' => 'cyan', 'style' => 'bright'], +* %W => ['color' => 'grey', 'style' => 'bright'], +* %K => ['color' => 'black', 'style' => 'bright'], +* %N => ['color' => 'reset', 'style' => 'bright'], +* %3 => ['background' => 'yellow'], +* %2 => ['background' => 'green'], +* %4 => ['background' => 'blue'], +* %1 => ['background' => 'red'], +* %5 => ['background' => 'magenta'], +* %6 => ['background' => 'cyan'], +* %7 => ['background' => 'grey'], +* %0 => ['background' => 'black'], +* %F => ['style' => 'blink'], +* %U => ['style' => 'underline'], +* %8 => ['style' => 'inverse'], +* %9 => ['style' => 'bright'], +* %_ => ['style' => 'bright') + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-confirm/index.md b/docs/internal-api/wp-cli-confirm/index.md new file mode 100644 index 00000000..eaae49cd --- /dev/null +++ b/docs/internal-api/wp-cli-confirm/index.md @@ -0,0 +1,65 @@ +--- +layout: default +title: WP_CLI::confirm() +description: "Ask for confirmation before running a destructive operation." +--- + +Docs » Internal API » Input + +## WP_CLI::confirm() + +Ask for confirmation before running a destructive operation. + +*** + +### Usage + + WP_CLI::confirm( $question, $assoc_args = array() ) + +
+$question (string) Question to display before the prompt.
+$assoc_args (array) Skips prompt if 'yes' is provided.
+
+ + +*** + +### Notes + +If 'y' is provided to the question, the script execution continues. If +'n' or any other response is provided to the question, script exits. + + + # `wp db drop` asks for confirmation before dropping the database. + + WP_CLI::confirm( "Are you sure you want to drop the database?", $assoc_args ); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-debug/index.md b/docs/internal-api/wp-cli-debug/index.md new file mode 100644 index 00000000..e62d7cdb --- /dev/null +++ b/docs/internal-api/wp-cli-debug/index.md @@ -0,0 +1,91 @@ +--- +layout: default +title: WP_CLI::debug() +description: "Display debug message prefixed with "Debug: " when `--debug` is used." +--- + +Docs » Internal API » Output + +## WP_CLI::debug() + +Display debug message prefixed with "Debug: " when `--debug` is used. + +*** + +### Usage + + WP_CLI::debug( $message, $group = false ) + +
+$message (string) Message to write to STDERR.
+$group (string) Organize debug message to a specific group.
+@return (null)
+
+ + +*** + +### Notes + +Debug message is written to STDERR, and includes script execution time. + +Helpful for optionally showing greater detail when needed. Used throughout +WP-CLI bootstrap process for easier debugging and profiling. + + + # Called in `WP_CLI\Runner::set_wp_root()`. + private static function set_wp_root( $path ) { + define( 'ABSPATH', rtrim( $path, '/' ) . '/' ); + WP_CLI::debug( 'ABSPATH defined: ' . ABSPATH ); + $_SERVER['DOCUMENT_ROOT'] = realpath( $path ); + } + + # Debug details only appear when `--debug` is used. + # $ wp --debug + # [...] + # Debug: ABSPATH defined: /srv/www/wordpress-develop.dev/src/ (0.225s) + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-do-hook/index.md b/docs/internal-api/wp-cli-do-hook/index.md new file mode 100644 index 00000000..13d8ad13 --- /dev/null +++ b/docs/internal-api/wp-cli-do-hook/index.md @@ -0,0 +1,56 @@ +--- +layout: default +title: WP_CLI::do_hook() +description: "Execute callbacks registered to a given hook." +--- + +Docs » Internal API » Registration + +## WP_CLI::do_hook() + +Execute callbacks registered to a given hook. + +*** + +### Usage + + WP_CLI::do_hook( $when ) + +
+$when (string) Identifier for the hook.
+@return (null)
+
+ + +*** + +### Notes + +See `WP_CLI::add_hook()` for details on WP-CLI's internal hook system. +Commands can provide and call their own hooks. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-error-multi-line/index.md b/docs/internal-api/wp-cli-error-multi-line/index.md new file mode 100644 index 00000000..dab691b3 --- /dev/null +++ b/docs/internal-api/wp-cli-error-multi-line/index.md @@ -0,0 +1,72 @@ +--- +layout: default +title: WP_CLI::error_multi_line() +description: "Display a multi-line error message in a red box. Doesn't exit script." +--- + +Docs » Internal API » Output + +## WP_CLI::error_multi_line() + +Display a multi-line error message in a red box. Doesn't exit script. + +*** + +### Usage + + WP_CLI::error_multi_line( $message_lines ) + +
+$message (array) Multi-line error message to be displayed.
+
+ + +*** + +### Notes + +Error message is written to STDERR. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-error/index.md b/docs/internal-api/wp-cli-error/index.md new file mode 100644 index 00000000..802e842d --- /dev/null +++ b/docs/internal-api/wp-cli-error/index.md @@ -0,0 +1,85 @@ +--- +layout: default +title: WP_CLI::error() +description: "Display error message prefixed with "Error: " and exit script." +--- + +Docs » Internal API » Output + +## WP_CLI::error() + +Display error message prefixed with "Error: " and exit script. + +*** + +### Usage + + WP_CLI::error( $message, $exit = true ) + +
+$message (string|WP_Error) Message to write to STDERR.
+$exit (boolean|integer) True defaults to exit(1).
+@return (null)
+
+ + +*** + +### Notes + +Error message is written to STDERR. Defaults to halting script execution +with return code 1. + +Use `WP_CLI::warning()` instead when script execution should be permitted +to continue. + + + # `wp cache flush` considers flush failure to be a fatal error. + if ( false === wp_cache_flush() ) { + WP_CLI::error( 'The object cache could not be flushed.' ); + } + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-get-config/index.md b/docs/internal-api/wp-cli-get-config/index.md new file mode 100644 index 00000000..4cefdd19 --- /dev/null +++ b/docs/internal-api/wp-cli-get-config/index.md @@ -0,0 +1,63 @@ +--- +layout: default +title: WP_CLI::get_config() +description: "Get values of global configuration parameters." +--- + +Docs » Internal API » Input + +## WP_CLI::get_config() + +Get values of global configuration parameters. + +*** + +### Usage + + WP_CLI::get_config( $key = null ) + +
+$key (string) Get value for a specific global configuration parameter.
+@return (mixed)
+
+ + +*** + +### Notes + +Provides access to `--path=`, `--url=`, and other values of +the [global configuration parameters](https://wp-cli.org/config/). + + + WP_CLI::log( 'The --url= value is: ' . WP_CLI::get_config( 'url' ) ); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-get-php-binary/index.md b/docs/internal-api/wp-cli-get-php-binary/index.md new file mode 100644 index 00000000..56259e6f --- /dev/null +++ b/docs/internal-api/wp-cli-get-php-binary/index.md @@ -0,0 +1,48 @@ +--- +layout: default +title: WP_CLI::get_php_binary() +description: "Get the path to the PHP binary used when executing WP-CLI." +--- + +Docs » Internal API » System + +## WP_CLI::get_php_binary() + +Get the path to the PHP binary used when executing WP-CLI. + +*** + +### Usage + + WP_CLI::get_php_binary() + +
+@return (string)
+
+ + +*** + +### Notes + +Environment values permit specific binaries to be indicated. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-launch-self/index.md b/docs/internal-api/wp-cli-launch-self/index.md new file mode 100644 index 00000000..f1cd813e --- /dev/null +++ b/docs/internal-api/wp-cli-launch-self/index.md @@ -0,0 +1,60 @@ +--- +layout: default +title: WP_CLI::launch_self() +description: "Run a WP-CLI command in a new process reusing the current runtime arguments." +--- + +Docs » Internal API » Execution + +## WP_CLI::launch_self() + +Run a WP-CLI command in a new process reusing the current runtime arguments. + +*** + +### Usage + + WP_CLI::launch_self( $command, $args = array(), $assoc_args = array(), $exit_on_error = true, $return_detailed = false, $runtime_args = array() ) + +
+$command (string) WP-CLI command to call.
+$args (array) Positional arguments to include when calling the command.
+$assoc_args (array) Associative arguments to include when calling the command.
+$exit_on_error (bool) Whether to exit if the command returns an elevated return code.
+$return_detailed (bool) Whether to return an exit status (default) or detailed execution results.
+$runtime_args (array) Override one or more global args (path,url,user,allow-root)
+@return (int|ProcessRun) command exit status, or a ProcessRun instance
+
+ + +*** + +### Notes + +Note: While this command does persist a limited set of runtime arguments, +it *does not* persist environment variables. Practically speaking, WP-CLI +packages won't be loaded when using WP_CLI::launch_self() because the +launched process doesn't have access to the current process $HOME. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + +
    + + + +
  • WP_CLI::launch() - Launch an arbitrary external process that takes over I/O.
  • + + +
  • WP_CLI::run_command() - Run a given command within the current process using the same global
  • + + + +
+ + diff --git a/docs/internal-api/wp-cli-launch/index.md b/docs/internal-api/wp-cli-launch/index.md new file mode 100644 index 00000000..15ea2054 --- /dev/null +++ b/docs/internal-api/wp-cli-launch/index.md @@ -0,0 +1,61 @@ +--- +layout: default +title: WP_CLI::launch() +description: "Launch an arbitrary external process that takes over I/O." +--- + +Docs » Internal API » Execution + +## WP_CLI::launch() + +Launch an arbitrary external process that takes over I/O. + +*** + +### Usage + + WP_CLI::launch( $command, $exit_on_error = true, $return_detailed = false ) + +
+$command (string) External process to launch.
+$exit_on_error (boolean) Whether to exit if the command returns an elevated return code.
+$return_detailed (boolean) Whether to return an exit status (default) or detailed execution results.
+@return (int|ProcessRun) command exit status, or a ProcessRun object for full details.
+
+ + +*** + +### Notes + + + # `wp core download` falls back to the `tar` binary when PharData isn't available + if ( ! class_exists( 'PharData' ) ) { + $cmd = "tar xz --strip-components=1 --directory=%s -f $tarball"; + WP_CLI::launch( Utils\esc_cmd( $cmd, $dest ) ); + return; + } + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + +
    + + + +
  • WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments.
  • + + +
  • WP_CLI::run_command() - Run a given command within the current process using the same global
  • + + + +
+ + diff --git a/docs/internal-api/wp-cli-line/index.md b/docs/internal-api/wp-cli-line/index.md new file mode 100644 index 00000000..a3088dce --- /dev/null +++ b/docs/internal-api/wp-cli-line/index.md @@ -0,0 +1,74 @@ +--- +layout: default +title: WP_CLI::line() +description: "Display informational message without prefix, and ignore `--quiet`." +--- + +Docs » Internal API » Output + +## WP_CLI::line() + +Display informational message without prefix, and ignore `--quiet`. + +*** + +### Usage + + WP_CLI::line( $message = '' ) + +
+$message (string) Message to display to the end user.
+@return (null)
+
+ + +*** + +### Notes + +Message is written to STDOUT. `WP_CLI::log()` is typically recommended; +`WP_CLI::line()` is included for historical compat. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-log/index.md b/docs/internal-api/wp-cli-log/index.md new file mode 100644 index 00000000..486061ee --- /dev/null +++ b/docs/internal-api/wp-cli-log/index.md @@ -0,0 +1,77 @@ +--- +layout: default +title: WP_CLI::log() +description: "Display informational message without prefix." +--- + +Docs » Internal API » Output + +## WP_CLI::log() + +Display informational message without prefix. + +*** + +### Usage + + WP_CLI::log( $message ) + +
+$message (string) Message to write to STDOUT.
+
+ + +*** + +### Notes + +Message is written to STDOUT, or discarded when `--quiet` flag is supplied. + + + # `wp cli update` lets user know of each step in the update process. + WP_CLI::log( sprintf( 'Downloading from %s...', $download_url ) ); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-read-value/index.md b/docs/internal-api/wp-cli-read-value/index.md new file mode 100644 index 00000000..6aa738f5 --- /dev/null +++ b/docs/internal-api/wp-cli-read-value/index.md @@ -0,0 +1,51 @@ +--- +layout: default +title: WP_CLI::read_value() +description: "Read a value, from various formats." +--- + +Docs » Internal API » Input + +## WP_CLI::read_value() + +Read a value, from various formats. + +*** + +### Usage + + WP_CLI::read_value( $raw_value, $assoc_args = array() ) + +
+$value (mixed)
+$assoc_args (array)
+
+ + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-run-command/index.md b/docs/internal-api/wp-cli-run-command/index.md new file mode 100644 index 00000000..5859ef67 --- /dev/null +++ b/docs/internal-api/wp-cli-run-command/index.md @@ -0,0 +1,62 @@ +--- +layout: default +title: WP_CLI::run_command() +description: "Run a given command within the current process using the same global" +--- + +Docs » Internal API » Execution + +## WP_CLI::run_command() + +Run a given command within the current process using the same global + +*** + +### Usage + + WP_CLI::run_command( $args, $assoc_args = array() ) + +
+$args (array) Positional arguments including command name.
+$assoc_args (array)
+
+ + +*** + +### Notes + +parameters. + +To run a command using a new process with the same global parameters, +use WP_CLI::launch_self(). To run a command using a new process with +different global parameters, use WP_CLI::launch(). + + + ob_start(); + WP_CLI::run_command( array( 'cli', 'cmd-dump' ) ); + $ret = ob_get_clean(); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + +
    + + + +
  • WP_CLI::launch() - Launch an arbitrary external process that takes over I/O.
  • + + +
  • WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments.
  • + + + +
+ + diff --git a/docs/internal-api/wp-cli-success/index.md b/docs/internal-api/wp-cli-success/index.md new file mode 100644 index 00000000..f66dc95a --- /dev/null +++ b/docs/internal-api/wp-cli-success/index.md @@ -0,0 +1,85 @@ +--- +layout: default +title: WP_CLI::success() +description: "Display success message prefixed with "Success: "." +--- + +Docs » Internal API » Output + +## WP_CLI::success() + +Display success message prefixed with "Success: ". + +*** + +### Usage + + WP_CLI::success( $message ) + +
+$message (string) Message to write to STDOUT.
+@return (null)
+
+ + +*** + +### Notes + +Success message is written to STDOUT. + +Typically recommended to inform user of successful script conclusion. + + + # wp rewrite flush expects 'rewrite_rules' option to be set after flush. + flush_rewrite_rules( \WP_CLI\Utils\get_flag_value( $assoc_args, 'hard' ) ); + if ( ! get_option( 'rewrite_rules' ) ) { + WP_CLI::warning( "Rewrite rules are empty." ); + } else { + WP_CLI::success( 'Rewrite rules flushed.' ); + } + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-format-items/index.md b/docs/internal-api/wp-cli-utils-format-items/index.md new file mode 100644 index 00000000..dda47075 --- /dev/null +++ b/docs/internal-api/wp-cli-utils-format-items/index.md @@ -0,0 +1,107 @@ +--- +layout: default +title: WP_CLI\Utils\format_items() +description: "Render a collection of items as an ASCII table, JSON, CSV, YAML, list of ids, or count." +--- + +Docs » Internal API » Output + +## WP_CLI\Utils\format_items() + +Render a collection of items as an ASCII table, JSON, CSV, YAML, list of ids, or count. + +*** + +### Usage + + WP_CLI\Utils\format_items( $format, $items, $fields ) + +
+$format (string) Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count'
+$items (array) An array of items to output.
+$fields (array|string) Named fields for each item of data. Can be array or comma-separated list.
+@return (null)
+
+ + +*** + +### Notes + +Given a collection of items with a consistent data structure: + + + $items = array( + array( + 'key' => 'foo', + 'value' => 'bar', + ) + ); + + +Render `$items` as an ASCII table: + + + WP_CLI\Utils\format_items( 'table', $items, array( 'key', 'value' ) ); + + # +-----+-------+ + # | key | value | + # +-----+-------+ + # | foo | bar | + # +-----+-------+ + + +Or render `$items` as YAML: + + + WP_CLI\Utils\format_items( 'yaml', $items, array( 'key', 'value' ) ); + + # --- + # - + # key: foo + # value: bar + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-get-flag-value/index.md b/docs/internal-api/wp-cli-utils-get-flag-value/index.md new file mode 100644 index 00000000..acd44ab6 --- /dev/null +++ b/docs/internal-api/wp-cli-utils-get-flag-value/index.md @@ -0,0 +1,62 @@ +--- +layout: default +title: WP_CLI\Utils\get_flag_value() +description: "Return the flag value or, if it's not set, the $default value." +--- + +Docs » Internal API » Input + +## WP_CLI\Utils\get_flag_value() + +Return the flag value or, if it's not set, the $default value. + +*** + +### Usage + + WP_CLI\Utils\get_flag_value( $assoc_args, $flag, $default = null ) + +
+$assoc_args (array) Arguments array.
+$flag (string) Flag to get the value.
+$default (mixed) Default value for the flag. Default: NULL
+@return (mixed)
+
+ + +*** + +### Notes + +Because flags can be negated (e.g. --no-quiet to negate --quiet), this +function provides a safer alternative to using +`isset( $assoc_args['quiet'] )` or similar. + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-get-named-sem-ver/index.md b/docs/internal-api/wp-cli-utils-get-named-sem-ver/index.md new file mode 100644 index 00000000..d9e3c0be --- /dev/null +++ b/docs/internal-api/wp-cli-utils-get-named-sem-ver/index.md @@ -0,0 +1,49 @@ +--- +layout: default +title: WP_CLI\Utils\get_named_sem_ver() +description: "Compare two version strings to get the named semantic version." +--- + +Docs » Internal API » Misc + +## WP_CLI\Utils\get_named_sem_ver() + +Compare two version strings to get the named semantic version. + +*** + +### Usage + + WP_CLI\Utils\get_named_sem_ver( $new_version, $original_version ) + +
+$new_version (string)
+$original_version (string)
+@return (string) 'major', 'minor', 'patch'
+
+ + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-get-temp-dir/index.md b/docs/internal-api/wp-cli-utils-get-temp-dir/index.md new file mode 100644 index 00000000..89a351ff --- /dev/null +++ b/docs/internal-api/wp-cli-utils-get-temp-dir/index.md @@ -0,0 +1,41 @@ +--- +layout: default +title: WP_CLI\Utils\get_temp_dir() +description: "Get the system's temp directory. Warns user if it isn't writable." +--- + +Docs » Internal API » System + +## WP_CLI\Utils\get_temp_dir() + +Get the system's temp directory. Warns user if it isn't writable. + +*** + +### Usage + + WP_CLI\Utils\get_temp_dir() + +
+@return (string)
+
+ + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-http-request/index.md b/docs/internal-api/wp-cli-utils-http-request/index.md new file mode 100644 index 00000000..d867df14 --- /dev/null +++ b/docs/internal-api/wp-cli-utils-http-request/index.md @@ -0,0 +1,67 @@ +--- +layout: default +title: WP_CLI\Utils\http_request() +description: "Make a HTTP request to a remote URL." +--- + +Docs » Internal API » Misc + +## WP_CLI\Utils\http_request() + +Make a HTTP request to a remote URL. + +*** + +### Usage + + WP_CLI\Utils\http_request( $method, $url, $data = null, $headers = array(), $options = array() ) + +
+$method (string) HTTP method (GET, POST, DELETE, etc.)
+$url (string) URL to make the HTTP request to.
+$headers (array) Add specific headers to the request.
+$options (array)
+@return (object)
+
+ + +*** + +### Notes + +Wraps the Requests HTTP library to ensure every request includes a cert. + + + # `wp core download` verifies the hash for a downloaded WordPress archive + + $md5_response = Utils\http_request( 'GET', $download_url . '.md5' ); + if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { + WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$response->status_code})" ); + } + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-launch-editor-for-input/index.md b/docs/internal-api/wp-cli-utils-launch-editor-for-input/index.md new file mode 100644 index 00000000..3ba34bf1 --- /dev/null +++ b/docs/internal-api/wp-cli-utils-launch-editor-for-input/index.md @@ -0,0 +1,51 @@ +--- +layout: default +title: WP_CLI\Utils\launch_editor_for_input() +description: "Launch system's $EDITOR for the user to edit some text." +--- + +Docs » Internal API » Input + +## WP_CLI\Utils\launch_editor_for_input() + +Launch system's $EDITOR for the user to edit some text. + +*** + +### Usage + + WP_CLI\Utils\launch_editor_for_input( $input, $filename = WP-CLI ) + +
+string () $content Some form of text to edit (e.g. post content)
+@return (string|bool) text, if file is saved from editor; false, if no change to file.
+
+ + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-make-progress-bar/index.md b/docs/internal-api/wp-cli-utils-make-progress-bar/index.md new file mode 100644 index 00000000..4cd597a4 --- /dev/null +++ b/docs/internal-api/wp-cli-utils-make-progress-bar/index.md @@ -0,0 +1,90 @@ +--- +layout: default +title: WP_CLI\Utils\make_progress_bar() +description: "Create a progress bar to display percent completion of a given operation." +--- + +Docs » Internal API » Output + +## WP_CLI\Utils\make_progress_bar() + +Create a progress bar to display percent completion of a given operation. + +*** + +### Usage + + WP_CLI\Utils\make_progress_bar( $message, $count ) + +
+$message (string) Text to display before the progress bar.
+$count (integer) Total number of ticks to be performed.
+@return (cli\progress\Bar|WP_CLI\NoOp)
+
+ + +*** + +### Notes + +Progress bar is written to STDOUT, and disabled when command is piped. Progress +advances with `$progress->tick()`, and completes with `$progress->finish()`. +Process bar also indicates elapsed time and expected total time. + + + # `wp user generate` ticks progress bar each time a new user is created. + # + # $ wp user generate --count=500 + # Generating users 22 % [=======> ] 0:05 / 0:23 + + $progress = \WP_CLI\Utils\make_progress_bar( 'Generating users', $count ); + for ( $i = 0; $i < $count; $i++ ) { + // uses wp_insert_user() to insert the user + $progress->tick(); + } + $progress->finish(); + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-parse-ssh-url/index.md b/docs/internal-api/wp-cli-utils-parse-ssh-url/index.md new file mode 100644 index 00000000..6e68a9c0 --- /dev/null +++ b/docs/internal-api/wp-cli-utils-parse-ssh-url/index.md @@ -0,0 +1,58 @@ +--- +layout: default +title: WP_CLI\Utils\parse_ssh_url() +description: "Parse a SSH url for its host, port, and path." +--- + +Docs » Internal API » Misc + +## WP_CLI\Utils\parse_ssh_url() + +Parse a SSH url for its host, port, and path. + +*** + +### Usage + + WP_CLI\Utils\parse_ssh_url( $url, $component = -1 ) + +
+@return (mixed)
+
+ + +*** + +### Notes + +Similar to parse_url(), but adds support for defined SSH aliases. + + + host OR host/path/to/wordpress OR host:port/path/to/wordpress + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-utils-write-csv/index.md b/docs/internal-api/wp-cli-utils-write-csv/index.md new file mode 100644 index 00000000..d6c7891a --- /dev/null +++ b/docs/internal-api/wp-cli-utils-write-csv/index.md @@ -0,0 +1,49 @@ +--- +layout: default +title: WP_CLI\Utils\write_csv() +description: "Write data as CSV to a given file." +--- + +Docs » Internal API » Misc + +## WP_CLI\Utils\write_csv() + +Write data as CSV to a given file. + +*** + +### Usage + + WP_CLI\Utils\write_csv( $fd, $rows, $headers = array() ) + +
+$fd (resource) File descriptor
+$rows (array) Array of rows to output
+$headers (array) List of CSV columns (optional)
+
+ + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/internal-api/wp-cli-warning/index.md b/docs/internal-api/wp-cli-warning/index.md new file mode 100644 index 00000000..bfccf1ca --- /dev/null +++ b/docs/internal-api/wp-cli-warning/index.md @@ -0,0 +1,86 @@ +--- +layout: default +title: WP_CLI::warning() +description: "Display warning message prefixed with "Warning: "." +--- + +Docs » Internal API » Output + +## WP_CLI::warning() + +Display warning message prefixed with "Warning: ". + +*** + +### Usage + + WP_CLI::warning( $message ) + +
+$message (string) Message to write to STDERR.
+@return (null)
+
+ + +*** + +### Notes + +Warning message is written to STDERR. + +Use instead of `WP_CLI::debug()` when script execution should be permitted +to continue. + + + # `wp plugin activate` skips activation when plugin is network active. + $status = $this->get_status( $plugin->file ); + // Network-active is the highest level of activation status + if ( 'active-network' === $status ) { + WP_CLI::warning( "Plugin '{$plugin->name}' is already network active." ); + continue; + } + + + +*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.* + + +*** + +### Related + + + + diff --git a/docs/philosophy/index.md b/docs/philosophy/index.md new file mode 100644 index 00000000..f4f96f77 --- /dev/null +++ b/docs/philosophy/index.md @@ -0,0 +1,32 @@ +--- +layout: doc +title: Philosophy +category: Contributing +description: Guidelines which inform project scope, command organization, and behavior. +--- + +This page contains a list of guidelines that should inform decisions related to scope, command organization and behaviour: + +## Don't assume anything. + +Bundled commands MUST work on any given WordPress install (provided that it's a new enough version), no matter how it's configured and no matter how much data it has. + +As a corollary, bundled commands should not assume the presence of any plugin or theme. + +## Composability is always a good idea. + +One of the most useful ideas in UNIX was that of [pipelines](http://en.wikipedia.org/wiki/Pipeline_%28Unix%29). + +WP-CLI commands should be composable, i.e. the output from one command should be easily pipe-able to another command. + +A corollary of this is that commands should be _orthogonal_, which means that there should be no overlapping functionality between commands. (`wp plugin install --activate` is an exception). + +## Readability trumps number of keystrokes. + +Most of the commands in WP-CLI will be used non-interactively, so make the parameter names self-documenting. + +## Stay focused. + +Bundled commands should expose or make use of WordPress-specific functionality. + +If a command provides useful functionality, but it doesn't have anything to do with WordPress, it doesn't belong in WP-CLI. diff --git a/docs/plugin-unit-tests/index.md b/docs/plugin-unit-tests/index.md new file mode 100644 index 00000000..3106fd77 --- /dev/null +++ b/docs/plugin-unit-tests/index.md @@ -0,0 +1,48 @@ +--- +layout: doc +title: Plugin unit tests +description: How to set up and run PHPUnit tests for a WordPress plugin. +category: Misc +--- + +This guide will demonstrate how to: + +* set up unit tests for an existing plugin, using WP-CLI +* run the tests locally + +We're going to assume that you already have a plugin called `my-plugin`. + +So, let's get started: + +1) [Install PHPUnit](https://github.com/sebastianbergmann/phpunit#installation) (4.8.x required, 5.x not supported). + +2) Generate the plugin test files: + + wp scaffold plugin-tests my-plugin + +This command will generate all the files needed for running tests, including a `.travis.yml` file. If you host your plugin on Github and enable [Travis CI](http://about.travis-ci.org), the tests will be run automatically after every commit you make to the plugin. + +3) Initialize the testing environment locally: + +(you'll need to already have `svn` and `wget` available) + + cd $(wp plugin path my-plugin --dir) + bash bin/install-wp-tests.sh wordpress_test root '' localhost latest + +where: + +* `wordpress_test` is the name of the test database (**all data will be deleted!**) +* `root` is the MySQL user name +* `''` is the MySQL user password +* `localhost` is the MySQL server host +* `latest` is the WordPress version; could also be `3.7`, `3.6.2` etc. + +This script does a couple things. First it installs a copy of WordPress in the `tmp/` directory (by default) as well as the WordPress unit testing tools. Then it creates a database to be used while running tests. + +NOTE: This script can be run multiple times without errors, but it will *not* overwrite previously existing files. So if your DB credentials change, or you want to switch to a different instance of mysql, simply re-running the script won't be enough. You'll need to manually edit the `wp-config.php` that's installed in the `tmp/`. + +4) Run the plugin tests: + + phpunit + +**Note**: phpunit 4.8.x is required (5.x won't work) diff --git a/docs/pull-requests/index.md b/docs/pull-requests/index.md new file mode 100644 index 00000000..b255f00d --- /dev/null +++ b/docs/pull-requests/index.md @@ -0,0 +1,96 @@ +--- +layout: doc +title: Pull Requests +category: Contributing +description: Submit your first bug fix or new feature. +--- + +WP-CLI follows a pull request workflow for changes to its code (and documentation). Whether you want to fix a bug or implement a new feature, the process is pretty much the same: + +0. [Search existing issues](https://github.com/wp-cli/wp-cli/issues); if you can't find anything related to what you want to work on, open a new issue so that you can get some initial feedback. +1. [Fork](https://github.com/wp-cli/wp-cli/fork) the repository. +2. Create a branch for each issue you'd like to address. Commit your changes. +3. Push the code changes from your local clone to your fork. +4. Open a pull request. + +New to WP-CLI commands? You may want to [start with the commands cookbook](/docs/commands-cookbook/) to learn more about how commands work. + +It doesn't matter if the code isn't perfect. The idea is to get it reviewed early and iterate on it. + +If you're adding a new feature, please add one or more functional tests for it in the `features/` directory. See below. + +Lastly, please follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/). + +## Setting up + +If you haven't submitted a pull request before, you'll want to install WP-CLI for local development: + +1. Clone this git repository on your local machine. +2. Install [Composer](https://getcomposer.org/) if you don't already have it. +3. Run `composer install` to fetch all the dependencies. +4. Run `./bin/wp --info` to test if everything was installed properly. + +## Running and writing tests + +There are two types of automated tests: + +* functional tests, implemented using [Behat](http://behat.org) +* unit tests, implemented using [PHPUnit](http://phpunit.de/) + +### Functional tests + +The functional test files for WP-CLI are in the `features/` directory. Each `.feature` file comprises one or more functional tests for a given feature (roughly organized by command). + +A functional test can be as simple as: + +``` +Feature: Evaluating PHP code and files. + + Scenario: Basics + Given a WP install + + When I run `wp eval 'var_dump(defined("WP_CONTENT_DIR"));'` + Then STDOUT should contain: + """ + bool(true) + """ +``` + +Functional tests typically follow this pattern: + +* **Given** some background, +* **When** a user performs a specific action, +* **Then** the end result should be X (and Y and Z). + +Before running the functional tests, you'll need a MySQL (or MariaDB) user called `wp_cli_test` with the password `password1` that has full privileges on the MySQL database `wp_cli_test`. Running the following as root in MySQL should do the trick: + + GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"; + +Then, to run the entire test suite: + + ./vendor/bin/behat --expand + +Or to test a single feature: + + ./vendor/bin/behat features/core.feature + +More info can be found by using `./vendor/bin/behat --help`. + +### Unit tests + +The unit test files are in the `tests/` directory. + +To run the unit tests, just execute: + + ./vendor/bin/phpunit + + +## Abandoned pull requests + +We'll work with you to make sure your pull request is ready for merge. But if changes are needed and we haven't heard from you in **two weeks**, we'll consider the pull request abandoned. Someone else may pick it up and make the changes required. Or it may be closed. + +If you need to step away for any reason, make a comment on the pull request or the related issue so we can pick things up or put things on hold when needed. + +## Finally... + +Thanks! Hacking on WP-CLI should be fun. If you find any of this hard to figure out, let us know so we can improve our process or documentation! diff --git a/docs/quick-start/index.md b/docs/quick-start/index.md new file mode 100644 index 00000000..09bfa4e5 --- /dev/null +++ b/docs/quick-start/index.md @@ -0,0 +1,80 @@ +--- +layout: doc +title: Quick start +description: Where to begin after you've installed WP-CLI for the first time. +category: Guides +quick_links: + - Introduction + - Common Terms + - Example Usage +--- + +Congratulations! You've [installed WP-CLI](/docs/installing/) for the first time, and are ready to level-up your use of WordPress. This page contains a brief introduction to WP-CLI with some example usage. + +## Introduction + +WP-CLI is a command line interface for WordPress. The project's goal is to offer a complete alternative to the WordPress admin; for any action you might want to perform in the WordPress admin, there should be an equivalent WP-CLI command. + +For instance, because you can install a plugin from the WordPress admin, you can also [install a plugin](/commands/plugin/install/) with WP-CLI: + + $ wp plugin install akismet + Installing Akismet (3.1.8) + Downloading install package from https://downloads.wordpress.org/plugin/akismet.3.1.8.zip... + Unpacking the package... + Installing the plugin... + Plugin installed successfully. + +And, because you can also activate plugins from the WordPress admin, you can [activate a plugin](/commands/plugin/activate/) with WP-CLI: + + $ wp plugin activate akismet + Success: Plugin 'akismet' activated. + +One key difference between using the WordPress admin and WP-CLI: performing any action takes many fewer clicks. As you become more familiar with the command line, you'll notice performing a given task with WP-CLI is generally much faster than performing the same task through the WordPress admin. Investing time upfront into learning how to better use WP-CLI pays dividends in the long term. + +## Common Terms + +Throughout your usage of WP-CLI, you'll hear certain terms used over and over again. + +For instance, a _command_ is an atomic unit of WP-CLI functionality. `wp plugin install` is one such command, as is `wp plugin activate`. Commands represent a name (e.g. 'plugin install') and a callback, and are registered with `WP_CLI::add_command()` ([doc](/docs/internal-api/wp-cli-add-command/)). + +The _synopsis_ defines which _positional_ and _associative_ arguments a command accepts. Let's take a look at the synopsis for `wp plugin install`: + + $ wp plugin install + usage: wp plugin install ... [--version=] [--force] [--activate] [--activate-network] + +In this example, `...` is the accepted _positional_ argument. In fact, `wp plugin install` accepts the same positional argument (the slug, ZIP, or URL of a plugin to install) multiple times. `[--version=]` is one of the accepted _associative_ arguments. It's used to denote the version of the plugin to install. Notice, too, the square brackets around the argument definition; square brackets mean the argument is optional. + +WP-CLI also has a [series of _global_ arguments](/config/) which work with all commands. For instance, including `--debug` means your command execution will display all PHP errors, and add extra verbosity to the WP-CLI bootstrap process. + +## Example Usage + +Ready to dive in? Here are some examples of common WP-CLI commands: + +### Download latest [en_US] version of WordPress into the current folder + + wp core download + +If you have WordPress already installed in the current folder: + + wp core download --force + +### Create WXR export files from site in a multisite install to current directory + + wp export --url=sub.domain.com + +### Import WXR file from current directory into a specific site in a multisite install, create authors and skip image resize + + wp import domain.wordpress.2014-01-01.xml --authors=create --skip="image_resize" --url=sub.domain.com + +### Regenerate all thumbnails for a specific site in a multisite install + + wp media regenerate --url=sub.domain.com --yes + +### Delete all pages + + wp post list --post_type=page --field=ID | xargs wp post delete + +and for a specific site in a multisite install: + + WP='wp --url=sub.domain.com' + $WP post list --post_type=page --field=ID | xargs $WP post delete diff --git a/docs/release-checklist/index.md b/docs/release-checklist/index.md new file mode 100644 index 00000000..92498e26 --- /dev/null +++ b/docs/release-checklist/index.md @@ -0,0 +1,116 @@ +--- +layout: doc +title: Release checklist +description: Tasks performed during the process of tagging a release. +category: Contributing +quick_links: + - Major/minor releases + - Patch releases +--- + +This page describes the list of activities that developers must perform to produce a new release of WP-CLI. + +## Major/minor releases + +### Updating WP-CLI + +Make sure that the contents of [VERSION](https://github.com/wp-cli/wp-cli/blob/master/VERSION) are changed to latest. + +### Locking php-cli-tools version + +php-cli-tools is set to `dev-master` during the development cycle. During the WP-CLI release process, `composer.json` should be locked to a specific version. php-cli-tools may need a new version tagged as well. + +### Updating the contributor list + +Use `./utils/contrib-list` to see new contributors. Update the `.mailmap` file so that the names match their github handles. + +When done, use `sort .mailmap -f -u -o .mailmap` to only add new contributors. + +### Updating the Phar build + +1) Create a git tag and push it. + +2) Create a stable [Phar build](https://github.com/wp-cli/builds/tree/gh-pages/phar): + + cd wp-cli-builds/phar + cp wp-cli-nightly.phar wp-cli.phar + md5 -q wp-cli.phar > wp-cli.phar.md5 + shasum -a 512 wp-cli.phar | cut -d ' ' -f 1 > wp-cli.phar.sha512 + +3) Sign the release with GPG. See + + gpg --output wp-cli.phar.gpg --sign wp-cli.phar + +4) Create a release on Github: . Make sure to upload the Phar from the builds directory. + + cp wp-cli.phar wp-cli-0.24.0.phar + cp wp-cli.phar.gpg wp-cli-0.24.0.phar.gpg + cp wp-cli.phar.md5 wp-cli-0.24.0.phar.md5 + cp wp-cli.phar.sha512 wp-cli-0.24.0.phar.sha512 + +### Updating the Debian build + +1) Run this script: + +2) Symlink the latest deb: `ln -sfv php-wpcli_${VERSION}_all.deb php-wpcli_latest_all.deb` + +3) Commit file to builds repo + +### Updating the Homebrew formula + +A pull request must be submitted to the Homebrew repo. This involves: + +* Updating the url and sha256 here: https://github.com/Homebrew/homebrew-php/blob/master/Formula/wp-cli.rb#L8-L9 +* Making the commit with format "wp-cli 0.24.0" + +See and for background. + +### Updating the website + +See + +### Writing the release post + +Use `./utils/contrib-list -l` to generate the list of contributors. + +### Announcing + +In addition to publishing the release post, a new release is announced in a few different ways: + +* WP-CLI Twitter account (with some scheduled follow-up tweets). +* `/announce` slash command in the `#cli` Slack room. +* Mailchimp email announcement list. + +### Bumping WP-CLI version again + +After all of the release steps are complete, make sure to bump [VERSION](https://github.com/wp-cli/wp-cli/blob/master/VERSION) again. + +For instance, if the release version was `0.24.0`, the version should be bumped to `0.25.0-alpha`. Doing so ensure `wp cli update --nightly` works as expected. + +## Patch releases + +Creating a patch release (e.g. 0.23.x) is bit different of a process than creating a major or minor release. At a high-level, here are the steps involved: + +1) Create a new release branch from the last tagged patch release: + + $ git checkout v0.23.0 + Note: checking out 'v0.23.0' + You are in 'detached HEAD' state. You can look around, make experimental + changes and commit them, and you can discard any commits you make in this + state without impacting any branches by performing another checkout. + $ git checkout -b release-0-23-1 + Switched to a new branch 'release-0-23-1' + +2) Cherry-pick existing commits to the new release branch. + +Because patch releases should just be used for bug fixes, you should first fix the bug on master, and then cherry-pick the fix to the release branch. It's up to your discretion as to whether you cherry-pick the commits directly to the release branch *or* create a feature branch and pull request against the release branch. + +3) Update `VERSION` on the release branch to the new release version. + +4) **PROCEED WITH EXTREME CAUTION**. While the normal release process yields a built, fully-tested Phar file, the patch release process does not because the build system only pushes the Phar file on the master branch. As such, you need to manually build the Phar file for distribution. + + php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --quiet + +When you do so, make sure you're using the appropriate Composer dependency versions for the release, not the master branch you normally work from. Once you've verified the built Phar, you'll need to copy it over to the builds repo. + +5) Follow all of the other relevant release steps. diff --git a/docs/shell-tips/index.md b/docs/shell-tips/index.md new file mode 100644 index 00000000..192c581b --- /dev/null +++ b/docs/shell-tips/index.md @@ -0,0 +1,80 @@ +--- +layout: doc +title: Shell tips +description: Helpful shortcuts for bash and zsh. +category: References +--- + +Master of bash or zsh? Share your tips here. + +## Take a look at the plugin changelog + +Needs `elinks` to browse HTML. + +```bash +wget -qO- http://api.wordpress.org/plugins/info/1.0/akismet|php -r '$seri=unserialize(stream_get_contents(STDIN)); echo $seri->sections["changelog"];'|elinks -force-html +``` + +Explanation + +- set wget quiet & query the WordPress.org Plugin API +- unserialize with php, `stream_get_contents(STDIN)` means "get all from *stdin*" +- echo the changelog part from the API's reply +- fire up elinks (a console browser) to view the changelog + +## Start wp-cli with ABSPATH in the current dir and under the current dir's owner + +```bash +#!/bin/bash + +sudo -u $(stat . -c %U) -- wp --path="$PWD" "$@" +``` + +Explanation + +The `stat` command returns the owner of the current directory, WordPress root. + +## Install and Configure WordPress with WP-CLI + +```bash +wp_install () +{ + wp core download --path=$1; + cd $1; + read -p 'name the database:' dbname; + wp core config --dbname=$dbname --dbuser=root --dbpass=awoods --dbhost=localhost; + wp db create; + wp core install --prompt +} + +$ source ~/.bashrc +$ wp_install new-site +``` + +Explanation + +Add this function to your ~/.bashrc are reload your shell (or open a new shell). +You'll need to substitute these database credentials with your own. +When you need create a new wordpress install, call this function and specify the +name of the directory where you want to create the site. This emulates the +web-based install process. + +## List all image URL-s in posts + +```bash +wp post list --field=ID|xargs -I % wp post get % --field=post_content|sed -ne 's;.*\(https\?\S\+\(jpe\?g\|png\|gif\)\).*;\1;gp' +``` + +Explanation + +- List all post ID-s +- Get each content (xargs) +- Display only image URL-s (sed) + +## Create a page from a file and flag it with the file name + +```bash +wp post create new_page.html --post_type=page --post_title="New Page" --porcelain | xargs -I % wp post meta add % imported_from new_page.html +``` +- Create a page (--porcelain will return only the new post ID) +- Create post meta with xargs using "-I %" to signify the placeholder template for the new post ID diff --git a/docs/tools/index.md b/docs/tools/index.md new file mode 100644 index 00000000..4e888fd9 --- /dev/null +++ b/docs/tools/index.md @@ -0,0 +1,105 @@ +--- +layout: doc +title: Integrated tools +description: Plugins, wrappers, and other projects that integrate with WP-CLI in some form. +category: References +quick_links: + - Plugins + - Wrappers + - Editor plugins + - Vagrant boxes + - Misc +--- + +The following is a list of projects that integrate with WP-CLI in some form. For installable WP-CLI packages, please see the [package index](/package-index/). + +## Plugins + +The following table is an alphabetical list of known commands defined in WordPress plugins: + +| **Command** | **WordPress plugin** +|:----------------------|:--------------------------------------------------------------- +| acf | [Advanced Custom Fields wp-cli](https://github.com/hoppinger/advanced-custom-fields-wpcli) +| amt | [Add-Meta-Tags command line interface](http://www.codetrax.org/projects/wp-add-meta-tags/wiki/Command_Line_Interface) +| any-ipsum | [Any Ipsum](https://wordpress.org/plugins/any-ipsum/) +| backup | [BackUpWordPress](http://wordpress.org/extend/plugins/backupwordpress/) +| backupbuddy | [BackupBuddy](http://getbackupbuddy.com/) +| backwpup | [BackWPup](https://marketpress.de/product/backwpup-pro/) +| blog-dupe | [blog-duplicator](https://github.com/trepmal/blog-duplicator) +| camptix | [CampTix](https://github.com/Automattic/camptix) +| check-content | [CheckContent](https://github.com/mattclegg/wp-cli_check-content) +| co-authors-plus | [Co-Authors Plus](https://github.com/automattic/co-authors-plus) +| composer | [Composer](http://wordpress.org/plugins/composer) +| config | [WP-CFM](https://wordpress.org/plugins/wp-cfm/) +| crontrol | [WP-Crontrol](http://wordpress.org/plugins/wp-crontrol/) +| csv | [Advanced CSV Importer](https://wordpress.org/plugins/advanced-csv-importer/) +| deploy | [wp-deploy-flow](https://github.com/demental/wp-deploy-flow) +| developer | [Developer](http://wordpress.org/plugins/developer/) +| dreamobjects | [DreamObjects](http://wordpress.org/extend/plugins/dreamobjects/) +| edd | [Easy Digital Downloads](https://easydigitaldownloads.com/docs/wp-cli-commands/) +| elasticpress | [ElasticPress](https://github.com/10up/ElasticPress) +| google-sitemap | [Google Sitemap Generator CLI](https://github.com/wp-cli/google-sitemap-generator-cli) +| image-gen | [Image Gen](https://github.com/trepmal/image-gen/) +| import_sidebar | [Widget Import Export](https://github.com/cftp/widget-importer) +| itelic | [Licensing for Exchange](https://github.com/iron-bound-designs/exchange-addon-licensing) +| jekyll-export | [WordPress to Jekyll Exporter](https://github.com/benbalter/wordpress-to-jekyll-exporter/) +| jetpack | [Jetpack by WordPress.com](http://wordpress.org/plugins/jetpack/) +| liveblog | [Liveblog](http://wordpress.org/plugins/liveblog/) +| mainwp | [MainWP](http://docs.mainwp.com/wp-cli-commands/) +| migrate | [WP Migrate DB CLI Interface](https://github.com/duncanjbrown/WP-CLI-Migrate/) +| migratedb | [WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-addon/) +| more-plugin-info | [More Plugin Info](http://wordpress.org/plugins/more-plugin-info/) +| multi-device | [Multi Device Switcher](https://wordpress.org/plugins/multi-device-switcher/) +| nginx | [Nginx Cache Controller](http://wordpress.org/plugins/nginx-champuru/) +| p2-by-email | [P2 By Email](https://github.com/humanmade/P2-By-Email) +| p2-resolved-posts | [P2 Resolved Posts](http://wordpress.org/plugins/p2-resolved-posts/) +| p2p | [Posts 2 Posts](http://wordpress.org/plugins/posts-to-posts/) +| pdf-light-viewer | [PDF Light Viewer](https://github.com/antongorodezkiy/pdf-light-viewer) +| post-gen | [Post Gen](https://github.com/trepmal/post-gen/) +| rest-api-toolbox | [REST API Toolbox](https://github.com/petenelson/wp-rest-api-toolbox) +| redis-cache | [Redis Object Cache](http://wordpress.org/extend/plugins/redis-cache/) +| revisions | [wp-revisions-cli](https://github.com/trepmal/wp-revisions-cli/) +| revision-strike | [Revision Strike](https://wordpress.org/plugins/revision-strike/) +| safe-redirect-manager | [Safe Redirect Manager](https://github.com/tlovett1/Safe-Redirect-Manager) +| scheduled-unsticky | [Scheduled Unsticky](http://wordpress.org/plugins/scheduled-unsticky/) +| site duplicate | [MultiSite Clone Duplicator](http://wordpress.org/plugins/multisite-clone-duplicator/) +| stream | [WP Stream](http://wordpress.org/plugins/stream/) +| super-cache | [WP Super Cache CLI](https://github.com/wp-cli/wp-super-cache-cli) +| supportpress | [SupportFlow](https://github.com/SupportFlow/supportflow) +| thinkup | [Thinkup Import WP CLI Commands](https://github.com/taras/wp-cli-thinkup-import) +| total-cache | [W3 Total Cache](http://wordpress.org/extend/plugins/w3-total-cache/) +| usergen | [Generate random users](https://github.com/alessandrotesoro/wp-usergen-cli) +| Unsplash | [Import images from Unsplash into your Media Library](https://github.com/A5hleyRich/wp-cli-unsplash-command) + +If you implement a WP-CLI command in one of your plugins, please list it here. + +## Wrappers + +* [Chef WP-CLI](https://github.com/francescolaffi/chef-wp-cli) - WP provisioning using Chef +* [node-wp-cli](https://github.com/gtg092x/node-wp-cli) - Node JS wrapper for WP-CLI +* [Puppet WP-CLI](https://github.com/rmccue/puppet-wp) - WP provisioning using Puppet +* [wpcli gem](https://github.com/hasanen/wpcli) - run WP-CLI commands from Ruby +* [wplib](https://github.com/szepeviktor/wplib) - shell scripts for managing multiple sites +* [wpcli helpers](https://github.com/kartonnade/wp_cli_helpers) - a bundle of time saver aliases and functions for the shell +* [cPanel-wp-management](https://github.com/MarioKnight/cPanel-wp-management) - shell scripts designed to loop through all accounts on cPanel servers +* [Plesk WordPress Toolkit](https://www.plesk.com/features-automation/wordpress-toolkit/) - WordPress installations management UI backed by WP-CLI + +## Editor plugins + +* Vim - [https://github.com/dsawardekar/wordpress.vim](https://github.com/dsawardekar/wordpress.vim) +* Netbeans - [https://github.com/junichi11/netbeans-wordpress-plugin](https://github.com/junichi11/netbeans-wordpress-plugin) +* Netbeans - [http://plugins.netbeans.org/plugin/46542/php-wordpress-blog-cms](http://plugins.netbeans.org/plugin/46542/php-wordpress-blog-cms) + +## Vagrant boxes + +* [Trellis](https://github.com/roots/trellis) +* [Varying Vagrant Vagrants](https://github.com/10up/varying-vagrant-vagrants) +* [VCCW](http://vccw.cc/) + +## Misc + +* [Bedrock](https://github.com/roots/bedrock) - WP base stack +* [EasyEngine](https://github.com/rtCamp/easyengine/) - Hosting control panel +* [WordPress Development Flow](https://github.com/cityindex/wordpress-development-flow) - retired +* [WP-CLI GUI](http://wpcligui.com/) - a GUI to assist with installing WP using WP-CLI +* [WP-API Oauth](https://github.com/WP-API/OAuth1) - WP REST API - OAuth 1.0a Server diff --git a/docs/wish-list/index.md b/docs/wish-list/index.md new file mode 100644 index 00000000..05a7297a --- /dev/null +++ b/docs/wish-list/index.md @@ -0,0 +1,21 @@ +--- +layout: doc +title: Website and Package Index wish list +description: A list of ideas and potential improvements for wp-cli.org +category: Misc +--- + +An ongoing list of ideas and potential improvements for wp-cli.org. + +### Website + +* Redesign! And potentially move to WordPress from Github pages. +* Produce command pages for the packages listed in the package index. +* Publish a set of suggested best practices for package maintainers to follow. + +### Package Index + +* Display download / installation counts for each package. +* Display number of Github stars for each package. +* Highlight packages in the index that are regularly updated, have multiple maintainers, or reflect some other quality we hold to be important. +* Run test suite for each package on a weekly basis ([from #3197](https://github.com/wp-cli/wp-cli/issues/3197#issuecomment-238946219)). diff --git a/es/index.md b/es/index.md deleted file mode 100644 index 67bcc591..00000000 --- a/es/index.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -layout: default -title: Interfaz de línea de comandos para WordPress -direction: ltr ---- - -[WP-CLI](https://wp-cli.org/) es la interfaz de línea de comandos para [WordPress](https://es.wordpress.org/). Puedes actualizar plugins, configurar instalaciones multisitio y mucho más, sin usar un navegador web. - -El mantenimiento continuo es posible gracias a: - - - - - - - - -La versión estable actual es la [2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). Para estar al día, sigue [@wpcli en Twitter](https://twitter.com/wpcli) o [regístrate para recibir actualizaciones por correo electrónico](https://make.wordpress.org/cli/subscribe/). [Consulta la hoja de ruta](https://make.wordpress.org/cli/handbook/roadmap/) para una visión general de lo que está planeado para las próximas versiones. - -[![Testing](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") - -Enlaces rápidos: [Uso](#uso) | [Instalación](#instalación) | [Soporte](#soporte) | [Extender](#extender) | [Contribuir](#contribuir) | [Créditos](#créditos) - -## Uso - -WP-CLI proporciona una interfaz de línea de comandos para muchas acciones que puedes realizar en el escritorio de WordPress. Por ejemplo, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) te permite instalar y activar un plugin de WordPress: - -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading install package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... -Unpacking the package... -Installing the plugin... -Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. -``` - -WP-CLI también incluye comandos para muchas cosas que no puedes hacer en el escritorio de WordPress. Por ejemplo, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) te permite eliminar uno o todos los datos transitorios: - -```bash -$ wp transient delete --all -Success: 34 transients deleted from the database. -``` - -Para una introducción más completa para usar WP-CLI, lee la [guía de inicio rápido](https://make.wordpress.org/cli/handbook/quick-start/). O bien, ponte al día con los [*shell friends*](https://make.wordpress.org/cli/handbook/shell-friends/) para aprender acerca de las utilidades de línea de comandos. - -¿Ya te sientes cómodo con lo básico? Ve a la [lista completa de comandos](https://developer.wordpress.org/cli/commands/) para obtener información detallada sobre la gestión de temas y plugins, importación y exportación de datos, realización de operaciones de búsqueda y reemplazo de bases de datos, y más. - -## Instalación - -La descarga del archivo Phar es nuestro método de instalación recomendado para la mayoría de usuarios. Si lo necesitas, consulta también nuestra documentación acerca de [métodos de instalación alternativos](https://wp-cli.org/docs/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)). - -Antes de instalar WP-CLI, asegúrate de que tu entorno cumple con los requisitos mínimos: - -- Entorno de tipo UNIX (OS X, Linux, FreeBSD, Cygwin); soporte limitado en el entorno de Windows -- PHP 5.6 o posterior -- WordPress 3.7 o posterior. Las versiones anteriores a la última versión de WordPress pueden tener funcionalidad degradada - -Una vez que hayas verificado los requisitos, descarga el archivo [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) usando `wget` o `curl` : - -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -``` - -A continuación, comprueba el archivo Phar para verificar que está funcionando: - -```bash -php wp-cli.phar --info -``` - -Para usar WP-CLI desde la línea de comandos tecleando `wp`, haz que el archivo sea ejecutable y muévelo a algún lugar de tu `PATH`. Por ejemplo: - -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp -``` - -Si WP-CLI se instaló correctamente, deberías ver algo como esto cuando ejecutas `wp --info`: - -```bash -$ wp --info -OS: Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 -Shell: /usr/bin/zsh -PHP binary: /usr/bin/php -PHP version: 8.0.5 -php.ini used: /etc/php/8.0/cli/php.ini -MySQL binary: /usr/bin/mysql -MySQL version: mysql Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) -SQL modes: -WP-CLI root dir: /home/wp-cli/ -WP-CLI vendor dir: /home/wp-cli/vendor -WP_CLI phar path: -WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: -WP-CLI project config: /home/wp-cli/wp-cli.yml -WP-CLI version: 2.12.0 -``` - -### Actualización - -Puedes actualizar WP-CLI con `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), o repitiendo los pasos de instalación. - -Si WP-CLI es propiedad de root u otro usuario del sistema, necesitarás ejecutar `sudo wp cli update`. - -¿Quieres vivir la vida al límite? Ejecuta `wp cli update --nightly` para usar la última compilación nocturna (nightly build) de WP-CLI. Una compilación nocturna es más o menos lo suficientemente estable como para que puedas utilizarla en tu entorno de desarrollo, y siempre incluye las últimas y mejores características de WP-CLI. - -### Autocompletar con el tabulador - -WP-CLI también viene con un scripts para autocompletar con el tabulador para Bash y ZSH. Tan sólo descarga [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) y usa el comando `source` desde `~/.bash_profile`: - -```bash -source /FULL/PATH/TO/wp-completion.bash -``` - -No te olvides de ejecutar `source ~/.bash_profile` después. - -Si usa la shell zsh, es posible que debas cargar e iniciar `bashcompinit` antes de usar el comando `source`. Pon lo siguiente en tu `.zshrc`: - -```bash -autoload bashcompinit -bashcompinit -source /RUTA/COMPLETA/HASTA/wp-completion.bash -``` - -## Soporte - -Tanto los que mantienen WP-CLI como sus colaboradores tienen disponibilidad limitada para responder preguntas generales de soporte. La [versión actual de WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) es la única versión oficialmente soportada. - -Cuando busques ayuda, primero busca tu pregunta en estos lugares: - -* [Problemas comunes y sus soluciones](https://make.wordpress.org/cli/handbook/common-issues/) -* [Manual de WP-CLI (Handbook)](https://make.wordpress.org/cli/handbook/) -* [*Issues* abiertos o cerrados en la organización de WP-CLI en GitHub](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* [Hilos etiquetados con «WP-CLI» en el foro de soporte de WordPress.org](https://wordpress.org/support/topic-tag/wp-cli/) -* [Preguntas etiquetadas con «WP-CLI» en WordPress Development Stack Exchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) - -Si no encontraste una respuesta en uno de los lugares anteriores, puedes: - -* Únirte al canal `#cli` en el [Slack de WordPress.org](https://make.wordpress.org/chat/) para chatear con quien esté disponible en ese momento. Esta opción es la mejor para preguntas rápidas. -* [Publicar un nuevo hilo](https://wordpress.org/support/forum/wp-advanced/#new-post) en el foro de soporte de WordPress.org y etiquetarlo como «WP-CLI» para que lo vea la comunidad. - -Los *issues* de GitHub están destinados al seguimiento de mejoras y errores de los comandos existentes, no para soporte general. Antes de enviar un informe de errores, por favor, [revisa nuestras mejores prácticas](https://make.wordpress.org/cli/handbook/bug-reports/) para ayudar a garantizar que tu *issue* se resuelva de manera oportuna. - -Por favor, no hagas preguntas de soporte en Twitter. Twitter no es un lugar aceptable para el soporte porque: 1) es difícil mantener conversaciones con menos de 280 caracteres, y 2) Twitter no es un lugar donde alguien con tu misma pregunta pueda buscar una respuesta en una conversación previa. - -Recuerda, libre != gratis; la licencia open source te da la libertad de usar y modificar, pero no a expensas del tiempo de otras personas. Por favor, se respetuoso y establece tus expectativas en consecuencia. - -## Extender - -Un **comando** es la unidad atómica de la funcionalidad de WP-CLI. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) es un comando. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) es otro. - -WP-CLI permite registrar cualquier clase, función o *closure* invocable como un comando. Este lee los detalles de uso del PHPdoc de la devolución de llamada. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) se utiliza tanto para el registro de comandos internos como de terceros. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` - -WP-CLI viene con docenas de comandos. Crear un comando personalizado para WP-CLI es más fácil de lo que parece. Lee el [libro de recetas de comandos](https://make.wordpress.org/cli/handbook/commands-cookbook/) para obtener más información. Explora los [documentos de la API interna](https://make.wordpress.org/cli/handbook/internal-api/) para descubrir una variedad de funciones útiles que puedes usar en su comando WP-CLI personalizado. - -## Contribuir - -Apreciamos que tomes la iniciativa de contribuir a WP-CLI. Es gracias a ti y la comunidad que lo rodea, que WP-CLI es un gran proyecto. - -**Contribuir no se limita únicamente al código.** Te animamos a contribuir de la forma que mejor se adapte a tus habilidades, escribiendo tutoriales, haciendo una demostraciones en tu meetup local, ayudando a los demás con sus preguntas de soporte, o revisando nuestra documentación. - -Lee atentamente nuestras [pautas de colaboración en el manual](https://make.wordpress.org/cli/handbook/contributing/) para una introducción completa sobre cómo puedes involucrarte. Seguir estas pautas ayuda a comunicar que respetas el tiempo de otros colaboradores en el proyecto. A su vez, ellos harán todo lo posible para corresponder a ese respeto cuando trabajen contigo, a través de diferentes zonas horarias alrededor del mundo. - -## Liderazgo - -WP-CLI tiene un encargado del mantenimiento del proyecto: [schlessera](https://github.com/schlessera). - -En ocasiones, [concedemos permisos de escritura a los colaboradores](https://make.wordpress.org/cli/handbook/committers-credo/) que han demostrado, durante un período de tiempo, que son capaces e invirtieron en avanzar el proyecto. - -Lee el [documento de gobernanza en el manual](https://make.wordpress.org/cli/handbook/governance/) para obtener más detalles operativos sobre el proyecto. - -## Créditos - -Además de las bibliotecas definidas en [composer.json](composer.json), hemos utilizado código o ideas de los siguientes proyectos: - -* [Drush](https://github.com/drush-ops/drush) para... un montón de cosas -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) para `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) para `wp media regenerate` -* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) para `wp search-replace` -* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) para `wp export` -* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) para `wp import` -* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) para `wp scaffold plugin-tests` diff --git a/fa/index.md b/fa/index.md deleted file mode 100644 index 3c551458..00000000 --- a/fa/index.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -layout: default -title: Command line interface for WordPress -direction: rtl ---- - -[WP-CLI](https://wp-cli.org/) رابط خط فرمان برای [وردپرس](https://wordpress.org/) است. به‌روزرسانی افزونه‌ها، پیکربندی نصب چندسایته و چیزهای بیشتر را بدون استفاده از مرورگر وب انجام دهید. - -نگهداری مداوم توسط حامیان امکان پذیر شده است: - - - -نگارش پایدار فعلی [version 2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/)است. برای پیگیری اعلانات، [@wpcli on Twitter](https://twitter.com/wpcli) را دنبال کنید یا [برای دریافت ایمیل ثبت‌نام کنید](https://make.wordpress.org/cli/subscribe/). برای بررسی برنامه‌ریزی‌های آینده انتشار [نقشه راه را برررسی کنید](https://make.wordpress.org/cli/handbook/roadmap/). - -[![وضعیت ساخت](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![زمان متوسط برای رفع مشکل](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "زمان متوسط برای رفع مشکل") [![درصد مشکلات باز](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "درصد مشکلات باز") - -پیوندهای سریع: [استفاده](#using) | [نصب](#installing) | [پشتیبانی](#support) | [گسترش](#extending) | [مشارکت](#contributing) | [همکاران](#credits) - -## استفاده - -WP-CLI یک رابط برپایه خط فرمان برای عملیاتی است که شما در محیط مدیریت وردپرس انجام می‌دهید. برای مثال `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) به شما امکان نصب و فعال‌سازی افزونه وردپرس را می‌دهد: - -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... -Unpacking the package... -Installing the plugin... -Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. -``` - -WP-CLI همچنین حاوی دستوراتی برای بسیاری چیزهاست که نمی‌توانید در مدیریت وردپرس انجام دهید. برای مثال، `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) به شما امکان حذف یکی یا همه transients را می‌دهد: - -```bash -$ wp transient delete --all -Success: 34 transients deleted from the database. -``` - -برای پیش‌درآمد کامل استفاده از WP-CLI، [راهنمای سریع](https://make.wordpress.org/cli/handbook/quick-start/) را مطالعه کنید. یا، برای آموزش دستورات مفید خط فرمان [دوستان شل](https://make.wordpress.org/cli/handbook/shell-friends/) را مطالعه کنید. - -در مورد مدیریت پوسته‌ها و افزونه‌ها، درون‌ریزی و برون‌بری، جستجو و جایگزینی در پایگاه‌داده و چیزهای بیشتر به [لیست کامل دستورات](https://developer.wordpress.org/cli/commands/) مراجعه کنید. - -## نصب - -دریافت پرونده Pahr روش پیشنهادی ما برای نصب به بیشتر کاربران است. در صورت نیاز، مستندات ما را برای [روش‌های جایگزین نصب](https://make.wordpress.org/cli/handbook/installing/) ([کمپوزر](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [هوم‌بریو](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [داکر](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)). ببینید. - -قبل از نصب WP-CLI، لطفا از دارا بودن حداقل امکانات مورد نیاز مطمئن شوید: - -- سیستم‌های یونیکسی (OS X, Linux, FreeBSD, Cygwin); در ویندوز کمتر پشتیبانی می‌شود -- PHP 5.6 or later -- وردپرس 3.7 به بالا. در نسخه‌های قدیمی‌تر ممکن است با مشکل روبرو شوید - - وقتی از داشتن حداقل امکانات مطمئن شدید، پرونده [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) را بصورت `wget` یا `curl` دریافت کیند: - -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -``` - -سپس پرونده Phar را از نظر کارکرد معتبرسازی کنید: - -```bash -php wp-cli.phar --info -``` - -جهت استفاده WP-CLI در خط فرمان `wp` را بنویسید، پرونده را قابل اجرا و سپس در PATH خود بگذارید. برای مثال: - -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp -``` - -اگر WP-CLI به درستی نصب شده باشد، شما در صورت اجرای `wp --info` باید چیزی شبیه به این را ببینید: - -```bash -$ wp --info -OS: Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64 -Shell: /bin/zsh -PHP binary: /usr/local/bin/php -PHP version: 7.0.22 -php.ini used: /etc/local/etc/php/7.0/php.ini -WP-CLI root dir: /home/wp-cli/.wp-cli/vendor/wp-cli/wp-cli -WP-CLI vendor dir: /home/wp-cli/.wp-cli/vendor -WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: /home/wp-cli/.wp-cli/config.yml -WP-CLI project config: -WP-CLI version: 2.12.0 -``` - -### به‌روزرسانی - -شما می‌توانید WP-CLI را با `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/))، یا با اجرای دوباره مراحل نصب به‌روزرسانی کنید. - -اگر دسترسی به WP-CLI با روت است یا کاربر سیستمی دیگری است، شما احتیاج به اجرای `sudo wp cli update` دارید. - -به‌روزرسانی زنده می‌خواهید؟ برای استفاده از آخرین نسخه‌های شبانه دستور `wp cli update --nightly` را اجرا کنید. نسخه‌های شبانه به جهت پایداری کمتر برای کار در محیط توسعه مناسب نیستند، اما حاوی آخرین و بهترین امکانات WP-CLI هستند. - -### کامل‌سازی با تب - -WP-CLI دارای قابلیت کامل‌سازی با تب برای بش و ZSH است. کافیست [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) را دریافت و از `~/.bash_profile` سورس کنید: - -```bash -source /FULL/PATH/TO/wp-completion.bash -``` - -فراموش نکنید که بعد از آن `source ~/.bash_profile` را اجرا کنید. - -اگر از zsh برای شل استفاده می‌کنید، شاید به `bashcompinit` برای شروع قبل از سورس کردن نیاز داشته باشید. کد زیر را در `.zshrc` خود قرار دهید: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - -## پشتیبانی - -توسعه‌دهندگان و مشارکت کنندگان WP-CLI برای پاسخ‌دهی به سوالات زمان محدودی دارند. نسخه فعلی [WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) تنها نسخه قابل پشتیبانی رسمی است. - -قبل از سوال، لطفا در مورد مشکل خود جستجو کنید: - -* [مشکلات عمومی و رفع آنها](https://make.wordpress.org/cli/handbook/common-issues/) -* [کتابچه WP-CLI](https://make.wordpress.org/cli/handbook/) -* [مشکلات باز و بسته WP-CLI در گیتهاب رسمی](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* [تاپیک‌های مرتبط با 'WP-CLI' در انجمن پشتیبانی وردپرس](https://wordpress.org/support/topic-tag/wp-cli/) -* [سوالات مطرح شده مرتبط با 'WP-CLI' در StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) - -اگر جواب خود را از طریق راه‌های بالا پیدا نکردید، می‌توانید: - -* وارد کانال `#cli` در [اسلک WordPress.org](https://make.wordpress.org/chat/) شوید تا شاید به جواب سوالاتتان برسید. این راه برای سوالات کوتاه مناسب است. -* در انجمن پشتیبانی وردپرس [تاپیک چدید ایجاد کنید](https://wordpress.org/support/forum/wp-advanced/#new-post) و برچسب 'WP-CLI' بزنید. - -مشکلات گیتهاب برای پیگیری بهینه کردن و رفع باگ‌های موجود است، نه برای پشتیبانی عمومی. قبل از ارسال گزارش باگ، لطفا [بخش تمرین را بررسی کنید](https://make.wordpress.org/cli/handbook/bug-reports/)تا گزارش شما به درستی آدرس داده شده باشد و کمک شود که در زمان صرفه جویی شود. - -لطفا در توییتر درخواست پشتیبانی نکنید. توییتر جای مناسبی برای پشتیبانی نیست چون: 1) نگه داشتن صحبت با 200 کاراکتر و کمتر سخت است 2) توییتری جای مناسبی برای سوال شما نیست چون شخصی که سوالی مشابه شما دارد امکان جستجوی آن را ندارد. - -بخاطر داشته باشید، آزادی != رایگان؛ گواهی کدباز به شما دسترسی آزاد به استفاده و ویرایس را می‌دهد، اما نه الزاما با زمان افراد دیگر. لطفا باوقار باشید و انتظارات خود را براین اساس تنظیم کنید. - -## گسترش - -یک **دستور** یک بخش کوچک از عملکرد WP-CLI است. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) یک دستور است. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) یک دستور دیگر است. - -WP-CLI قابلیت ثبت هر کلاس، تابع یا بسته قابل فراخوانی را بصورت دستور دارد. جزئیات استفاده را از بخش توضیحات مندرج شده می‌خواند. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) برای هر دو حالت ثبت دستور داخلی و ثالث استفاده می‌شود. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` - -WP-CLI دارای ده‌ها دستور است. ایجاد یک دستور بسیار ساده‌تر از چیزی است که بنظر می‌رسد. بخش [کتابچه دستورات](https://make.wordpress.org/cli/handbook/commands-cookbook/) را برای آموزش مطالعه کنید. [API داخلی docs](https://make.wordpress.org/cli/handbook/internal-api/) را برای آشنایی با انواع عملکردهای مفید که می‌توانید در دستور دلخواه WP-CLI استفاده کنید را ببینید. - -## مشارکت - -ما از شما برای مشارکت در WP-CLI قدردانی می‌کنیم. به خاطر شما و جامعه اطراف شماست که WP-CLI چنین پروژه‌ای عالی است. - -**مشارکت فقط به یک کد محدود نمی‌شود.** ما شما را تشویق می‌کنیم تا به روشی که متناسب با توانایی‌های شما است مشارکت کنید -با نوشتن آموزش, ارائه یک نسخه‌ی نمایشی در میتاپ شما، کمک به کاربران دیگر با پشتیبانی و پاسخگویی و یا بررسی مستندات ما. - -برای معرفی کامل نحوه مشارکت [راهنمای مشارکت در ددفترچه راهنما](https://make.wordpress.org/cli/handbook/contributing/) را مطالعه کنید. پیروی از این دستورالعمل‌ها به شما برای احترام به زمان دیگر مشارکت کنندگان پروژه کمک می‌کند. به نوبه خود، آنها همه تلاش خود را برای تکرار این احترام هنگام همکاری با شما، در مناطق زمانی مختلف و سراسر جهان انجام می دهند. - -## رهبری - -WP-CLI یک نگهدارنده دارد: [schlessera](https://github.com/schlessera). - -به تناسب، ما [دسترسی برا نوشتن به مشارکت کنندگان می‌دهیم](https://make.wordpress.org/cli/handbook/committers-credo/)،آنهایی که توانایی خود را در طی زمان برای جلو بردن پروژه نشان دمی‌دهند. - -توضیحات [سند مدیریت در کتابچه راهنمای کاربر](https://make.wordpress.org/cli/handbook/governance/) را برای جزئیات عملیاتی در مورد پروژه بخوانید. - -## همکاران - -علاوه بر کتابخانه های تعریف شده در [composer.json](composer.json) ما از پروژه‌ها یا کدهای زیر استفاده کرده‌ایم: - -* [Drush](https://github.com/drush-ops/drush) برای خیلی چیزها -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) برای `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) برای `wp media regenerate` -* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) برای `wp search-replace` -* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) برای `wp export` -* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) برای `wp import` -* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) برای `wp scaffold plugin-tests` diff --git a/fr/index.md b/fr/index.md index 20570f84..054a5360 100644 --- a/fr/index.md +++ b/fr/index.md @@ -1,55 +1,32 @@ --- layout: default title: Interface en ligne de commande pour WordPress -direction: ltr --- -WP-CLI -====== -[WP-CLI](https://wp-cli.org/fr) est un ensemble d'outils en ligne de commande pour gérer vos installations [WordPress](https://fr.wordpress.org/). Vous pouvez mettre à jour les extensions, configurer des installations multisite et beaucoup plus sans avoir recours à un navigateur web. +[WP-CLI](https://wp-cli.org/) est un ensemble d'outil en ligne de commande pour gérer vos installations [WordPress](https://wordpress.org/). Vous pouvez mettre à jour les extensions, configurer des installations multi-site et beaucoup plus sans avoir recours à un navigateur web. -L'entretien continu de ce projet est possible grâce à : +Pour rester à jour, suivez [@wpcli sur Twitter](https://twitter.com/wpcli) ou [inscrivez-vous à notre lettre d'information par email](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). + +[![Statut du build](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Statut des dépendances](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Temps moyen pour traiter un ticket](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Temps moyen pour traiter un ticket") [![Pourcentage de tickets encore ouverts](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Pourcentage de tickets encore ouverts")
- - Automattic - - - Bluehost - - - Pantheon - - - SiteGround - - - WP Engine - - - Cloudways - + border: 1px solid #7AD03A; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-left: 10px; + padding-right: 10px; +"> +

Un WP-CLI orienté RESTful vise à rendre utilisable la WP REST API en ligne de commande. Ce projet est soutenu par Pressed, Chris Lema, Human Made, Pagely, Pantheon et plein d'autres. En savoir plus →

-La dernière version stable est la [version 2.11.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). - -Pour rester à jour, suivez [@wpcli sur Twitter](https://twitter.com/wpcli) ou [inscrivez-vous à notre lettre d'information par email](https://make.wordpress.org/cli/subscribe/). - -[![Testing](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml) [![Temps moyen pour traiter un ticket](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Temps moyen pour traiter un ticket") [![Pourcentage de tickets encore ouverts](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Pourcentage de tickets encore ouverts") - - -Liens rapides: [Utilisation](#utilisation) | [Installation](#installation) | [Soutien](#soutien) | [Étendre](#étendre) | [Contribuer](#contribuer) | [Crédits](#crédits) +Liens rapides: [Utilisation](#utilisation) | [Installation](#installation) | [Support](#support) | [Étendre](#tendre) | [Contribuer](#contribuer) | [Crédits](#crdits) ## Utilisation -L'objectif de WP-CLI est de fournir une interface en ligne de commande pour toute action qu'il serait utile de faire dans l'administration WordPress. Par exemple, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) vous permet d'installer et d'activer une extension WordPress : +L'objectif de WP-CLI est de fournir une interface en ligne de commande pour toute action qu'il serait utile de faire dans l'administration WordPress. Par exemple, `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) vous permet d'installer et activer une extension WordPress : -```bash +``` $ wp plugin install rest-api --activate Installing WordPress REST API (Version 2) (2.0-beta13) Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... @@ -60,171 +37,101 @@ Activating 'rest-api'... Success: Plugin 'rest-api' activated. ``` -WP-CLI inclut aussi des commandes pour d'autres actions que vous ne pouvez pas faire dans l'administration WordPress. Par exemple, `wp transient delete-all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) permet de supprimer un ou tous les transients : +WP-CLI inclut aussi des commandes pour d'autres choses que vous ne pouvez pas faire dans l'administration WordPress. Par exemple, `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) permet de supprimer un ou tous les "transients" : -```bash +``` $ wp transient delete-all Success: 34 transients deleted from the database. ``` -Pour une introduction plus complète sur l'utilisation de WP-CLI, lisez le [Guide de démarrage rapide (en)](https://make.wordpress.org/cli/handbook/quick-start/). Vous pouvez également en apprendre davantage sur l'utilisation de la ligne de commande via des [informations sur l'utilisation du Shell (en)](https://make.wordpress.org/cli/handbook/shell-friends/). +Pour une introduction plus complète sur l'utilisation de WP-CLI, lisez le [Guide de démarrage rapide (en)](https://wp-cli.org/docs/quick-start/). -Vous vous sentez déjà à l'aise avec les bases ? Allez voir la [liste complète des commandes (en)](https://developer.wordpress.org/cli/commands/) pour avoir des informations détaillées sur la gestion des thèmes et extensions, l'import/export de données, l'exécution de rechercher/remplacer dans la base de données et bien plus. +Vous vous sentez déjà à l'aise avec les bases ? Allez voir la [liste complète des commandes (en)](https://wp-cli.org/commands/) pour avoir des informations détaillées sur la gestion des thèmes et extensions, l'import/export de donnée, l'exécution de rechercher/remplacer dans la base de données et bien plus. ## Installation -Télécharger le Phar est la méthode d'installation que nous recommandons. Si vous avez besoin, vous pouvez aussi consulter notre documentation sur [d'autres méthodes d'installation (en)](https://make.wordpress.org/cli/handbook/installing/). +Télécharger le Phar est la méthode d'installation que nous recommandons. Si vous avez besoin, vous pouvez aussi consulter notre documentation sur [autres méthodes d'installation (en)](https://wp-cli.org/docs/installing/). -Avant d'installer WP-CLI, veuillez vous assurer que votre environnement répond aux exigences minimales : +Avant d'installer WP-CLI, veuillez vous assurer que votre environnement réponds aux exigences minimales : -- Environnement de type UNIX (OS X, Linux, FreeBSD, Cygwin); le soutien est limité sur les environnements Windows -- PHP 5.6 ou plus récent +- Environnement de type UNIX (OS X, Linux, FreeBSD, Cygwin); le support est limité sur les environnements Windows +- PHP 5.3.29 ou plus récent - WordPress 3.7 ou plus récent -Une fois que vous avez vérifié ces exigences, téléchargez le fichier [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) en utilisant `wget` ou `curl` : +Une fois que vous avez vérifier ces exigences, téléchargez le fichier [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) en utilisant `wget` ou `curl` : -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` +$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` Ensuite, vérifiez que tout fonctionne : -```bash -php wp-cli.phar --info +``` +$ php wp-cli.phar --info ``` -Pour utiliser WP-CLI à partir de la ligne de commande en tapant `wp`, rendez le fichier exécutable et déplacez-le quelque part dans votre `PATH`. Par exemple : +Pour utiliser WP-CLI à partir de la ligne de commande en tapant `wp`, rendez le fichier exécutable et déplacez le quelque part dans votre `PATH`. Par exemple : -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp +``` +$ chmod +x wp-cli.phar +$ sudo mv wp-cli.phar /usr/local/bin/wp ``` -Si WP-CLI a été installé correctement, vous devez obtenir le résultat suivant quand vous exécutez `wp --info`: +Si WP-CLI a été installé correctement, vous devez voir quelque chose comme ça quand vous exécutez `wp --info`: -```bash +``` $ wp --info -OS: Ubuntu 20.04 -Shell: /bin/zsh -PHP binary: /usr/local/bin/php -PHP version: 8.1.0 -php.ini used: /etc/local/etc/php/php.ini -WP-CLI root dir: /home/wp-cli/.wp-cli/vendor/wp-cli/wp-cli -WP-CLI vendor dir: /home/wp-cli/.wp-cli/vendor +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ WP-CLI global config: /home/wp-cli/.wp-cli/config.yml WP-CLI project config: -WP-CLI version: 2.11.0 +WP-CLI version: 0.23.0 ``` -### Mise à jour - -Vous pouvez mettre à jour WP-CLI avec la commande `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), ou en répétant les étapes d'installation. +Vous pouvez mettre à jour WP-CLI avec `wp cli update` ([doc](https://wp-cli.org/commands/cli/update/)), ou en répétant les étapes d'installation. Vous voulez vivre dangereusement ? Exécutez `wp cli update --nightly` pour installer les derniers nightly build de WP-CLI. Un nightly build est relativement stable pour être utilisé dans votre environnement de développement et inclut toujours les fonctionnalités de WP-CLI les plus récentes. -### Autocomplétion - -WP-CLI contient des scripts d'autocomplétion pour Bash et ZSH. Il suffit de télécharger [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.11.0/utils/wp-completion.bash) et de l'importer dans votre fichier `~/.bash_profile`: - -```bash -source /FULL/PATH/TO/wp-completion.bash -``` - -Si vous voulez l'utiliser directement sans redémarrer votre session de terminal, n'oubliez pas de lancer `source ~/.bash_profile`. - -Si vous utilisez le shell zsh, vous devrez probablement charger et démarrer `bashcompinit` avant d'utiliser la commande `source`. Ajouter ces lignes dans votre fichier `.zshrc`: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - -## Soutien +## Support Les mainteneurs de WP-CLI et les contributeurs du projet font de leur mieux pour répondre à tous les nouveaux tickets en temps opportun. Pour utiliser au mieux leur temps bénévole, merci de vérifier s'il n'existe pas déjà une réponse à votre question dans l'une des ressources suivantes : -- [Problèmes courants et leur correction (en)](https://make.wordpress.org/cli/handbook/common-issues/) -- [Bonnes pratiques pour soumettre un rapport de bug (en)](https://make.wordpress.org/cli/handbook/bug-reports/) -- [Documentation (en)](https://make.wordpress.org/cli/handbook/) +- [Problèmes courants et leur correction (en)](https://wp-cli.org/docs/common-issues/) +- [Bonnes pratiques pour soumettre un rapport de bug (en)](https://wp-cli.org/docs/bug-reports/) +- [Documentation (en)](https://wp-cli.org/docs/) - [Tickets ouvert ou fermés sur Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) -- [Forum StackExchange WordPress](https://wordpress.stackexchange.com/questions/tagged/wp-cli) - -Si vous n'arrivez pas à trouver une réponse en utilisant un de ces liens : - -- Rejoignez le canal `#cli` sur [l'organisation Slack WordPress.org](https://make.wordpress.org/chat/) pour discuter avec les personnes en ligne à ce moment. Cette option est préférable pour des réponses rapides. -- [Créez un nouveau ticket](https://wordpress.org/support/forum/wp-advanced/#new-post) dans le forum de soutien WordPress.org en attachant l'étiquette 'WP-CLI' pour qu'il soit vu par la communauté. - -Les tickets Github, permettent de suivre l'évolution des bugs et améliorations sur les commandes existantes. Ils ne sont pas utilisés pour faire du soutien. Avant de soumettre un nouveau rapport de bug, merci de passer en revue [nos bonnes pratiques](https://make.wordpress.org/cli/handbook/bug-reports/) pour vous assurer que votre ticket les respecte. +- [Forum StackExchange WordPress](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -Merci de ne pas demander du soutien sur Twitter. Twitter n'est pas un endroit convenable pour faire du soutien : 1) c'est compliqué d'avoir une conversation en aussi peu de caractères et 2) Twitter n'est pas un endroit où quelqu'un avec la même question peut chercher et obtenir une réponse avant de la poser à nouveau. - -Souvenez-vous, libre != gratuit ; la licence open source vous donne la liberté d'utiliser et modifier, mais pas au dépend du temps d'autres personnes. Merci d'être respectueux et de définir vos attentes en conséquence. +Si vous avez un compte WordPress.org, vous pouvez également rejoindre le canal `#cli` sur [l'organisation Slack WordPress.org](https://make.wordpress.org/chat/). ## Étendre -Une **commande** est une unité atomique de fonctionnalité WP-CLI. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) est une commande. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) en est une autre. - -WP-CLI permet d'enregistrer n'importe quelle classe, fonction ou closure comme une commande. Les informations d'utilisation sont lues à partir du bloc PHPdoc de la fonction de rappel. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) est utilisé aussi bien pour l'enregistrement des commandes internes ou externes. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` +Une **commande** est une unité atomique de fonctionnalité WP-CLI. `wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) est une commande. `wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) en est une autre. -WP-CLI est livré avec des douzaines de commandes. Il est plus facile qu'il n'y parait de créer vos propres commandes WP-CLI. Lisez le [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) pour en apprendre davantage. Parcourez la [documentation sur l'API interne](https://make.wordpress.org/cli/handbook/internal-api/) pour découvrir une variété de fonctions utiles que vous pouvez utiliser dans votre commande WP-CLI personnalisée. +WP-CLI est livré avec des douzaines de commandes. Il est plus facile qu'il n'y parait de créer vos propres commandes WP-CLI. Lisez le [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) pour en apprendre d'avantage. Parcourez la [documentation sur l'API interne](http://wp-cli.org/docs/internal-api/) pour découvrir une variété de fonctions utiles que vous pouvez utiliser dans votre commande WP-CLI personnalisée. ## Contribuer -Bienvenue et merci ! - -Nous apprécions que vous preniez l'initiative de contribuer à WP-CLI. C'est grâce à vous et à la communauté autour de vous que WP-CLI est un projet aussi important. - -**Contribuer n'est pas limité uniquement à l'écriture de code.** Nous vous encourageons à contribuer de la façon qui vous correspond le mieux, en écrivant des tutoriels, en faisant des démonstrations dans votre groupe d'utilisateurs local, à aider les autres avec leurs questions de soutien, ou en relisant notre documentation. - -Merci de prendre un moment pour [lire le guide du contributeur en profondeur](https://make.wordpress.org/cli/handbook/contributing/). Suivre ces règles aide à communiquer avec le respect du temps des autres contributeurs du projet. En retour, ils feront de leur mieux pour travailler avec ce même respect, à travers les fuseaux horaires et dans le monde lorsque vous en aurez besoin. - -## Leadership - -WP-CLI est dirigé et maintenu par : [schlessera](https://github.com/schlessera). +Pour participer, merci de d'abord lire les pages [créer un ticket (en)](https://wp-cli.org/docs/bug-reports/) ou [soumettre une pull request (en)](https://wp-cli.org/docs/pull-requests/). -La version francophone de ce site est maintenue par : [Maxime Jobin](https://github.com/maximejobin) +### Leadership -À l'occasion, il arrive que certains [contributeurs reçoivent des accès plus permissifs (en)](https://make.wordpress.org/cli/handbook/committers-credo/) après avoir démontré leurs capacités et leur temps investis dans le projet. +* [Daniel Bachhuber](https://github.com/danielbachhuber/) - mainteneur actuel +* [Cristi Burcă](https://github.com/scribu) - mainteneur précédent +* [Andreas Creten](https://github.com/andreascreten) - créateur -Pour en savoir plus sur la [gouvernance (en)](https://make.wordpress.org/cli/handbook/governance/) du projet et voir la [liste complète des contributeurs](https://github.com/wp-cli/wp-cli/contributors). +Pour en savoir plus sur la [gouvernance (en)](https://wp-cli.org/docs/governance/) du projet et voir la [liste complète des contributeurs](https://github.com/wp-cli/wp-cli/contributors). ## Crédits Derrière les librairies définies dans le fichier [composer.json](composer.json), nous avons utilisé du code et des idées venant des projets suivants : -* [Drush](https://www.drush.org/) pour... pas mal de choses -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) pour `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) pour `wp media regenerate` +* [Drush](http://drush.ws/) pour... pas mal de choses +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) pour `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) pour `wp media regenerate` * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) pour `wp search-replace` * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) pour `wp export` * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) pour `wp import` diff --git a/gr/index.md b/gr/index.md index a3692981..6b770086 100644 --- a/gr/index.md +++ b/gr/index.md @@ -1,14 +1,24 @@ --- layout: default title: Διεπαφή γραμμής εντολών για το WordPress -direction: ltr --- Το [WP-CLI](https://wp-cli.org/) είναι ένα σύνολο από εργαλεία γραμμής εντολών για τη διαχείριση εγκαταστάσεων [WordPress](https://wordpress.org/). Μπορείτε να ενημερώνετε πρόσθετα, να ρυθμίζετε εγκαταστάσεις πολλαπλών ιστοτόπων και πολλά περισσότερα, χωρίς τη χρήση περιηγητή. -Για να μένετε ενημερωμένοι, ακολουθήστε το [@wpcli στο Twitter](https://twitter.com/wpcli) ή [εγγραφείτε για το ενημερωτικό μας δελτίο](https://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). +Για να μένετε ενημερωμένοι, ακολουθήστε το [@wpcli στο Twitter](https://twitter.com/wpcli) ή [εγγραφείτε για το ενημερωτικό μας δελτίο](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). -[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") + +
+

Ένα περισσότερο RESTful WP-CLI στοχεύει στην εκμετάλλευση της δυναμικής του WP REST API στη γραμμή εντολών. Το έργο υποστηρίχθηκε από τους Pressed, Chris Lema, Human Made, Pagely, Pantheon και πολλούς άλλους. Μάθετε περισσότερα →

+
Γρήγοροι σύνδεσμοι: [Χρήση](#using) | [Εγκατάσταση](#installing) | [Υποστήριξη](#support) | [Επέκταση](#extending) | [Συνεισφορά](#contributing) | [Ευχαριστίες](#credits) @@ -16,7 +26,7 @@ direction: ltr Ο σκοπός του WP-CLI είναι η παροχή μίας διεπαφής γραμμής εντολών για κάθε ενέργεια που μπορεί να θέλετε να εκτελέσετε στο διαχειριστικό περιβάλλον του WordPress. Για παράδειγμα, η εντολή `wp plugin install --activate` ([τεκμηρίωση](https://wp-cli.org/commands/plugin/install/)) σας επιτρέπει να εγκαταστήσετε και να ενεργοποιήσετε ένα πρόσθετο WordPress: -```bash +``` $ wp plugin install rest-api --activate Installing WordPress REST API (Version 2) (2.0-beta13) Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... @@ -29,7 +39,7 @@ Success: Plugin 'rest-api' activated. Το WP-CLI περιλαμβάνει επίσης εντολές για πολλά πράγματα που δεν μπορείτε να κάνετε στο διαχειριστικό περιβάλλον του WordPress. Για παράδειγμα, η εντολή `wp transient delete-all` ([τεκμηρίωση](https://wp-cli.org/commands/transient/delete-all/)) σας επιτρέπει να διαγράψετε ένα ή όλα τα transients: -```bash +``` $ wp transient delete-all Success: 34 transients deleted from the database. ``` @@ -48,28 +58,28 @@ Success: 34 transients deleted from the database. - PHP 5.3.29 ή νεότερη - WordPress 3.7 ή νεότερο -Μόλις επιβεβαιώσετε τις απαιτήσεις, μεταφορτώστε το αρχείο [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) χρησιμοποιώντας την εντολή `wget` ή `curl`: +Μόλις επιβεβαιώσετε τις απαιτήσεις, μεταφορτώστε το αρχείο [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) χρησιμοποιώντας την εντολή `wget` ή `curl`: -```bash +``` $ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` Μετά, ελέγξτε ότι δουλεύει: -```bash +``` $ php wp-cli.phar --info ``` Για να χρησιμοποιήσετε το WP-CLI από τη γραμμή εντολών πληκτρολογώντας `wp`, κάντε το αρχείο εκτελέσιμο και μετακινήστε το κάπου μέσα στο PATH σας. Για παράδειγμα: -```bash +``` $ chmod +x wp-cli.phar $ sudo mv wp-cli.phar /usr/local/bin/wp ``` Αν το WP-CLI έχει εγκατασταθεί επιτυχώς, όταν εκτελέσετε `wp --info` θα πρέπει να δείτε κάτι σαν αυτό: -```bash +``` $ wp --info PHP binary: /usr/bin/php5 PHP version: 5.5.9-1ubuntu4.14 @@ -78,7 +88,7 @@ WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ WP-CLI global config: /home/wp-cli/.wp-cli/config.yml WP-CLI project config: -WP-CLI version: 0.25.0 +WP-CLI version: 0.23.0 ``` ### Ενημέρωση @@ -91,20 +101,12 @@ WP-CLI version: 0.25.0 Το WP-CLI έρχεται επίσης με ένα αρχείο για συμπλήρωση tab για το Bash και το ZSH. Απλά μεταφορτώστε το [wp-completion.bash](https://github.com/wp-cli/wp-cli/raw/master/utils/wp-completion.bash) και προσθέστε την παρακάτω γραμμή στο αρχείο `~/.bash_profile`: -```bash +``` source /FULL/PATH/TO/wp-completion.bash ``` Μην ξεχάσετε να εκτελέσετε την εντολή `source ~/.bash_profile` μετά. -Αν χρησιμοποιείτε zsh για κέλυφος, ίσως χρειαστεί να φορτώσετε και να εκκινήσετε το `bashcompinit` πριν το source. Τοποθετείστε το παρακάτων στο στο αρχείο σας `.zshrc`: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - ## Υποστήριξη Τα άτομα που συντηρούν το WP-CLI και συνεισφέρουν σε αυτό, κάνουν ότι καλύτερο μπορούν για να απαντάνε σε όλα τα νέα θέματα εγκαίρως. Για να κάνετε τη βέλτιστη χρήση του εθελοντικού τους χρόνου, παρακαλώ δείτε πρώτα μήπως υπάρχει απάντηση στην ερώτησή σας σε έναν από τους ακόλουθους συνδέσμους: @@ -113,7 +115,7 @@ source /FULL/PATH/TO/wp-completion.bash - [Βέλτιστες πρακτικές για υποβολή αναφοράς σφάλματος](https://wp-cli.org/docs/bug-reports/) - [Πύλη τεκμηρίωσης](https://wp-cli.org/docs/) - [Ανοιχτά ή κλειστά θέματα στο Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) -- [WordPress StackExchange forums](https://wordpress.stackexchange.com/questions/tagged/wp-cli) +- [WordPress StackExchange forums](http://wordpress.stackexchange.com/questions/tagged/wp-cli) Αν δε μπορείτε να βρείτε απάντηση σε ένα από τις υπάρχουσες πηγές, [δημιουργήστε ένα θέμα](https://github.com/wp-cli/wp-cli/issues/new) με την ερώτησή σας. @@ -127,7 +129,7 @@ source /FULL/PATH/TO/wp-completion.bash Το WP-CLI υποστηρίζει την καταχώρηση σαν μία εντολή κάθε κλάσης ή συνάρτησης που μπορεί να καλεστεί. Διαβάζει λεπτομέρειες χρήσης από το PHPdoc. Το `WP_CLI::add_command()` ([τεκμηρίωση](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) χρησιμοποιείται για εσωτερική καταχώρηση εντολής και καταχώρηση από τρίτους. -```php +``` /** * Delete an option from the database. * @@ -181,9 +183,9 @@ WP_CLI::add_command( 'option delete', $delete_option_cmd ); Εκτός τις βιβλιοθήκες που ορίζονται στο [composer.json](composer.json), έχουμε χρησιμοποιήσει κώδικα ή ιδέες από τα ακόλουθα έργα: -* [Drush](https://www.drush.org/) για... πολλά πράγματα -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) για το `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) για το `wp media regenerate` +* [Drush](http://drush.ws/) για... πολλά πράγματα +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) για το `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) για το `wp media regenerate` * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) για το `wp search-replace` * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) για το `wp export` * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) για το `wp import` diff --git a/index.md b/index.md index 9eaabd31..536bc657 100644 --- a/index.md +++ b/index.md @@ -1,130 +1,105 @@ -WP-CLI -====== +--- +layout: default +title: Command line interface for WordPress +--- -[WP-CLI](https://wp-cli.org/) is the command-line interface for [WordPress](https://wordpress.org/). You can update plugins, configure multisite installations and much more, without using a web browser. +[WP-CLI](https://wp-cli.org/) is a set of command-line tools for managing [WordPress](https://wordpress.org/) installations. You can update plugins, configure multisite installs and much more, without using a web browser. -Ongoing maintenance is made possible by: +To stay up to date, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for our email newsletter](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). + +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open")
- - Automattic - - - Bluehost - - - Pantheon - - - SiteGround - - - WP Engine - - - Cloudways - + border: 1px solid #7AD03A; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-left: 10px; + padding-right: 10px; +"> +

A more RESTful WP-CLI aims to unlocking the potential of the WP REST API at the command line. Project backed by Pressed, Chris Lema, Human Made, Pagely, Pantheon and many others. Learn more →

-The current stable release is [version 2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). For announcements, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for email updates](https://make.wordpress.org/cli/subscribe/). [Check out the roadmap](https://make.wordpress.org/cli/handbook/roadmap/) for an overview of what's planned for upcoming releases. - -[![Testing](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") - Quick links: [Using](#using) | [Installing](#installing) | [Support](#support) | [Extending](#extending) | [Contributing](#contributing) | [Credits](#credits) ## Using -WP-CLI provides a command-line interface for many actions you might perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) lets you install and activate a WordPress plugin: +WP-CLI's goal is to provide a command-line interface for any action you might want to perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) lets you install and activate a WordPress plugin: ```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... +$ wp plugin install rest-api --activate +Installing WordPress REST API (Version 2) (2.0-beta13) +Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. +Activating 'rest-api'... +Success: Plugin 'rest-api' activated. ``` -WP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) lets you delete one or all transients: +WP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) lets you delete one or all transients: ```bash -$ wp transient delete --all +$ wp transient delete-all Success: 34 transients deleted from the database. ``` -For a more complete introduction to using WP-CLI, read the [Quick Start guide](https://make.wordpress.org/cli/handbook/quick-start/). Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities. +For a more complete introduction to using WP-CLI, read the [Quick Start guide](https://wp-cli.org/docs/quick-start/). -Already feel comfortable with the basics? Jump into the [complete list of commands](https://developer.wordpress.org/cli/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more. +Already feel comfortable with the basics? Jump into the [complete list of commands](https://wp-cli.org/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more. ## Installing -Downloading the Phar file is our recommended installation method for most users. Should you need, see also our documentation on [alternative installation methods](https://make.wordpress.org/cli/handbook/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)). +Downloading the Phar file is our recommended installation method. Should you need, see also our documentation on [alternative installation methods](https://wp-cli.org/docs/installing/). Before installing WP-CLI, please make sure your environment meets the minimum requirements: - UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment -- PHP 5.6 or later -- WordPress 3.7 or later. Versions older than the latest WordPress release may have degraded functionality +- PHP 5.3.29 or later +- WordPress 3.7 or later -Once you've verified requirements, download the [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`: +Once you've verified requirements, download the [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`: ```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` -Next, check the Phar file to verify that it's working: +Next, check if it is working: ```bash -php wp-cli.phar --info +$ php wp-cli.phar --info ``` To use WP-CLI from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example: ```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp +$ chmod +x wp-cli.phar +$ sudo mv wp-cli.phar /usr/local/bin/wp ``` If WP-CLI was installed successfully, you should see something like this when you run `wp --info`: ```bash $ wp --info -OS: Linux 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 -Shell: /usr/bin/zsh -PHP binary: /usr/bin/php8.1 -PHP version: 8.1.0 -php.ini used: /etc/php/8.1/cli/php.ini -MySQL binary: /usr/bin/mysql -MySQL version: mysql Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) -SQL modes: -WP-CLI root dir: /home/wp-cli/ -WP-CLI vendor dir: /home/wp-cli/vendor -WP_CLI phar path: +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: -WP-CLI project config: /home/wp-cli/wp-cli.yml -WP-CLI version: 2.12.0 +WP-CLI global config: /home/wp-cli/.wp-cli/config.yml +WP-CLI project config: +WP-CLI version: 0.23.0 ``` ### Updating -You can update WP-CLI with `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), or by repeating the installation steps. - -If WP-CLI is owned by root or another system user, you'll need to run `sudo wp cli update`. +You can update WP-CLI with `wp cli update` ([doc](https://wp-cli.org/commands/cli/update/)), or by repeating the installation steps. Want to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of WP-CLI. The nightly build is more or less stable enough for you to use in your development environment, and always includes the latest and greatest WP-CLI features. ### Tab completions -WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) and source it from `~/.bash_profile`: +WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash) and source it from `~/.bash_profile`: ```bash source /FULL/PATH/TO/wp-completion.bash @@ -142,32 +117,27 @@ source /FULL/PATH/TO/wp-completion.bash ## Support -WP-CLI's maintainers and contributors have limited availability to address general support questions. The [current version of WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) is the only officially supported version. +WP-CLI's maintainers and project contributors are volunteers, and have limited availability to address general support questions. First, look for an answer in one of the following resources: -When looking for support, please first search for your question in these venues: +- [Common issues and their fixes](https://wp-cli.org/docs/common-issues/) +- [Documentation portal](https://wp-cli.org/docs/) +- [Open or closed issues on Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [runcommand Excerpts](https://runcommand.io/excerpts/) +- [WordPress StackExchange forums](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -* [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/) -* [WP-CLI handbook](https://make.wordpress.org/cli/handbook/) -* [Open or closed issues in the WP-CLI GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* [Threads tagged 'WP-CLI' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/wp-cli/) -* [Questions tagged 'WP-CLI' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) +If you can't find your answer at one of those links, join the `#cli` channel on the [WordPress.org Slack organization](https://make.wordpress.org/chat/) to see if a community member might have an answer for you. Professional users may also consider [runcommand](https://runcommand.io/) for premium support. -If you didn't find an answer in one of the venues above, you can: +Github issues are meant for tracking enhancements and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://wp-cli.org/docs/bug-reports/) to help ensure your issue is addressed in a timely manner. -* Join the `#cli` channel in the [WordPress.org Slack](https://make.wordpress.org/chat/) to chat with whomever might be available at the time. This option is best for quick questions. -* [Post a new thread](https://wordpress.org/support/forum/wp-advanced/#new-post) in the WordPress.org support forum and tag it 'WP-CLI' so it's seen by the community. - -GitHub issues are meant for tracking enhancements to and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://make.wordpress.org/cli/handbook/bug-reports/) to help ensure your issue is addressed in a timely manner. - -Please do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 280 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation. +Please do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 140 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation. Remember, libre != gratis; the open source license grants you the freedom to use and modify, but not commitments of other people's time. Please be respectful, and set your expectations accordingly. ## Extending -A **command** is the atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) is another. +A **command** is an atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) is another. -WP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration. +WP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration. ```php /** @@ -197,31 +167,35 @@ $delete_option_cmd = function( $args ) { WP_CLI::add_command( 'option delete', $delete_option_cmd ); ``` -WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) to learn more. Browse the [internal API docs](https://make.wordpress.org/cli/handbook/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command. +WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://wp-cli.org/docs/commands-cookbook/) to learn more. Browse the [internal API docs](https://wp-cli.org/docs/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command. ## Contributing +Welcome and thanks! + We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project. **Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. -Read through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. +Please take a moment to [read these guidelines at depth](https://wp-cli.org/docs/contributing/). Following them helps to communicate that you respect the time of the other contributors to the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. ## Leadership -WP-CLI has one project maintainer: [schlessera](https://github.com/schlessera). +WP-CLI is led by these individuals: -On occasion, we [grant write access to contributors](https://make.wordpress.org/cli/handbook/committers-credo/) who have demonstrated, over a period of time, that they are capable and invested in moving the project forward. +* [Daniel Bachhuber](https://github.com/danielbachhuber/) - current maintainer +* [Cristi Burcă](https://github.com/scribu) - previous maintainer +* [Andreas Creten](https://github.com/andreascreten) - founder -Read the [governance document in the handbook](https://make.wordpress.org/cli/handbook/governance/) for more operational details about the project. +Read more about the project's [governance](https://wp-cli.org/docs/governance/) and view a [complete list of contributors](https://github.com/wp-cli/wp-cli/contributors). ## Credits Besides the libraries defined in [composer.json](composer.json), we have used code or ideas from the following projects: -* [Drush](https://github.com/drush-ops/drush) for... a lot of things -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate` +* [Drush](http://drush.ws/) for... a lot of things +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) for `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate` * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace` * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export` * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import` diff --git a/it/index.md b/it/index.md index 7f845b20..f0abec9b 100644 --- a/it/index.md +++ b/it/index.md @@ -1,20 +1,30 @@ --- layout: default title: Interfaccia da linea di comando per WordPress -direction: ltr --- [WP-CLI](https://wp-cli.org/) è un insieme di strumenti da linea di comando per la gestione delle installazioni [WordPress](https://wordpress.org/). Potete aggiornare plugin, configurare installazioni multisito e molto altro, senza utilizzare un browser web. -Per rimanere aggiornati, seguite [@wpcli su Twitter](https://twitter.com/wpcli) oppure [iscrivetevi alla nostra newsletter](https://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). +Per rimanere aggiornati, seguite [@wpcli su Twitter](https://twitter.com/wpcli) oppure [iscrivetevi alla nostra newsletter](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). -[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") + +
+

Un orientamento RESTful di WP-CLI, mira a sbloccare le potenzialità WP REST API dalla linea di comando. Progetto sostenuto da Pressed, Chris Lema, Human Made, Pagely, Pantheon e molti altri. Scopri di più →

+
Collegamenti rapidi: [Utilizzo](#utilizzo) | [Installazione](#installazione) | [Supporto](#supporto) | [Estendere](#estendere) | [Contribuire](#contribuire) | [Crediti](#crediti) ## Utilizzo -L'obiettivo di WP-CLI è quello di fornire un'interfaccia da linea di comando per le azioni che normalmente si possono effettuare attraverso l'area amministrativa. Per esempio, `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) vi permette di installare ed attivare un plugin di WordPress: +L'obiettivo di WP-CLI è quello di fornire un interfaccia da linea di comando per le azioni che normalmente si possono effettuare attraverso l'area amministrativa. Per esempio, `wp plugin install --activate` ([doc](https://wp-cli.org/commands/plugin/install/)) vi permette di installare ed attivare un plugin di WordPress: ```bash $ wp plugin install rest-api --activate @@ -27,10 +37,10 @@ Activating 'rest-api'... Success: Plugin 'rest-api' activated. ``` -WP-CLI include anche dei comandi per molte operazioni che normalmente non sarebbe possibile svolgere nell'area amministrativa di WordPress. Per esempio, `wp transient delete --all` ([doc](https://wp-cli.org/commands/transient/delete/)) vi permetterà di eliminare uno o tutti i transienti: +WP-CLI include anche dei comandi per molte operazioni che normalmente non sarebbe possibile svolgere nell'area amministrativa di WordPress. Per esempio, `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) vi permetterà di eliminare uno o tutti i transienti: ```bash -$ wp transient delete --all +$ wp transient delete-all Success: 34 transients deleted from the database. ``` @@ -48,7 +58,7 @@ Prima di procedere con l'installazione di WP-CLI, vi preghiamo di assicurarvi ch - PHP 5.3.29 o successivo - WordPress 3.7 o successivo -Una volta che avrete verificato i requisiti, scaricate il file [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) mediante `wget` o `curl`: +Una volta che avrete verificato i requisiti, scaricate il file [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) mediante `wget` o `curl`: ```bash $ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar @@ -78,7 +88,7 @@ WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ WP-CLI global config: /home/wp-cli/.wp-cli/config.yml WP-CLI project config: -WP-CLI version: 0.25.0 +WP-CLI version: 0.23.0 ``` ### Aggiornamenti @@ -113,7 +123,7 @@ I manutentori e i contributori di WP-CLI sono volontari, hanno limitate disponib - [Portale della documentazione](https://wp-cli.org/docs/) - [Problemi segnalati o estinti su Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) - [Estratti di runcommand](https://runcommand.io/excerpts/) -- [Forum di WordPress su StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) +- [Forum di WordPress su StackExchange](http://wordpress.stackexchange.com/questions/tagged/wp-cli) Se non trovare delle risposte in questi posti, entrate al canale `#cli` su [WordPress.org Slack organization](https://make.wordpress.org/chat/) per vedere se qualche membro della comunità può offrirvele. @@ -165,11 +175,11 @@ Benvenuti e grazie! Apprezziamo che vogliate prendere parte e contribuire a WP-CLI. È per merito vostro e della comunità che vi gravita attorno se WP-CLI è un grande progetto. -**Contribuire non si limita soltanto alla programmazione** +**Contribuire non si limita soltanto alla programmazione** Vi incoraggiamo a contribuire nel modo che meglio rispecchia le vostre abilità, scrivendo tutorial, offrendo dimostrazioni durante i vostri incontri locali, prestare aiuto ad altri utenti riguardo le loro richieste di aiuto, o revisionando la documentazione. -Vi preghiamo di riservare un po' di tempo da dedicare alla [lettura approfondita delle linee guida](https://wp-cli.org/docs/contributing/). Seguirle dimostra il rispetto dei tempi altrui sul progetto. +Vi preghiamo di riservare un po' di tempo da dedicare alla [lettura approfondita delle linee guida](https://wp-cli.org/docs/contributing/). Seguirle dimostra il rispetto dei tempi altrui sul progetto. ## Coordinamento @@ -185,9 +195,9 @@ Leggi di più riguardo la [politica del progetto](https://wp-cli.org/docs/govern Oltre alle librerie definite in [composer.json](composer.json), abbiamo adottato codice o spunti dai seguenti progetti: -* [Drush](https://www.drush.org/) per... un mucchio di cose -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) per `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) per `wp media regenerate` +* [Drush](http://drush.ws/) per... un mucchio di cose +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) per `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) per `wp media regenerate` * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) per `wp search-replace` * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) per `wp export` * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) per `wp import` diff --git a/ja/index.md b/ja/index.md index 98736e71..a04430b2 100644 --- a/ja/index.md +++ b/ja/index.md @@ -1,180 +1,135 @@ --- layout: default title: Command line interface for WordPress -direction: ltr --- -[WP-CLI](https://wp-cli.org/) は [WordPress](https://wordpress.org/) を管理するためのコマンドラインインターフェースです。 -プラグインのアップデートやマルチサイトのセットアップなど、多くのことをブラウザなしで実行できます。 +[WP-CLI](https://wp-cli.org/) は [WordPress](https://wordpress.org/) を管理するためのコマンドラインツールです。 +プラグインのアップデートやマルチサイトのセットアップなどの多くのことをブラウザ無しで行うことができます。 -下記のサポーターの協力で継続的なメンテナンスが行われています。 +最新情報を得たい人は、[@wpcli on Twitter](https://twitter.com/wpcli) をフォローするか、[メーリングリストにサインアップ](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e)してください。 + +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open")
- - Automattic - - - Bluehost - - - Pantheon - - - SiteGround - - - WP Engine - - - Cloudways - + border: 1px solid #7AD03A; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-left: 10px; + padding-right: 10px; +"> +

A more RESTful WP-CLI は、コマンドラインによって WP REST API のポテンシャルを解放します。このプロジェクトは Pressed、Chris Lema、Human Made、Pagely、Pantheon、その他大勢の人たちによって支援されています。さらに詳しく →

-現在の安定バージョンは [2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/) です。 最新情報を得たい人は、[@wpcli on Twitter](https://twitter.com/wpcli) をフォローするか、[メーリングリストにサインアップ](https://make.wordpress.org/cli/subscribe/)してください。[ロードマップ](https://make.wordpress.org/cli/handbook/roadmap/)で今後のリリース予定を知ることができます。 - -[![Testing](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") - -Quick links: [使い方](#使い方) | [インストール方法](#インストール方法) | [サポート](#サポート) | [拡張](#拡張) | [貢献](#貢献) | [クレジット](#クレジット) +Quick links: [使い方](#section) | [インストール方法](#section-1) | [サポート](#section-2) | [拡張](#section-3) | [貢献](#section-4) | [クレジット](#section-5) ## 使い方 -WP-CLI は、みなさんが WordPress の管理画面でやりたいと思っていることに対するコマンドラインインターフェースを提供します。 -たとえば、`wp plugin install --activate` ([ドキュメント](https://developer.wordpress.org/cli/commands/plugin/install/)) というコマンドを実行すると、プラグインをインストールした上で有効化できます。 +WP-CLI のゴールは、みなさんが WordPress の管理画面でやりたいと思うことをコマンドラインで提供することです。 +たとえば、`wp plugin install --activate` ([ドキュメント](https://wp-cli.org/commands/plugin/install/)) は、プラグインをインストールし有効化します。 -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading install package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... +``` +$ wp plugin install rest-api --activate +Installing WordPress REST API (Version 2) (2.0-beta13) +Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. +Activating 'rest-api'... +Success: Plugin 'rest-api' activated. ``` -さらに WP-CLI では、WordPress の管理画面ではできない多くのことを行えます。たとえば、`wp transient delete --all` ([ドキュメント](https://developer.wordpress.org/cli/commands/transient/delete/)) というコマンドを実行すると、一時的に保存されているすべてのデータが削除されます。 +さらに WP-CLI は、WordPress の管理画面ではできない多くのことが可能です。たとえば、`wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) は、Transient に保存されているすべてのデータを削除することを可能にしています。 -```bash -$ wp transient delete --all +``` +$ wp transient delete-all Success: 34 transients deleted from the database. ``` -WP-CLI の使い方について詳しく知りたいときは、[クイックスタートガイド](https://make.wordpress.org/cli/handbook/quick-start/)を読んでください。[Shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) では便利なコマンドラインユーティリティについても学べます。 +WP-CLI の使い方に関するさらに詳しい情報は、[クイックスタートガイド](https://wp-cli.org/docs/quick-start/)を読んでください。 -基本的なことをすでに理解しているなら、[コマンドリスト](https://developer.wordpress.org/cli/commands/)にジャンプして、テーマやプラグインの管理、データのインポートやエクスポート、データベースの検索・置換操作などの詳細を見てください。 +もし、すでに基本的なことを理解しているなら、[コマンドリスト](https://wp-cli.org/ja/commands/)にジャンプして、テーマやプラグインの管理、データのインポートやエクスポート、データベースの操作などについての詳細をみてください。 ## インストール方法 -Phar ファイルのダウンロードによるインストールを推奨します。必要に応じて[上級者向けインストール方法](https://make.wordpress.org/cli/handbook/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)) も参照してください。 +Phar ファイルをダウンロードする方法が、私たちが推奨するインストール方法です。必要なら[上級者向けインストール方法](https://wp-cli.org/docs/installing/)(英語)を見てください。 -WP-CLI をインストールする前に、動作環境を確認します。 +WP-CLI をインストールする前に、動作環境を確認してください。 -- UNIX 系の環境 (OS X, Linux, FreeBSD, Cygwin) ; Windows では一部の機能に制限があります。 -- PHP 5.6 またはそれ以降のバージョン。 -- WordPress 3.7 またはそれ以降のバージョン。WordPress 最新版ではない古いバージョンでは、機能が低下する可能性があります。 +- UNIX 系の環境 (OS X, Linux, FreeBSD, Cygwin); Windows では一部の機能に制限があります。 +- PHP 5.3.29 またはそれ以降のバージョン +- WordPress 3.7 またはそれ以降のバージョン -動作条件を再度確認し、`wget` または `curl` で [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) をダウンロードします。 +動作条件を再度確認してから、`wget`または`curl`を使用して [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) をダウンロードしてください。 -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` +$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` -次に、Phar ファイルが動作していることを確認します。 +次に、それが動作しているかを確認してください。 -```bash -php wp-cli.phar --info +``` +$ php wp-cli.phar --info ``` -WP-CLI を `wp` コマンドで実行するには、wp-cli.phar が実行可能で、かつ、環境変数 `PATH` に登録された場所に置かれていることが必要です。例を示します。 +WP-CLI コマンドを`wp`で実行するには、それに実行権限があることと環境変数`PATH`に登録されていることが必要です。 -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp +``` +$ chmod +x wp-cli.phar +$ sudo mv wp-cli.phar /usr/local/bin/wp ``` -WP-CLI のインストールが成功していれば、`wp --info` コマンドで以下のように出力されるはずです。 +もし、WP-CLI のインストールが成功していれば、`wp --info`を実行したら以下のように出力されるはずです。 -```bash +``` $ wp --info -OS: Linux 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 -Shell: /usr/bin/zsh -PHP binary: /usr/bin/php8.1 -PHP version: 8.1.0 -php.ini used: /etc/php/8.1/cli/php.ini -MySQL binary: /usr/bin/mysql -MySQL version: mysql Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) -SQL modes: -WP-CLI root dir: /home/wp-cli/ -WP-CLI vendor dir: /home/wp-cli/vendor -WP_CLI phar path: +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: -WP-CLI project config: /home/wp-cli/wp-cli.yml -WP-CLI version: 2.12.0 +WP-CLI global config: /home/wp-cli/.wp-cli/config.yml +WP-CLI project config: +WP-CLI version: 0.23.0 ``` ## アップデート -WP-CLI は、`wp cli update` ([ドキュメント](https://developer.wordpress.org/cli/commands/cli/update/)) コマンド、または上述のインストール方法を再度行うことでアップデートできます。 - -ただし、WP-CLI のオーナーが root または他のシステム管理者の場合は、`sudo wp cli update` と実行する必要があります。 +WP-CLI をアップデートするには、`wp cli update` ([doc](https://wp-cli.org/commands/cli/update/)) を実行するか、上述のインストール方法を再度行う必要があります。 -チャレンジ精神旺盛な人は `wp cli update --nightly` を実行してみましょう。最新の開発者向けバージョンの WP-CLI を使うことができます。開発者向けバージョンは、あなたの開発環境で使用する上で十分な信頼性があり、常に最新の機能を含んでいます。 +もっととんがった生き方をしたい? `wp cli update --nightly` を実行すれば、最新の開発者向けバージョンの WP-CLI を使用することができます。開発者向けバージョンは、あなたの開発環境で使用するのに十分な信頼性があり、つねに最新の機能を使用することができます。 ## タブ補完 -WP-CLI には、Bash および zsh 向けのタブ補完スクリプトがあります。スクリプトを使うときは [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) をダウンロードして、`~/.bash_profile` で読み込みます。 +WP-CL には、Bash 及び ZSH 用のタブ補完用のスクリプトがあります。 [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash) をダウンロードして、`~/.bash_profile` から読み込んでください。 -```bash -source /FULL/PATH/TO/wp-completion.bash ``` - -`source ~/.bash_profile` を実行するのをお忘れなく。 - -zsh の場合は、`bashcompinit` をロードした後に `wp-completion.bash` を読み込ませる必要があるかもしれません。`.zshrc` に次のコードを追加してください。 - -```bash -autoload bashcompinit -bashcompinit source /FULL/PATH/TO/wp-completion.bash ``` -## サポート - -WP-CLI のメンテナーとその貢献者が一般的な質問に答えられる時間は限られています。[最新版](https://make.wordpress.org/cli/handbook/roadmap/)のみが公式にサポートされるバージョンです。 - -サポートを受けたいときは、まず、以下のリソースの中から答えを探してみましょう。 - -- [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/) -- [WP-CLI handbook](https://make.wordpress.org/cli/handbook/) -- [Open or closed issues in the WP-CLI GitHub organization](https://github.com/issues?q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -- [Threads tagged 'WP-CLI' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/wp-cli/) -- [Questions tagged 'WP-CLI' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) +`source ~/.bash_profile` を実行するのを忘れないでください。 -上記いずれかの方法で回答を見つけられなかった場合は: +## サポート -- [WordPress.org Slack](https://make.wordpress.org/chat/) の `#cli` チャンネルに参加して、そこにいる人に尋ねてみてください。これが最も手っ取り早い方法です。 -- WordPress サポートフォーラムに[新しいスレッドを投稿](https://wordpress.org/support/forum/wp-advanced/#new-post)し、'WP-CLI' というタグを付けてコミュニティ内で見つけやすくします。 +WP-CLI のメンテナーとプロジェクトの貢献者たちは、新しい Issue に対して、より迅速に返信したいと思っています。これらのボランティアの時間を節約するために、過去に同じ質問に対する回答がないかを確認してください。 -GitHub Issues は、既存のコマンドの改良やバグを追跡するために使われており、一般的なサポートのためには使われていません。バグレポートを投稿する際には、[ベストプラクティス](https://make.wordpress.org/cli/handbook/bug-reports/)を確認して、あなたの抱える問題が適時確実に伝わるように心がけてください。 +- [Common issues and their fixes](https://wp-cli.org/docs/common-issues/) +- [Best practices for submitting a bug report](https://wp-cli.org/docs/bug-reports/) +- [Documentation portal](https://wp-cli.org/docs/) +- [Open or closed issues on Github](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [WordPress StackExchange forums](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -Twitter でサポート用の質問を尋ねるのはご遠慮ください。Twitter は、1) 文字数が 280 文字以下に制限され会話を行うのが難しい、2) 過去の会話から他の人の同じ質問を検索することが難しい、などの理由によりサポートを行う場としてふさわしくないからです。 +もしこれらのリソースから回答を見つけられなかった場合、ご自由にあなたの質問を[Issueを書いてください](https://github.com/wp-cli/wp-cli/issues/new)。 -自由は無料とは違います。オープンソースライセンスはあなたが自由に使ったり編集したりする権利を保証しますが、他の誰かの時間を浪費することを保証しているわけではありません。サポートを受けるに当たっては、敬意を持ち、過度な期待をしないように心がけてください。 +もしあなたが WordPress.org のアカウントを持っているなら、[WordPress.org Slack organization](https://make.wordpress.org/chat/) の`#cli`チャンネルに参加することもできます。 ## 拡張 -それぞれの **コマンド** は、WP-CLI の関数の一つとして定義されています。`wp plugin install` ([ドキュメント](https://developer.wordpress.org/cli/commands/plugin/install/)) はその一つで、`wp plugin activate` ([ドキュメント](https://developer.wordpress.org/cli/commands/plugin/activate/)) もまた、その一つです。 +それぞれの **コマンド** は、WP-CLI の関数の一つとして定義されています。`wp plugin install` ([doc](https://wp-cli.org/commands/plugin/install/)) はそのうちのひとつであり、`wp plugin activate` ([doc](https://wp-cli.org/commands/plugin/activate/)) は別のもうひとつです。 -WP-CLI では、さまざまな実行可能なクラス、関数、クロージャをコマンドとして実行できます。コマンドの実行に必要な情報は PHPDoc で記述します。 `WP_CLI::add_command()` ([ドキュメント](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) は、内部コマンドおよびサードパーティコマンドの登録に使われています。 +WP-CLI では、様々な実行可能なクラス、関数、クロージャをコマンドとして実行することが可能です。コマンドとして実行されるために必要な情報は、PHPdoc によって記述します。 `WP_CLI::add_command()` ([doc](https://wp-cli.org/docs/internal-api/wp-cli-add-command/)) は、内部コマンド及びサードパーティコマンドの登録に使用されています。 -```php +``` /** * Delete an option from the database. * @@ -202,34 +157,36 @@ $delete_option_cmd = function( $args ) { WP_CLI::add_command( 'option delete', $delete_option_cmd ); ``` -WP-CLI は多くのコマンドで構成され、意外と簡単にカスタムコマンドを作ることができます。詳しくは [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) を参照してください。[内部 API のドキュメント](https://make.wordpress.org/cli/handbook/references/internal-api/)には、カスタムコマンドで使用できるさまざまな便利機能が載っています。 +WP-CLI は、多くのコマンドにより構成されており、カスタムコマンドを作ることは意外と簡単です。[commands cookbook](https://wp-cli.org/docs/commands-cookbook/)を読んでください。 ## 貢献 -ようこそ ! ありがとう ! +ようこそ、そしてありがとう! -私たちは、みなさんが率先して貢献してくださることに感謝します。あなたやあなたのまわりのコミュニティによって、WP-CLI はすばらしいプロジェクトになります。 +私たちは、みなさんが率先して貢献してくれることに感謝しています。あなたやあなたのまわりのコミュニティによって、WP-CLIはすばらしいプロジェクトになります。 -**貢献はコードを書くことだけに留まりません。** 私たちは、チュートリアルを書いたり、地元のミートアップでデモを行ったり、ユーザーの質問に回答したり、ドキュメントを改訂したりと、あなたの能力に合った方法で貢献していただきたいと思っています。 +**貢献は単にコードだけではありません。** 私たちは、チュートリアルを書く、地元のミートアップでデモを行う、ユーザーの質問への回答、ドキュメントの改訂など、あなたの日々の活動に応じた貢献をお願いしています。 -ハンドブックに掲載されている[貢献者向けガイドライン](https://make.wordpress.org/cli/handbook/contributions/contributing/)を読めば、どのように貢献できるかを詳しく知ることができます。ガイドラインに従うことで、本プロジェクトの他の貢献者たちとのコミュニケーションが円滑になります。彼らは、世界をまたがってあなたと一緒に働くことに、最大限の敬意を払う努力をします。 +すこしだけ時間を使って[ガイドラインをよく読んでください](https://wp-cli.org/docs/contributing/)。ここに書かれていることに従うことで、本プロジェクトの他の貢献者たちとのコミュニケーションを円滑にすることができます。彼らは、世界をまたがってあなたと一緒に働くことに、最大限の敬意を払う努力をします。 ### プロジェクトリーダー -WP-CLI にはプロジェクトメンテナーがいます: [schlessera](https://github.com/schlessera) です。 +WP-CLIは以下の個人によってリードされています。 -能力があり、プロジェクト発展のため時間をかけていることを示してくれた貢献者には[コミット権限を与えることがあります](https://make.wordpress.org/cli/handbook/committers-credo/)。 +* [Daniel Bachhuber](https://github.com/danielbachhuber/) - 現在のメンテナー +* [Cristi Burcă](https://github.com/scribu) - 前メンテナー +* [Andreas Creten](https://github.com/andreascreten) - 創始者 -プロジェクト運営についての詳細を知りたいときは、[ハンドブック内のガバナンス](https://make.wordpress.org/cli/handbook/governance/)を読んでください。 +プロジェクトの[ガバナンス](https://wp-cli.org/docs/governance/)と[完全な貢献者リスト](https://github.com/wp-cli/wp-cli/contributors)も読んでください。 ## クレジット -[composer.json](https://github.com/wp-cli/wp-cli/blob/master/composer.json) に記載されているライブラリに依存しており、以下のプロジェクトからコードやアイディアを得ています。 +[composer.json](composer.json) に記載されているライブラリに依存しており、以下のプロジェクトからコードやアイディアを得ています。 -- [Drush](https://github.com/drush-ops/drush) for... a lot of things -- [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell` -- [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate` -- [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace` -- [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export` -- [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import` -- [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests` +* [Drush](http://drush.ws/) for... a lot of things +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) for `wp shell` +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate` +* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace` +* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export` +* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import` +* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests` diff --git a/ne/index.md b/ne/index.md index 9be0390e..b4ad4474 100644 --- a/ne/index.md +++ b/ne/index.md @@ -1,16 +1,26 @@ --- layout: default title: वर्डप्रेसको लागि कमाण्ड लाइन इन्टरफेस -direction: ltr --- [WP-CLI](https://wp-cli.org/) कमाण्ड लाइन औजारहरुको संग्रह हो जुन [वर्डप्रेस](https://wordpress.org/) व्यवस्थापन गर्न प्रयोग गरिन्छ । ब्राउजर बिना नै प्लगिन अद्यावधिक गर्न, बहुसाइट कन्फिगर गर्न तथा अन्य धेरै कामको लागि यो प्रयोग गर्न सकिन्छ । -अद्यावधिक हुन, [टुइटरमा @wpcli](https://twitter.com/wpcli) फलो गर्नुहोस् वा [इमेल न्यूजलेटरको लागि साइन अप गर्नुहोस्](https://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e) । +अद्यावधिक हुन, [टुइटरमा @wpcli](https://twitter.com/wpcli) फलो गर्नुहोस् वा [इमेल न्यूजलेटरको लागि साइन अप गर्नुहोस्](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e) । -[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "समस्या समाधान गर्न लाग्ने औसत समय") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "खुला मुद्दाहरू प्रतिशतमा") +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "समस्या समाधान गर्न लाग्ने औसत समय") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "खुला मुद्दाहरू प्रतिशतमा") -द्रुत लिंकहरु: [प्रयोग](#section) | [स्थापना](#section-1) | [सहायता](#section-4) | [विस्तार](#section-5) | [योगदान](#section-6) | [श्रेय](#section-8) +
+

A more RESTful WP-CLI कमाण्ड लाइनमा WP REST API को सम्भावित शक्ति अनलक गर्न लक्षित छ । परियोजना Pressed, Chris Lema, Human Made, Pagely, Pantheon र धेरै अन्य द्वारा समर्थित छ । सिक्नुहोस् →

+
+ +द्रुत लिंकहरु: [प्रयोग](#section) | [स्थापना](#section-1) | [सहायता](#section-2) | [विस्तार](#section-3) | [योगदान](#section-4) | [श्रेय](#section-5) ## प्रयोग @@ -27,10 +37,10 @@ Activating 'rest-api'... Success: Plugin 'rest-api' activated. ``` -WP-CLI मा अन्य कमाण्डहरु पनि उपलब्ध छ जुन वर्डप्रेस व्यवस्थापन प्यानलमा हुँदैन । जस्तै, `wp transient delete --all` ([doc](https://wp-cli.org/commands/transient/delete/)) ले सबै ट्रान्जियन्टहरु मेटाउछ: +WP-CLI मा अन्य कमाण्डहरु पनि उपलब्ध छ जुन वर्डप्रेस व्यवस्थापन प्यानलमा हुँदैन । जस्तै, `wp transient delete-all` ([doc](https://wp-cli.org/commands/transient/delete-all/)) ले सबै ट्रान्जियन्टहरु मेटाउछ: ``` -$ wp transient delete --all +$ wp transient delete-all Success: 34 transients deleted from the database. ``` @@ -44,11 +54,11 @@ Phar फाइल डाउनलोड गरेर स्थापना ग स्थापना गर्नु अघि कृपया न्यूनतम आवश्यकताहरू पूरा भएको निश्चित गर्नुहोस्: -- UNIX जस्तै वातावरण (OS X, Linux, FreeBSD, Cygwin); Windows वातावरणमा सीमित समर्थन +- UNIX जस्तै वातावरण (OS X, Linux, FreeBSD, Cygwin); Windows वातावरणमा सीमित समर्थन - PHP 5.3.29 वा पछि - वर्डप्रेस 3.7 वा पछि -आवश्यकताहरु प्रमाणित गरिसकेपछि `wget` वा `curl` प्रयोग गरि [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) फाइल डाउनलोड गर्नुहोस्: +आवश्यकताहरु प्रमाणित गरिसकेपछि `wget` वा `curl` प्रयोग गरि [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) फाइल डाउनलोड गर्नुहोस्: ``` $ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar @@ -60,7 +70,7 @@ $ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.p $ php wp-cli.phar --info ``` -WP-CLI लाई कमाण्ड लाइनबाट `wp` टाइप गरि प्रयोग गर्न कार्यान्वयन योग्य बनाउनु होस् अनि कतै तपाईको PATH मा सार्नुहोस् । जस्तै: +WP-CLI लाई कमाण्ड लाइनबाट `wp` टाइप गरि प्रयोग गर्नकार्यान्वयन योग्य बनाउनु होस् अनि कतै तपाईको PATH मा सार्नुहोस् । जस्तै: ``` $ chmod +x wp-cli.phar @@ -78,7 +88,7 @@ WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ WP-CLI global config: /home/wp-cli/.wp-cli/config.yml WP-CLI project config: -WP-CLI version: 0.25.0 +WP-CLI version: 0.23.0 ``` ### अद्यावधिक @@ -97,14 +107,6 @@ source /FULL/PATH/TO/wp-completion.bash तत्पश्चात `source ~/.bash_profile` कमाण्ड हान्न नबिर्सनुहोस् । -यदि तपाईं सेलको लागि ZSH प्रयोग गर्नु हुन्छ भने सोर्स गर्नु भन्दा अगि `bashcompinit` लोड गरेर सुरु गर्नु पर्छ । `.zshrc` मा तलको कोड राख्नुहोस्: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - ## सहायता सबै नयाँ मुद्दाहरुमा समयमै जवाफ दिन WP-CLI का मर्मतकर्ता तथा परियोजना योगदानकर्ताहरु हरदम तत्पर रहन्छन् । ती स्वयंसेवकहरुको समयको उत्तम उपयोग गर्न कृपया पहिला तलका स्रोतहरूमा जांच गर्नुहोस् तपाईको प्रश्नको उत्तर छ कि भनेर: @@ -113,46 +115,16 @@ source /FULL/PATH/TO/wp-completion.bash - [बग प्रतिवेदनको लागि उत्तम अभ्यासहरू](https://wp-cli.org/docs/bug-reports/) - [दस्तावेज पोर्टल](https://wp-cli.org/docs/) - [Github मा खुल्ला तथा बन्द समस्याहरु](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) -- [वर्डप्रेस StackExchange फोरम](https://wordpress.stackexchange.com/questions/tagged/wp-cli) - -यदि तपाईंले ती स्रोतहरूमा आफ्नो जवाफ पाउन सक्नुभएन भने [WordPress.org Slack organization](https://make.wordpress.org/chat/) मा `#cli` च्यानलमा सामेल भई प्रश्न सोध्न सक्नुहुन्छ। व्यावसायिक प्रयोगकर्ताहरुले प्रिमियम सहायताको लागि [runcommand](https://runcommand.io/) मा पनि सम्पर्क गर्न सक्नुहुन्छ । +- [वर्डप्रेस StackExchange फोरम](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -गिटहब मुद्धा भनेको उन्नति तथा अबस्थित कमाण्डका बगहरुको लागि मात्र हो, साधारण सहायताको लागि हैन । मुद्धा दर्ता गर्नु अगि कृपया [राम्रो अभ्यासहरू](https://wp-cli.org/docs/bug-reports/) हेर्नुहोस् ताकी तपाईंको मुद्धा समयबद्ध ढंगमा सम्बोधन होस् । +यदि तपाईंले ती स्रोतहरूमा आफ्नो जवाफ पाउन सक्नुभएन भने, आफ्नो प्रश्न समावेश गरि [मुद्दा सिर्जना](https://github.com/wp-cli/wp-cli/issues/new) गर्न सक्नुहुन्छ । -कृपया टुइटरमा सहायता प्रश्न नसोध्नु होला । किनकि १) १४० अक्षरमा सम्बाद गर्न अप्ठ्यारो हुन्छ २) अघिल्ला सम्बादका प्रश्नहरु खोजी गर्न सकिदैन । +यदि तपाईंसंग WordPress.org अकाउन्ट छ भने [WordPress.org Slack organization](https://make.wordpress.org/chat/) मा `#cli` च्यानलमा सामेल हुन सक्नुहुन्छ । ## विस्तार **कमाण्ड** WP-CLI कार्यक्षमताको एक परमाणु एकाइ हो । `wp plugin install` ([डक](https://wp-cli.org/commands/plugin/install/)) एउटा कमाण्ड हो । `wp plugin activate` ([डक](https://wp-cli.org/commands/plugin/activate/)) अर्को कमाण्ड हो । -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` - WP-CLI मा दर्जनौं कमाण्डहरू छन् । कस्टम WP-CLI कमाण्ड सिर्जना गर्न सजिलो छ । अरु जान्न [कमाण्ड पाकपुस्तिका](https://wp-cli.org/docs/commands-cookbook/) पढ्नुहोस् । कस्टम WP-CLI कमाण्डमा प्रयोग गर्न सकिने सहयोगी प्रकार्यहरु पत्ता लगाउन [आन्तरिक API दस्तावेजहरु](https://wp-cli.org/docs/internal-api/) ब्राउज गर्नुहोस् । ## योगदान @@ -179,9 +151,9 @@ WP-CLI मा यी व्यक्तिहरूको नेतृत्व [composer.json](composer.json) मा परिभाषित बाहेक हामीले निम्न परियोजनाहरुबाट कोड वा विचारहरु प्रयोग गरेका छौं: -* [Drush](https://www.drush.org/) धेरै कुराहरुको लागि -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) `wp shell` को लागि -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) `wp media regenerate` को लागि +* [Drush](http://drush.ws/) धेरै कुराहरुको लागि +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) `wp shell` को लागि +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) `wp media regenerate` को लागि * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) `wp search-replace` को लागि * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) `wp export` को लागि * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) `wp import` को लागि diff --git a/restful/index.md b/restful/index.md index 4630c8a2..e747c682 100644 --- a/restful/index.md +++ b/restful/index.md @@ -7,7 +7,7 @@ title: A more RESTful WP-CLI *Landing page last updated: August 1, 2016* -WP-CLI's mission is to be, quantitatively, the *fastest* interface for developers to manage WordPress. "A more RESTful WP-CLI" was a [Kickstarter-backed](https://www.kickstarter.com/projects/danielbachhuber/a-more-restful-wp-cli/description) project to unlock the potential of the [WordPress REST API](https://v2.wp-api.org/) at the command line. This funding supported 232.42 hours of [Daniel Bachhuber](https://danielbachhuber.com/)'s time towards making improvements to WP-CLI and the WP REST API. For a full debrief, [read the Post Status post about the project](https://poststatus.com/kickstarter-open-source-project/). +WP-CLI's mission is to be, quantitatively, the *fastest* interface for developers to manage WordPress. "A more RESTful WP-CLI" was a [Kickstarter-backed](https://www.kickstarter.com/projects/danielbachhuber/a-more-restful-wp-cli/description) project to unlock the potential of the [WordPress REST API](http://v2.wp-api.org/) at the command line. This funding supported 232.42 hours of [Daniel Bachhuber](http://danielbachhuber.com/)'s time towards making improvements to WP-CLI and the WP REST API. Wait a second, what does it mean to "unlock the potential of the WP REST API at the command line"? Pragmatically, it means any endpoints registered in plugins or themes are *automagically* accessible as WP-CLI commands. For instance, if you were to register an endpoint for `GET /my-plugin/v1/product/`, this endpoint is also accessible on the command line as (more or less) `wp @prod product get `. @@ -43,7 +43,7 @@ Just like WordPress has plugins, the future of WP-CLI is [packages of commands]( In this model, WP-CLI becomes the common interface, and supporting application layer, to a rich ecosystem of features. Doing so opens more frontiers for innovation, which leads to a greater selection of ideas to choose from. And because more people are involved in authoring packages, WP-CLI benefits from a larger contributor pool. -As a result of the Kickstarter project, you can install WP-CLI packages from the Package Index with `wp package install`, [read through the commands cookbook](https://wp-cli.org/docs/commands-cookbook/) for a thorough introduction to creating a WP-CLI command, or use `wp scaffold package` ([repo](https://github.com/wp-cli/scaffold-package-command)) for the easiest way to generate the boilerplate for your new WP-CLI package, complete with functional tests. +As a result of the Kickstarter project, you can install WP-CLI packages from the Package Index with `wp package install`, [read through the commands cookbook](http://wp-cli.org/docs/commands-cookbook/) for a thorough introduction to creating a WP-CLI command, or use `wp scaffold package` ([repo](https://github.com/wp-cli/scaffold-package-command)) for the easiest way to generate the boilerplate for your new WP-CLI package, complete with functional tests. ### Documentation portal @@ -80,7 +80,7 @@ Releases: Presentations: * [My condolences, you’re now the maintainer of a popular open source project](https://runcommand.io/2016/06/26/my-condolences-youre-now-the-maintainer-of-a-popular-open-source-project/) - WordCamp Europe (June 25, 2016) -* [Unlocking the potential of the WP REST API at the command line](https://blog.handbuilt.co/2016/01/28/feelingrestful-a-more-restful-wp-cli/) - A Day of REST (January 28, 2016) +* [Unlocking the potential of the WP REST API at the command line](http://blog.handbuilt.co/2016/01/28/feelingrestful-a-more-restful-wp-cli/) - A Day of REST (January 28, 2016) *** @@ -161,17 +161,17 @@ This project is made possible thanks to the backing of many generous organizatio - + - + - + diff --git a/ro/index.md b/ro/index.md deleted file mode 100644 index 7082ed1a..00000000 --- a/ro/index.md +++ /dev/null @@ -1,203 +0,0 @@ ---- -layout: default -title: Interfața liniei de comandă pentru WordPress -direction: ltr ---- - -[WP-CLI](https://wp-cli.org/) este interfața liniei de comandă pentru [WordPress](https://wordpress.org/). Poți actualiza module, configura instalări multisit și multe altele, fără să folosești un navigator web. - -Întreținerea continuă este făcută posibilă de către: - - - -Lansarea stabilă curentă este [versiunea 2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). Pentru anunțuri, urmărește [@wpcli pe Twitter](https://twitter.com/wpcli) sau [înregistrează-te pentru actualizări pe email](https://make.wordpress.org/cli/subscribe/). [Consultă foaia de parcurs](https://make.wordpress.org/cli/handbook/roadmap/) pentru o prezentare generală a ceea ce este plănuit pentru lansările viitoare. - -[![Stare compilare](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Durata medie pentru rezolvarea unei probleme](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Durata medie pentru rezolvarea unei probleme") [![Procentul problemelor încă deschise](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Procentul problemelor încă deschise") - -Legături rapide: [Folosire](#folosire) | [Instalare](#instalare) | [Asistență](#asistenta) | [Extindere](#extindere) | [Contribuție](#contribuire) | [Credite](#credite) - -## Folosire - -WP-CLI oferă o interfață de linie de comandă pentru multe acțiuni pe care le-ai putea executa în administrarea WordPress. De exemplu, `wp plugin install --activate` ([documentație](https://developer.wordpress.org/cli/commands/plugin/install/)) îți permite să instalezi și să activezi un modul WordPress: - -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... -Unpacking the package... -Installing the plugin... -Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. -``` - -WP-CLI include de asemenea comenzi pentru multe lucruri pe care nu le poți face în administrarea WordPress. De exemplu, `wp transient delete --all` ([documentație](https://developer.wordpress.org/cli/commands/transient/delete/)) îți permite să ștergi unul sau toți tranzienții: - -```bash -$ wp transient delete --all -Success: 34 transients deleted from the database. -``` - -Pentru o introducere mai completă a utilizării WP-CLI, citește [Ghidul de inițiere rapidă](https://make.wordpress.org/cli/handbook/quick-start/). Sau vino alături de [prietenii shell](https://make.wordpress.org/cli/handbook/shell-friends/) pentru a afla despre utilitățile liniei de comandă. - -Deja te simți confortabil cu elementele de bază? Sari în [lista completă de comenzi](https://developer.wordpress.org/cli/commands/) pentru informații detaliate despre gestionarea temelor și modulelor, importarea și exportarea datelor, efectuarea operațiunilor de căutare-înlocuire în baza de date și mai multe. - -## Instalare - -Descărcarea fișierului Phar este metoda noastră de instalare recomandată pentru cei mai mulți utilizatori. Dacă ai nevoie, vezi și documentația noastră despre [metodele de instalare alternative](https://make.wordpress.org/cli/handbook/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)). - -Înainte să instalezi WP-CLI, te rog asigură-te că mediul tău respectă cerințele minime: - -- Mediu asemănător UNIX (OS X, Linux, FreeBSD, Cygwin); asistență limitată pentru mediul Windows -- PHP 5.6 sau mai recent -- WordPress 3.7 sau mai recent. Versiuniile mai vechi decât ultima versiune WordPress ar putea avea funcționalități degradate - -Odată ce ai verificat cerințele, descarcă fișierul [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) folosind `wget` sau `curl`: - -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -``` - -Mai departe, verifică fișierul Phar pentru a vedea dacă funcționează: - -```bash -php wp-cli.phar --info -``` - -Pentru a folosi WP-CLI din lina de comandă tastând `wp`, fă fișierul executabil și mută-l undeva în PATH-ul tău. De exemplu: - -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp -``` - -Dacă WP-CLI a fost instalat cu succes, ar trebui să vezi ceva asemănător când rulezi `wp --info`: - -```bash -$ wp --info -OS: Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64 -Shell: /bin/zsh -PHP binary: /usr/local/bin/php -PHP version: 7.0.22 -php.ini used: /etc/local/etc/php/7.0/php.ini -WP-CLI root dir: /home/wp-cli/.wp-cli/vendor/wp-cli/wp-cli -WP-CLI vendor dir: /home/wp-cli/.wp-cli/vendor -WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: /home/wp-cli/.wp-cli/config.yml -WP-CLI project config: -WP-CLI version: 2.12.0 -``` - -### Actualizare - -Poți actualiza WP-CLI cu `wp cli update` ([documentație](https://developer.wordpress.org/cli/commands/cli/update/)) sau repetând pașii de instalare. - -Dacă WP-CLI este deținut de root sau un alt utilizator de sistem, trebuie să rulezi `sudo wp cli update`. - -Vrei să trăiești viața la limită? Rulează `wp cli update --nightly` pentru a folosi ultima compilare nocturnă a WP-CLI. Compilarea nocturnă este mai mult sau mai puțin stabilă pentru a fi utilizată în mediul tău de dezvoltare și întotdeauna include ultimele și cele mai grozave funcționalități WP-CLI. - -### Auto-completare - -WP-CLI vine de asemenea cu un script de auto-completare pentru Bash și ZSH. Doar descarcă [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) și rulează source pe el din `~/.bash_profile`: - -```bash -source /FULL/PATH/TO/wp-completion.bash -``` - -Nu uita să rulezi apoi și `source ~/.bash_profile`. - -Dacă folosești zsh pentru shell-ul tău, trebuie să încarci și să pornești `bashcompinit` înainte de comanda source. Pune următoarele în `.zshrc`: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - -## Asistență - -Întreținătorii WP-CLI și contribuitorii au disponibilitate limitată pentru a răspunde la întrebările de asistență generală. [Versiunea curentă WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) este singura versiune oficială pentru care se oferă asistență. - -Când ai nevoie de asistență, te rog să cauți mai întâi întrebarea ta în aceste locuri: - -* [Probleme comune și remedierea lor](https://make.wordpress.org/cli/handbook/common-issues/) -* [Manual WP-CLI](https://make.wordpress.org/cli/handbook/) -* [Probleme deschise sau închise în WP-CLI GitHub](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* [Subiecte etichetate cu „WP-CLI” în forumul de asistență WordPress.org](https://wordpress.org/support/topic-tag/wp-cli/) -* [Întrebări etichetate cu „WP-CLI” în WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) - -Dacă n-ai găsit un răspuns într-unul dintre locațiile de mai sus, poți: - -* Să te alături canalului `#cli` în [WordPress.org Slack](https://make.wordpress.org/chat/) pentru a vorbi cu cineva care ar putea fi disponibil în acel moment. Această opțiune este cea mai bună pentru întrebări rapide. -* [Să postezi un subiect nou](https://wordpress.org/support/forum/wp-advanced/#new-post) în forumul de asistență WordPress.org și să-l etichetezi „WP-CLI” pentru a fi văzut de comunitate. - -Tichetele GitHub sunt menite să urmărească îmbunătățirile și erorile comenzilor existente, nu pentru asistență generală. Înainte să trimiți un raport de eroare, te rog să [revezi cele mai bune practici ale noastre](https://make.wordpress.org/cli/handbook/bug-reports/) pentru a te asigura că problema ta este abordată în timp util. - -Te rog nu adresa întrebări de asistență pe Twitter. Twitter nu este un loc acceptat pentru asistență pentru că: 1) este greu să ții conversații sub 280 de caractere și 2) Twitter nu este un loc unde cineva cu aceeași întrebare ca a ta poate căuta un răspuns într-o conversație anterioară. - -Ține minte, libre != gratis; licența pentru sursa deschisă îți oferă libertate de folosire și modificare, dar nu angajamentul timpului altor persoane. Te rog fii respectuos și setează-ți așteptările în consecință. - -## Extindere - -O **comandă** este unitatea atomică a funcționalității WP-CLI. `wp plugin install` ([documentație](https://developer.wordpress.org/cli/commands/plugin/install/)) este o comandă. `wp plugin activate` ([documentație](https://developer.wordpress.org/cli/commands/plugin/activate/)) este alta. - -WP-CLI suportă înregistrarea oricărei clase, funcție, sau închidere apelabilă ca o comandă. Ea citește detalii de folosire din blocul PHPdoc al funcției de apel. `WP_CLI::add_command()` ([documentație](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) este folosită și intern, și pentru înregistrarea comenzilor din terțe părți. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` - -WP-CLI vine cu zeci de comenzi. Este mai ușor decât pare să creezi o comandă personalizată WP-CLI. Citește [cartea de bucate a comenzilor](https://make.wordpress.org/cli/handbook/commands-cookbook/) pentru a afla mai multe. Răsfoiește [documentația internă API](https://make.wordpress.org/cli/handbook/internal-api/) pentru a descoperi o varietate de funcții ajutătoare pe care le poți folosi în comanda ta personalizată WP-CLI. - -## Contribuție - -Apreciem că ai inițiativa de a contribui la WP-CLI. Datorită ție și comunității din jurul tău, acest WP-CLI este un proiect grozav. - -**Contribția nu este limitată doar la cod.** Te încurajăm să contribui în modul care se potrivește cel mai bine abilităților tale, scriind tutoriale, oferind un demo la meetup-ul tău local, ajutând alți utilizatori cu întrebările lor de asistență sau revizuind documentația. - -Citește prin [ghidul de contribuire din manual](https://make.wordpress.org/cli/handbook/contributing/) pentru o introducere detaliată a modului în care te poți implica. Urmând aceste instrucțiuni te ajută să comunici că respecți timpul altor contribuitori în proiect. La rândul lor, ei vor face tot ce le stă în putință pentru a-ți întoarce acest respect atunci când lucrează cu tine, în zonele de fus orar și în întreaga lume. - -## Leadership - -WP-CLI are un întreținător de proiect: [schlessera](https://github.com/schlessera). - -Ocazional, noi [acordăm acces de scriere contribuitorilor](https://make.wordpress.org/cli/handbook/committers-credo/) care au demonstrat, de-a lungul unei perioade de timp, că sunt capabili și investesc în avansarea proiectului. - -Citește [documentul de guvernanță din manual](https://make.wordpress.org/cli/handbook/governance/) pentru mai multe detalii operaționale despre proiect. - -## Credite - -Pe lângă bibliotecile definite în [composer.json](composer.json), am folosit cod sau idei din următoarele proiecte: - -* [Drush](https://github.com/drush-ops/drush) pentru... o grămadă de lucruri -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) pentru `wp shell` -* [Regenerează miniaturile](https://wordpress.org/plugins/regenerate-thumbnails/) pentru `wp media regenerate` -* [Caută-Înlocuiește-DB](https://github.com/interconnectit/Search-Replace-DB) pentru `wp search-replace` -* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) pentru `wp export` -* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) pentru `wp import` -* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) pentru `wp scaffold plugin-tests` diff --git a/tr/index.md b/tr/index.md index 14efb39a..2da680e8 100644 --- a/tr/index.md +++ b/tr/index.md @@ -1,215 +1,155 @@ --- layout: default title: WordPress için Komut Satırı Arayüzü -direction: ltr --- -[WP-CLI](https://wp-cli.org/), [WordPress](https://wordpress.org/) için komut satırı arayüzüdür. Eklenti güncellemesi, multisite kurulumların yapılandırılması ve daha birçok şeyi web tarayıcısına ihtiyaç duymadan gerçekleştirebilirsiniz. +[WP-CLI](https://wp-cli.org/) [WordPress](https://wordpress.org/) kurulumlarını yönetmek için komutlar sunan bir komut satırı aracıdır. Eklenti güncellemesi, multisite kurulumların yapılandırılması ve daha birçok şeyi web tarayıcısına ihtiyaç duymadan gerçekleştirebilirsiniz. -Süregelen bakım, aşağıdakiler sayesinde: - +Güncel kalmak için [@wpcli Twitter](https://twitter.com/wpcli) hesabını takip edebilir ya da [eposta bültenine abone olabilirsiniz](http://wp-cli.us13.list-manage.com/subscribe?u=0615e4d18f213891fc000adfd&id=8c61d7641e). -Mevcut kararlı sürüm [versiyon 2.3.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). Duyurular için [@wpcli Twitter](https://twitter.com/wpcli) hesabını takip edebilir ya da [eposta bültenine abone olabilirsiniz](https://make.wordpress.org/cli/subscribe/). Gelecek sürüm planına genel bir bakış için [yol haritasına göz atın](https://make.wordpress.org/cli/handbook/roadmap/). -[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.png?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](http://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") +
+

Daha RESTful WP-CLI, WP REST API'nin potansiyelini komut satırı üzerinde göstermeyi amaçlıyor. Proje Pressed, Chris Lema, Human Made, Pagely, Pantheon ve daha pek çokları tarafından desteklendi. Ayrıntılı bilgi için →

+
-Bağlantılar: [Kullanım](#kullanm) | [Kurulum](#kurulum) | [Destek](#destek) | [Genişletmek](#geniletmek) | [Katkıda Bulunmak](#katkda-bulunmak) | [Jenerik](#jenerik) +Bağlantılar: [Kullanım](#kullanm) | [Kurulum](#kurulum) | [Destek](#destek) | [Genişletmek](#geniletmek) | [Katkıda Bulunmak](#katkda-bulunmak) | [Katkıda Bulunanlar](#katkda-bulunanlar) ## Kullanım -WP-CLI, WordPress yönetim panelinden gerçekleştirebileceğiniz çoğu işlem için komut-satırı arabirimi sunar. Örneğin `wp plugin install --activate` ([belge](https://developer.wordpress.org/cli/commands/plugin/install/)) bir WordPress eklentisini kurmanızı ve aktifleştirmenizi sağlar: +WP-CLI, WordPress yönetim panelinden gerçekleştirebileceğiniz tüm işlemler için komut-satırı arabirimi sunmayı amaçlar. Örneğin `wp plugin install` ([belge](https://wp-cli.org/commands/plugin/install/)) bir WordPress eklentisini kurmanızı ve aktifleştirmenizi sağlar: -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... +``` +$ wp plugin install rest-api --activate +Installing WordPress REST API (Version 2) (2.0-beta13) +Downloading install package from https://downloads.wordpress.org/plugin/rest-api.2.0-beta13.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. +Activating 'rest-api'... +Success: Plugin 'rest-api' activated. ``` -WP-CLI ayrıca WordPress yönetim panelinden gerçekleştiremeyeceğiniz komutları da barındırır. Örneğin, `wp transient delete --all` ([belge](https://developer.wordpress.org/cli/commands/transient/delete/)) bir veya daha fazla transient'i silmenizi sağlar: +WP-CLI ayrıca WordPress yönetim panelinden gerçekleştiremeyeceğiniz komutları da barındırır. Örneğin, `wp transient delete-all` ([belge](https://wp-cli.org/commands/transient/delete-all/)) bir veya daha fazla transient'i silmenizi sağlar: -```bash -$ wp transient delete --all +``` +$ wp transient delete-all Success: 34 transients deleted from the database. ``` -WP-CLI kullanımı hakkında daha detaylı bilgi için, [Hızlı Giriş belgesini](https://make.wordpress.org/cli/handbook/quick-start/) okuyun. Veya [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) belgesini okuyarak yararlı komut satırı yardımcı programları hakkında bilgi edinin. +WP-CLI kullanımı hakkında detaylı bilgi için, [Hızlı Giriş belgesini](https://wp-cli.org/docs/quick-start/) okuyun. -Temel şeyleri zaten biliyorum diyorsanız, direkt [komutlara](https://developer.wordpress.org/cli/commands/) dalıp tema ve eklenti yönetimi, veri aktarımı, veritabanı bul-değiştir işlemi ve dahası hakkında detaylı bilgiye ulaşabilirsiniz. +Temel şeyleri zaten biliyorum diyorsanız, direkt [komutlara](https://wp-cli.org/commands/) dalıp tema ve eklenti yönetimi, veri aktarımı, veritabanı bul-değiştir işlemi ve dahası hakkında detaylı bilgiye ulaşabilirsiniz. -## Kurulum -Çoğu kullanıcı için Phar dosyasını indirerek kurmalarını öneririz. Ayrıca, ihtiyacınız olursa [alternatif kurulum yöntemlerine](https://make.wordpress.org/cli/handbook/installing/) kurulum dökümanından ulaşabilirsiniz. ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)). +## Kurulum +Phar dosyasını indirerek kurmanızı öneririz. İhtiyacınız olursa, [alternatif kurulum yöntemlerine](https://wp-cli.org/docs/installing/) kurulum dökümanından ulaşabilirsiniz. + Lütfen WP-CLI'i kurmadan önce minimum ortam gereksinimlerin karşılandığından emin olunuz: - UNIX-benzeri işletim sistemi (OS X, Linux, FreeBSD, Cygwin); Windows kısıtlı desteklenir -- PHP 5.6 veya sonrası -- WordPress 3.7 veya daha üst sürüm. Son WordPress sürümden eski sürümler daha az işlevsellik sunabilir +- PHP 5.3.29 veya daha üst sürüm +- WordPress 3.7 veya daha üst sürüm -Gerensinimleri karşıladıktan sonra, [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) dosyasını `wget` veya `curl` ile indirin: +Gerensinimleri karşıladıktan sonra, [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) dosyasını `wget` veya `curl` ile indirin: -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` +$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ``` Sonra, çalışıp çalışmadığını kontrol edin: -```bash -php wp-cli.phar --info +``` +$ php wp-cli.phar --info ``` WP-CLI'e komut satırından `wp` yazarak erişebilmek için dosyayı çalıştırılabilir hale getirin ve PATH'de tanımlı olan bir yere taşıyın. Örneğin: -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp +``` +$ chmod +x wp-cli.phar +$ sudo mv wp-cli.phar /usr/local/bin/wp ``` Eğer kurulum başarılı bir şekilde tamamlandıysa, `wp --info` komutunu çalıştırdığınızda buna benzer birşey göreceksiniz: -```bash +``` $ wp --info -OS: Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64 -Shell: /bin/zsh -PHP binary: /usr/local/bin/php -PHP version: 7.0.22 -php.ini used: /etc/local/etc/php/7.0/php.ini -WP-CLI root dir: /home/wp-cli/.wp-cli/vendor/wp-cli/wp-cli -WP-CLI vendor dir: /home/wp-cli/.wp-cli/vendor +PHP binary: /usr/bin/php5 +PHP version: 5.5.9-1ubuntu4.14 +php.ini used: /etc/php5/cli/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ WP-CLI global config: /home/wp-cli/.wp-cli/config.yml WP-CLI project config: -WP-CLI version: 2.3.0 -``` - - -### Güncelleme - -WP-CLI'i `wp cli update` komutu ([belge](https://developer.wordpress.org/cli/commands/cli/update/)) ile veya kurulum adımlarını tekrarlayarak güncelleyebilirsiniz. - -Eğer WP-CLI, root veya başka bir sistem kullanıcısı tarafından sahiplenildiyse `sudo wp cli update` çalıştırmanız gerekecektir. - -Sınırda yaşamayı seviyor musunuz? `wp cli update --nightly` komutu ile nightly build sürümüne güncelleyebilirsiniz. Geliştirme ortamınız için nightly build sürümler daha çok ya da az stabil olabilir ve her zaman en son ve yeni WP-CLI özelliklerini içerir. - -### Sekme tamamlama - -WP-CLI ayrıca, Bash ve ZSH için sekme tamamlama scripti sunar. Yapmanız gereken sadece [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) dosyasını indirmek ve kaynak olarak `~/.bash_profile` dosyanıza tanımlamak: - -```bash -source /FULL/PATH/TO/wp-completion.bash +WP-CLI version: 0.23.0 ``` -Ekledikten sonra `source ~/.bash_profile` komutunu çalıştırmayı unutmayın. +WP-CLI'i `wp cli update` komutu ([belge](https://wp-cli.org/commands/cli/update/)) ile veya kurulum adımlarını tekrarlayarak güncelleyebilirsiniz. -Shell için zsh kullanıyorsanız, kaynak olarak tanımlamadan önce `bashcompinit` i yükleyip çalıştırmanız gerekebilir. Aşağıdaki kodları `.zshrc` dosyanıza ekleyin: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` ## Destek -WP-CLI'nin bakımcıları ve katılımcıları genel destek soruları için sınırlı müsaitliğe sahiptir. [Mevcut WP-CLI sürümu](https://make.wordpress.org/cli/handbook/roadmap/) resmi olarak desteklenen tek sürümdür. - -Lütfen desteğe ihtiyacınız olduğünda, öncelikle sorunuzu aşağıdaki kaynaklarda arayın: +WP-CLI bakımcıları ve katılımcıları tüm yeni gelen soruları cevaplamak için ellerinden geleni yapmaktadır. Onların zamanını verimli kullanmak adına, lütfen öncelikle sorunuzun cevabını aşağıdaki kaynaklarda arayın: -* [Ortak sorunlar ve çözümleri](https://make.wordpress.org/cli/handbook/common-issues/) -* [WP-CLI el kitabı](https://make.wordpress.org/cli/handbook/) -* [GitHub organizasyonu üzerindeki açık veya kapalı konular](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* ['WP-CLI' ile etiketlenmiş WordPress.org destek forumları](https://wordpress.org/support/topic-tag/wp-cli/) -* ['WP-CLI' ile etiketlenmiş WordPress StackExchange soruları](https://wordpress.stackexchange.com/questions/tagged/wp-cli) -Eğer bu kaynaklarda sorularınıza cevap bulamazsanız: +- [Ortak sorunlar ve çözümleri](https://wp-cli.org/docs/common-issues/) +- [Hata bildirimi](https://wp-cli.org/docs/bug-reports/) +- [Dökümantasyon](https://wp-cli.org/docs/) +- [Github üzerindeki açık veya kapalı konular](https://github.com/wp-cli/wp-cli/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [WordPress StackExchange forumları](http://wordpress.stackexchange.com/questions/tagged/wp-cli) -* [WordPress.org Slack](https://make.wordpress.org/chat/) üzerinden `#cli` kanalında müsait olanlarla sohbet edebilirsiniz. Hızlı sorular için en iyi seçenektir. -* WordPress.org destek forumlarında [yeni bir konu](https://wordpress.org/support/forum/wp-advanced/#new-post) açıp, 'WP-CLI' etiketi ekleyin, böylece topluluk tarafından görülür. - -Github konuları mevcut komutlar için yenilik ve hata takibi icin kullanılmaktadır, genel destek için değildir. Hata bildirimi göndermeden önce, sorununuz zamanında ele alınması için lütfen [hata bildirimi yöntemini](https://make.wordpress.org/cli/handbook/bug-reports/) gözden geçirin. - -Lütfen Twitter üzerinden destek soruları sormayın. Twitter destek için iyi bir yer değildir, çünkü: 1) Yazışmaları 280 karakterin altında tutmak zor, ve 2) Twitter sizinle aynı soruna sahip birisinin önceki cevabı arayarak bulabileceği bir yer değil. - - -Unutmayın, özgür != ücretsiz; açık kaynak lisansı size özgürce kullanma ve değiştirme hakkı verir, başkalarının zamanını değil. Lütfen buna saygı duyun ve beklentilerinizi buna göre ayarlayın. +Eğer bu kaynaklarda sorularınıza cevap bulamazsanız, [hata bildirimi](https://github.com/wp-cli/wp-cli/issues/new) göndermekten çekinmeyiniz. +WordPress.org hesabınız varsa, [WordPress.org Slack organizasyonu](https://make.wordpress.org/chat/) üzerinden `#cli` kanalına katılabilirsiniz. ## Genişletmek -Bir **Komut** WP-CLI'nin atomik birimidir. `wp plugin install` ([belge](https://developer.wordpress.org/cli/commands/plugin/install/)) bir komuttur. `wp plugin activate` ([belge](https://developer.wordpress.org/cli/commands/plugin/activate/)) başka bir komuttur. - -WP-CLI çağrılabilen herhangi bir sınıfı, fonksiyonu ya da anonim fonksiyonu komut olarak kaydetmeyi destekler. Kullanım detaylarını callback'in PHP dökümanından (PHPdoc) okur. `WP_CLI::add_command()` ([belge](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) dahili ve üçüncü-parti komutların kaydedilmesi için kullanılmaktadır. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` - +**Komutlar** WP-CLI'nin atomik birimleridir. `wp plugin install` ([belge](https://wp-cli.org/commands/plugin/install/)) bir komuttur. `wp plugin activate` ([belge](https://wp-cli.org/commands/plugin/activate/)) başka bir komuttur. -WP-CLI onlarca komutla hazır olarak gelir. Özel bir WP-CLI komutu oluşturmak görünenden daha kolaydır. Detaylar için [komutlar tarif kitabına](https://make.wordpress.org/cli/handbook/commands-cookbook/) bakabilirsiniz. [Dahili API dökümantasyonunu](https://make.wordpress.org/cli/handbook/internal-api/) gözden geçirerek kendi WP-CLI komutunuzda kullanabileceğiniz faydalı fonksiyonları keşfedebilirsiniz. +WP-CLI onlarca komutla hazır olarak gelir. Özel bir WP-CLI komutu oluşturmak görünenden daha kolaydir. Detaylar için [komutlar belgesine](https://wp-cli.org/docs/commands-cookbook/) bakabilirsiniz. [Dahili API dökümantasyonunu](https://wp-cli.org/docs/internal-api/) gözden geçirerek kendi WP-CLI komutunuzda kullanabileceğiniz faydalı foksyionları keşfedebilirsiniz. ## Katkıda Bulunmak WP-CLI'e katkıda bulunmak istediğiniz için teşekkür ederiz. WP-CLI siz ve sizin gibi topluluk üyeleri sayesinde bu kadar büyük bir proje olmayı başarabildi. -**Katkıda bulunmak sadece kod yazmakla sınırlı değildir.** Kendi yeteneklerinize uygun olacak şekilde; tanıtım yazıları yazarak, yerel etkinliklerde demo göstererek, başkalarının sorunlarına yardımcı olarak veya dökümantasyonumuzu gözden geçirerek katkıda bulunabilirsiniz. +**Katkıda bulunmak sadece kod yazmakla sınırlı değildir.** kendinize yeteneklerinize uygun olacak şekilde; tanıtım yazıları yazarak, yerel etkinliklerde demo göstererek, başkalarının sorunlarına yardımcı olarak veya dökümantasyonumuzu gözden geçirerek katkıda bulunabilirsiniz. Lütfen bir dakikanızı ayırıp [dökümanı detaylıca okuyun](https://wp-cli.org/docs/contributing/). Bunları takip ederek, katkıda bulunan diğer katılımcıların ayırdığı zamana saygı gösteriniz. Buna karşılık, onlar da aynı saygıyı sizinle çalışırken göstereceklerdir (zaman farkı gözetmeksizin, dünya genelinde). -Nasıl katılacağınıza dair kapsamlı bir giriş için [el kitabındaki katkı kurallarını](https://make.wordpress.org/cli/handbook/contributing/) okuyun. Bu kurallara uymak, projeye katkıda bulunan diğer üyelerin zamanına saygı duyduğunuzu bildirmenize yardımcı olur. Buna karşılık, onlar da bu saygıya karşılık vermek için ellerinden geleni zaman farkı gözetmeksizin, dünya genelinde yapacaktır. ## Yönetim +WP-CLI bu kişiler tarafından yönetiliyor: -WP-CLI'nın bir proje sorumlusu vardır: [schlessera](https://github.com/schlessera). +* [Daniel Bachhuber](https://github.com/danielbachhuber/) - şimdiki bakımcı +* [Cristi Burcă](https://github.com/scribu) - eski bakımcı +* [Andreas Creten](https://github.com/andreascreten) - kurucu -Zaman zaman, belli bir süre için yetenekli olduklarını kanıtlamış ve projeyi ileriye taşıyabilecek katılımcılara [yazma izni veriyoruz](https://make.wordpress.org/cli/handbook/committers-credo/). -Proje hakkında daha operasyonel ayrıntılar için [el kitabındaki yönetim belgesini](https://make.wordpress.org/cli/handbook/governance/) okuyabilirsiniz. +Projenin [yönetimi](https://wp-cli.org/docs/governance/) hakkında bilgi edinebilir ve [katkıda bulunanların tam listesini](https://github.com/wp-cli/wp-cli/contributors) görüntüleyebilirsiniz. -## Jenerik +## Katkıda Bulunanlar [composer.json](composer.json) dosyasında tanımlanan kütüphanelerin yanında, aşağıdaki projeleri de kod veya fikir için kullandık: -* [Drush](https://github.com/drush-ops/drush) birçok şey içın -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) `wp shell` komutu için -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) `wp media regenerate` komutu için +* [Drush](http://drush.ws/) birçok şey içın +* [wpshell](http://code.trac.wordpress.org/browser/wpshell) `wp shell` komutu için +* [Regenerate Thumbnails](http://wordpress.org/plugins/regenerate-thumbnails/) `wp media regenerate` komutu için * [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) `wp search-replace` komutu içın * [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) `wp export` komutu içın * [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) `wp import` komutu içın diff --git a/zh-cn/index.md b/zh-cn/index.md deleted file mode 100644 index 6462a0d4..00000000 --- a/zh-cn/index.md +++ /dev/null @@ -1,235 +0,0 @@ ---- -layout: default -title: WP-CLI | WP-CLI -direction: ltr ---- - -[WP-CLI](https://wp-cli.org/) 是一款用于管理 [WordPress](https://wordpress.org/) 的命令行界面,无需浏览器即可完成插件更新、多站点设置等操作。 - -持续的维护是通过以下方式实现的: - - - -目前的稳定版本是 [2.5.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/)。如果您想获取最新信息,请在 Twitter 上关注 [@wpcli](https://twitter.com/wpcli) 或者 [订阅邮件通知](https://make.wordpress.org/cli/subscribe/)。参阅 [产品路线图](https://make.wordpress.org/cli/handbook/roadmap/) 了解未来版本的更新规划。 - -[![Testing](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/automated-tests/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") - -导航链接:[使用](#使用) | [安装](#安装) | [支持](#支持) | [扩展](#扩展) | [贡献](#贡献) | [参考](#参考) - -## 使用 - -WP-CLI 为您在 WordPress 后台管理中的许多操作提供了一个命令行接口。例如,使用 `wp plugin install --activate`([说明文档](https://developer.wordpress.org/cli/commands/plugin/install/)) 安装并激活一个 WordPress 插件: - -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... -Unpacking the package... -Installing the plugin... -Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. -``` - -WP-CLI 还包含许多您无法在 WordPress 后台管理中执行的操作命令。例如,`wp transient delete --all`([说明文档](https://developer.wordpress.org/cli/commands/transient/delete/))可以删除一个或所有的 Transients : - -```bash -$ wp transient delete --all -Success: 34 transients deleted from the database. -``` - -有关如何使用 WP-CLI 的更多内容请阅读《[Quick Start](https://make.wordpress.org/cli/handbook/quick-start/)》。您也可以在 [Shell Friends](https://make.wordpress.org/cli/handbook/shell-friends/) 了解实用的命令行工具。 - -如果已经熟悉基本命令,可以到 [WP-CLI Commands](https://developer.wordpress.org/cli/commands/) 了解更多有关主题及插件管理、数据导入与导出以及数据库操作的内容。 - -## 安装 - -我们推荐使用下载 Phar 文件的安装方法,如果需要使用[其他安装方法](https://make.wordpress.org/cli/handbook/installing/)([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)),请参阅相关文档。 - -在安装 WP-CLI 之前,请确保您的操作环境满足最低要求: - -- UNIX 环境(OS X,Linux,FreeBSD,Cygwin),某些功能在 Windows 中将受到限制。 -- PHP 5.6 或更高版本。 -- WordPress 3.7 或更高版本,较旧版本在功能上可能会有所减少。 - -检查好了操作环境,使用 `wget` 或 `curl` 下载 [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar): - -```bash -curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -``` - -然后,检查 Phar 文件确保其正常运行: - -```bash -php wp-cli.phar --info -``` - -要使用 `wp` 执行 WP-CLI 命令,必须有执行权限并且 `PATH` 已在环境变量中注册,例如: - -```bash -chmod +x wp-cli.phar -sudo mv wp-cli.phar /usr/local/bin/wp -``` - -如果 WP-CLI 安装成功,当您运行 `wp --info` 时,可以看到类似下面的回显: - -```bash -$ wp --info -OS: Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 -Shell: /usr/bin/zsh -PHP binary: /usr/bin/php -PHP version: 8.0.5 -php.ini used: /etc/php/8.0/cli/php.ini -MySQL binary: /usr/bin/mysql -MySQL version: mysql Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) -SQL modes: -WP-CLI root dir: /home/wp-cli/ -WP-CLI vendor dir: /home/wp-cli/vendor -WP_CLI phar path: -WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ -WP-CLI global config: -WP-CLI project config: /home/wp-cli/wp-cli.yml -WP-CLI version: 2.5.0 -``` - -### 更新 - -您可以用 `wp cli update`([说明文档](https://developer.wordpress.org/cli/commands/cli/update/))更新 WP-CLI,或者重复上述安装方法。 - -如果 WP-CLI 是由 root 或其他系统用户拥有,则需要执行 `sudo wp cli update` 操作。 - -如果您想体验最新版本,可以运行 `wp cli update --nightly` 来安装最新的 Nightly Builds 版本(每天更新的版本,不要用到生产环境) WP-CLI 工具。该版本在开发环境中有一定的稳定性,并且始终包含最新和最出色的 WP-CLI 功能。 - -### Tab 命令行补全 - -WP-CLI 带有用于 Bash 和 ZSH 的命令行补全脚本。下载 [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.12.0/utils/wp-completion.bash) 并在 `~/.bash_profile` 中加载即可,例如: - -```bash -source /FULL/PATH/TO/wp-completion.bash -``` - -然后运行 `source ~/.bash_profile` 使其生效. - -如果使用 zsh,需要在加载 `bashcompinit` 后载入 `wp-completion.bash`,将下面的内容放入 `.zshrc` 中即可: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - -## 支持 - -WP-CLI 的维护者和贡献者只有有限的时间回答常见问题,只有[最新版](https://make.wordpress.org/cli/handbook/roadmap/)的 WP-CLI 受到官方支持。 - -在寻求帮助时,请首先在下面资源中搜索您的问题: - -* [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/) -* [WP-CLI handbook](https://make.wordpress.org/cli/handbook/) -* [Open or closed issues in the WP-CLI GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) -* [Threads tagged 'WP-CLI' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/wp-cli/) -* [Questions tagged 'WP-CLI' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) - -如果上面任何一种方式都找不到答案: - -* 加入 [WordPress.org 的 Slack](https://make.wordpress.org/chat/) 中的 `#cli` 频道,与当时可能有空的人聊天(这是最快的方法)。 -* 在 [WordPress 支持论坛](https://wordpress.org/support/forum/wp-advanced/#new-post) 上发布新帖子,并用 「wp-cli」标记它(以便被找到)。 - -GitHub Issues 用于跟踪现有命令的改进和 BUG,而不是常规支持。在提交 BUG 报告之前,请务必阅读手册中的 [Bug Reports](https://make.wordpress.org/cli/handbook/bug-reports/),以确保您的问题得到及时解决。 - -请不要在 Twitter 上提出问题,因为: - -1)一般很难用 280 个字符的对话解决问题; - -2)如果其他人与您拥有相同的问题,他们不能通过搜索其他人的历史聊天记录来获取答案。 - -开源许可证授予您使用和修改的权利,但不授予您浪费他人时间的权利。请您保持尊重! - -## 扩展 - -每个**命令**都被定义为一个 WP-CLI 功能,`wp plugin install`([说明文档](https://developer.wordpress.org/cli/commands/plugin/install/))是一个,而 `wp plugin activate`([说明文档](https://developer.wordpress.org/cli/commands/plugin/activate/))是另一个。 - -WP-CLI 支持各种可执行类、函数和闭包作为命令被执行。其在 PHPdoc 中读取详细的使用信息。使用 `WP_CLI::add_command()`([说明文档](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/))来注册内部命令和第三方命令。 - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); - } else { - WP_CLI::success( "Deleted '$key' option." ); - } -}; -WP_CLI::add_command( 'option delete', $delete_option_cmd ); -``` - -WP-CLI 包含丰富的命令。创建自定义的 WP-CLI 命令比看起来的要更加容易。阅读 [Commands Cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) 了解更多内容,浏览 [Internal API](https://make.wordpress.org/cli/handbook/internal-api/) 发现更多创建自定义命令的实用功能。 - -## 贡献 - -感谢您主动为 WP-CLI 做出贡献!正因为您和社区的支持,才能使 WP-CLI 更加出色! - -**贡献不仅限于代码**,我们鼓励您在能力范围内作出贡献。比如编写教程、在会议上进行演示、帮助其他用户解决他们的问题,或者协助我们修改文档。 - -如果要参与该项目,请仔细阅读手册中的 [Contributing](https://make.wordpress.org/cli/handbook/contributing/) 。遵循这些准则有助于与该项目的其他贡献者进行交流,他们将竭尽全力与您合作。 - -## 管理者 - -WP-CLI 项目维护者: [schlessera](https://github.com/schlessera)。 - -我们将写权限授予[受信任的贡献者](https://make.wordpress.org/cli/handbook/committers-credo/),这些贡献者已经证明他们有能力并有时间开发该项目。 - -阅读手册中的 [Governance](https://make.wordpress.org/cli/handbook/governance/),获取有关该项目的更多操作详细信息。 - -## 参考 - -除了 [composer.json](https://wp-cli.org/composer.json) 中定义的库之外,我们还使用了以下项目的代码或想法: - -* [Drush](https://github.com/drush-ops/drush) 用于很多事情 -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) 用于 `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) 用于 `wp media regenerate` -* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) 用于 `wp search-replace` -* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) 用于 `wp export` -* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) 用于 `wp import` -* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) 用于 `wp scaffold plugin-tests`