WC_CLI_REST_Command::update_item()
Update an existing item.
Method of the class: WC_CLI_REST_Command{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_CLI_REST_Command = new WC_CLI_REST_Command(); $WC_CLI_REST_Command->update_item( $args, $assoc_args );
- $args(array) (required)
- WP-CLI positional arguments.
- $assoc_args(array) (required)
- WP-CLI associative arguments.
WC_CLI_REST_Command::update_item() WC CLI REST Command::update item code WC 9.3.1
public function update_item( $args, $assoc_args ) { $assoc_args = self::decode_json( $assoc_args ); list( $status, $body ) = $this->do_request( 'POST', $this->get_filled_route( $args ), $assoc_args ); if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'porcelain' ) ) { WP_CLI::line( $body['id'] ); } else { WP_CLI::success( __( 'Updated', 'woocommerce' ) . " {$this->name} {$body['id']}." ); } }