Skip to content

Commit aafa113

Browse files
Remove api-dump from the list of commands on the website
1 parent 275c57a commit aafa113

7 files changed

Lines changed: 18 additions & 34 deletions

File tree

Phakefile.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function generate_synopsis( $command, $path = '' ) {
2929
echo $full_path . ' ' . $command['synopsis'] . "\n";
3030
} else {
3131
foreach ( $command['subcommands'] as $subcommand ) {
32-
if ( 'website' === $subcommand['name'] ) {
32+
if ( in_array( $subcommand['name'], array( 'website', 'api-dump' ) ) ) {
3333
continue;
3434
}
3535
generate_synopsis( $subcommand, $full_path );
@@ -91,11 +91,11 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
9191
$wp = invoke_wp_cli( 'wp --skip-packages cli cmd-dump', $app );
9292

9393
foreach( $wp['subcommands'] as $k => $cmd ) {
94-
if ( 'website' === $cmd['name'] ) {
94+
if ( in_array( $cmd['name'], array( 'website', 'api-dump' ) ) ) {
9595
unset( $wp['subcommands'][ $k ] );
96-
$wp['subcommands'] = array_values( $wp['subcommands'] );
9796
}
9897
}
98+
$wp['subcommands'] = array_values( $wp['subcommands'] );
9999

100100
// generate main page
101101
file_put_contents( '_includes/cmd-list.html', render( 'cmd-list.mustache', $wp ) );
@@ -149,7 +149,7 @@ function gen_cmd_pages( $cmd, $parent = array() ) {
149149

150150
desc( 'Update the /docs/internal-api/ page.' );
151151
task( 'internal-api-list', function( $app ) {
152-
$apis = invoke_wp_cli( 'wp cli api-dump', $app );
152+
$apis = invoke_wp_cli( 'wp api-dump', $app );
153153
$categories = array(
154154
'Registration' => array(),
155155
'Output' => array(),

command.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ function generate_contributing() {
9191
*
9292
* Used to build user-facing docs of public APIs.
9393
*
94+
* @when before_wp_load
95+
*
9496
* @subcommand api-dump
9597
*/
9698
function api_dump() {
@@ -121,7 +123,7 @@ function api_dump() {
121123
}
122124
echo json_encode( $apis );
123125
}
124-
\WP_CLI::add_command( 'cli api-dump', '\WP_CLI_Org\api_dump' );
126+
\WP_CLI::add_command( 'api-dump', '\WP_CLI_Org\api_dump' );
125127

126128
/**
127129
* Get a simple representation of a function or method

commands/cli/api-dump/index.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

commands/cli/cmd-dump/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ display_global_parameters: true
1010

1111
<hr />
1212

13-
# Dump the list of installed commands
13+
### EXAMPLES
14+
15+
# Dump the list of installed commands
1416
$ wp cli cmd-dump
1517
{"name":"wp","description":"Manage WordPress through the command-line.","longdesc":"\n\n
1618

commands/cli/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ display_global_parameters: true
4343
<td><a href="/commands/cli/alias/">alias</a></td>
4444
<td>List available aliases.</td>
4545
</tr>
46-
<tr>
47-
<td><a href="/commands/cli/api-dump/">api-dump</a></td>
48-
<td>Dump the list of internal APIs, as JSON.</td>
49-
</tr>
5046
<tr>
5147
<td><a href="/commands/cli/check-update/">check-update</a></td>
5248
<td>Check for update via Github API. Returns the available versions if there are updates, or empty if no update available.</td>

commands/theme/mod/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ display_global_parameters: true
1212

1313
### EXAMPLES
1414

15-
# Set theme mod
15+
# Set theme mod.
1616
$ wp theme mod set background_color 000000
1717
Success: Theme mod background_color set to 000000
1818

19-
# Get single theme mod in JSON format
19+
# Get single theme mod in JSON format.
2020
$ wp theme mod get background_color --format=json
2121
[{"key":"background_color","value":"dd3333"}]
2222

23-
# Remove all theme mods
23+
# Remove all theme mods.
2424
$ wp theme mod remove --all
2525
Success: Theme mods removed.
2626

commands/theme/mod/remove/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ display_global_parameters: true
1616
: One or more mods to remove.
1717

1818
[\--all]
19-
: Remove all theme mods
19+
: Remove all theme mods.
2020

2121
### EXAMPLES
2222

23-
# Remove all theme mods
23+
# Remove all theme mods.
2424
$ wp theme mod remove --all
2525
Success: Theme mods removed.
2626

27-
# Remove single theme mods
27+
# Remove single theme mod.
2828
$ wp theme mod remove background_color
29-
Success: 1 mods removed.
29+
Success: 1 mod removed.
3030

31-
# Remove multiple theme mods
31+
# Remove multiple theme mods.
3232
$ wp theme mod remove background_color header_textcolor
3333
Success: 2 mods removed.
3434

0 commit comments

Comments
 (0)