WC_Abstract_Order::set_parent_id
Set parent order ID.
Method of the class: WC_Abstract_Order{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Abstract_Order = new WC_Abstract_Order(); $WC_Abstract_Order->set_parent_id( $value );
- $value(int) (required)
- Value to set.
Changelog
| Since 3.0.0 | Introduced. |
WC_Abstract_Order::set_parent_id() WC Abstract Order::set parent id code WC 10.3.6
public function set_parent_id( $value ) {
if ( $value && ( $value === $this->get_id() || ! wc_get_order( $value ) ) ) {
$this->error( 'order_invalid_parent_id', __( 'Invalid parent ID', 'woocommerce' ) );
}
$this->set_prop( 'parent_id', absint( $value ) );
}