parent
a7538da23b
commit
51f71cfade
|
@ -402,6 +402,9 @@ final class WooCommerce {
|
||||||
add_action( $action, array( $this, 'send_transactional_email' ), 10, 10 );
|
add_action( $action, array( $this, 'send_transactional_email' ), 10, 10 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// webhooks
|
||||||
|
$this->load_webhooks();
|
||||||
|
|
||||||
// Init action
|
// Init action
|
||||||
do_action( 'woocommerce_init' );
|
do_action( 'woocommerce_init' );
|
||||||
}
|
}
|
||||||
|
@ -547,6 +550,30 @@ final class WooCommerce {
|
||||||
do_action_ref_array( current_filter() . '_notification', $args );
|
do_action_ref_array( current_filter() . '_notification', $args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load & enqueue active webhooks
|
||||||
|
*
|
||||||
|
* @since 2.2
|
||||||
|
*/
|
||||||
|
public function load_webhooks() {
|
||||||
|
|
||||||
|
$args = array(
|
||||||
|
'fields' => 'ids',
|
||||||
|
'post_type' => 'shop_webhook',
|
||||||
|
'post_status' => 'publish',
|
||||||
|
);
|
||||||
|
|
||||||
|
$query = new WP_Query( $args );
|
||||||
|
|
||||||
|
if ( ! empty( $query->posts ) ) {
|
||||||
|
|
||||||
|
foreach ( $query->posts as $id ) {
|
||||||
|
$webhook = new WC_Webhook( $id );
|
||||||
|
$webhook->enqueue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Load Instances on demand **********************************************/
|
/** Load Instances on demand **********************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue