WordPress at Your Fingertips
function is not described

WC_Webhook::get_topic_hooks() private WC 2.2.0

Get the associated hook names for a topic.

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

Hooks from the method

Return

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_topic_hooks( $topic );
$topic(string) (required)
Topic name.

Changelog

Since 2.2.0 Introduced.

Code of WC_Webhook::get_topic_hooks() WC 5.9.0

private function get_topic_hooks( $topic ) {
	$topic_hooks = array(
		'coupon.created'   => array(
			'woocommerce_process_shop_coupon_meta',
			'woocommerce_new_coupon',
		),
		'coupon.updated'   => array(
			'woocommerce_process_shop_coupon_meta',
			'woocommerce_update_coupon',
		),
		'coupon.deleted'   => array(
			'wp_trash_post',
		),
		'coupon.restored'  => array(
			'untrashed_post',
		),
		'customer.created' => array(
			'user_register',
			'woocommerce_created_customer',
			'woocommerce_new_customer',
		),
		'customer.updated' => array(
			'profile_update',
			'woocommerce_update_customer',
		),
		'customer.deleted' => array(
			'delete_user',
		),
		'order.created'    => array(
			'woocommerce_new_order',
		),
		'order.updated'    => array(
			'woocommerce_update_order',
			'woocommerce_order_refunded',
		),
		'order.deleted'    => array(
			'wp_trash_post',
		),
		'order.restored'   => array(
			'untrashed_post',
		),
		'product.created'  => array(
			'woocommerce_process_product_meta',
			'woocommerce_new_product',
			'woocommerce_new_product_variation',
		),
		'product.updated'  => array(
			'woocommerce_process_product_meta',
			'woocommerce_update_product',
			'woocommerce_update_product_variation',
		),
		'product.deleted'  => array(
			'wp_trash_post',
		),
		'product.restored' => array(
			'untrashed_post',
		),
	);

	$topic_hooks = apply_filters( 'woocommerce_webhook_topic_hooks', $topic_hooks, $this );

	return isset( $topic_hooks[ $topic ] ) ? $topic_hooks[ $topic ] : array();
}