[HPOS] Add action for order_edit_form_top as a replacement to edit_form_top (#39165)

Add action for order_edit_form_top as a replacement to edit_form_top for HPOS.
This commit is contained in:
Vedanshu Jain 2023-07-11 05:07:26 +05:30 committed by GitHub
parent 1096ddb0d3
commit 04e3ba26a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: enhancement
Add action for 'order_edit_form_top' as a replacement to edit_form_top for HPOS.

View File

@ -324,6 +324,16 @@ class Edit {
?>
>
<?php wp_nonce_field( $this->get_order_edit_nonce_action() ); ?>
<?php
/**
* Fires at the top of the order edit form. Can be used as a replacement for edit_form_top hook for HPOS.
*
* @param \WC_Order $order Order object.
*
* @since 8.0.0
*/
do_action( 'order_edit_form_top', $this->order );
?>
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>"/>
<input type="hidden" id="original_order_status" name="original_order_status" value="<?php echo esc_attr( $this->order->get_status() ); ?>"/>
<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>"/>