WordPress at Your Fingertips
function is not described

WC_Abstract_Order::set_parent_id() public WC 3.0.0

Set parent order ID.

{} It's a method of the class: WC_Abstract_Order{}

No Hooks.

Return

null. Nothing.

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.

Code of WC_Abstract_Order::set_parent_id() WC 5.8.0

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 ) );
}