Allow parent:0 param passing when updating a term via the API
This commit is contained in:
parent
2124972232
commit
61e624b937
|
@ -491,6 +491,10 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
$prepared_args['slug'] = $request['slug'];
|
||||
}
|
||||
|
||||
if ( isset( $request['parent'] ) && 0 === $request['parent'] ) {
|
||||
unset( $request['parent'] );
|
||||
}
|
||||
|
||||
if ( isset( $request['parent'] ) ) {
|
||||
if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
|
||||
return new WP_Error( 'woocommerce_rest_taxonomy_not_hierarchical', __( 'Can not set resource parent, taxonomy is not hierarchical.', 'woocommerce' ), array( 'status' => 400 ) );
|
||||
|
|
Loading…
Reference in New Issue