Merge pull request #13507 from woocommerce/fix-13506
Validate the parent order ID by calling wc_get_order()
This commit is contained in:
commit
62240c6bbd
|
@ -452,7 +452,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
* @throws WC_Data_Exception
|
||||
*/
|
||||
public function set_parent_id( $value ) {
|
||||
if ( $value && ! get_post( $value ) ) {
|
||||
if ( $value && ! wc_get_order( $value ) ) {
|
||||
$this->error( 'order_invalid_parent_id', __( 'Invalid parent ID', 'woocommerce' ) );
|
||||
}
|
||||
$this->set_prop( 'parent_id', absint( $value ) );
|
||||
|
|
Loading…
Reference in New Issue