From 63535973cebfa8e3df6fa4a81a73c9933a14c05e Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Tue, 13 Oct 2026 10:41:33 +0200 Subject: [PATCH] docs: WP-CLI subcommand names and dependency injection --- wp-cli-commands.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-cli-commands.md b/wp-cli-commands.md index bba6633..ef5daaa 100644 --- a/wp-cli-commands.md +++ b/wp-cli-commands.md @@ -92,7 +92,7 @@ class UserCreateCommand ## Command Suites (Subcommands) -WP-CLI automatically registers all **public methods** as subcommands. Method names are converted to kebab-case. +WP-CLI automatically registers all **public methods** as subcommands, under the method name as written: `listUsers()` answers to `listUsers`. For a kebab-case name, put `#[Command]` on the method: with no argument it derives `list-users` from the method name (see [Custom Subcommand Names](#custom-subcommand-names-with-command)). ```php