diff --git a/includes/cli/class-wc-cli-rest-command.php b/includes/cli/class-wc-cli-rest-command.php index 4d217485434..1d1b9e1bd70 100644 --- a/includes/cli/class-wc-cli-rest-command.php +++ b/includes/cli/class-wc-cli-rest-command.php @@ -376,7 +376,7 @@ EOT; $route = $this->route; foreach ( $this->get_supported_ids() as $id_name => $id_desc ) { - if ( strpos( $route, '<' . $id_name . '>' ) !== false && ! empty( $args ) ) { + if ( 'id' !== $id_name && strpos( $route, '<' . $id_name . '>' ) !== false && ! empty( $args ) ) { $route = str_replace( '(?P<' . $id_name . '>[\d]+)', $args[0], $route ); $supported_id_matched = true; } diff --git a/includes/cli/class-wc-cli-runner.php b/includes/cli/class-wc-cli-runner.php index 4b058002e3e..7dc975cd65f 100644 --- a/includes/cli/class-wc-cli-runner.php +++ b/includes/cli/class-wc-cli-runner.php @@ -97,13 +97,13 @@ class WC_CLI_Runner { // Define IDs that we are looking for in the routes (in addition to id) // so that we can pass it to the rest command, and use it here to generate documentation. $supported_ids = array( - 'id' => __( 'ID.', 'woocommerce' ), 'product_id' => __( 'Product ID.', 'woocommerce' ), 'customer_id' => __( 'Customer ID.', 'woocommerce' ), 'order_id' => __( 'Order ID.', 'woocommerce' ), 'refund_id' => __( 'Refund ID.', 'woocommerce' ), 'attribute_id' => __( 'Attribute ID.', 'woocommerce' ), 'zone_id' => __( 'Zone ID.', 'woocommerce' ), + 'id' => __( 'ID.', 'woocommerce' ), ); $rest_command->set_supported_ids( $supported_ids ); $positional_args = array_keys( $supported_ids );