Merge pull request #19128 from woocommerce/fix/19123-cli-term-ids
Use correct arg when making rest request in cli
This commit is contained in:
commit
66ad22e3fa
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue