WC_Admin_Webhooks::get_topic_data()
Get the webhook topic data.
Метод класса: WC_Admin_Webhooks{}
Хуков нет.
Возвращает
Массив
.
Использование
$result = WC_Admin_Webhooks::get_topic_data( $webhook );
- $webhook(WC_Webhook) (обязательный)
- Webhook instance.
Код WC_Admin_Webhooks::get_topic_data() WC Admin Webhooks::get topic data WC 8.7.0
public static function get_topic_data( $webhook ) { $topic = $webhook->get_topic(); $event = ''; $resource = ''; if ( $topic ) { list( $resource, $event ) = explode( '.', $topic ); if ( 'action' === $resource ) { $topic = 'action'; } elseif ( ! in_array( $resource, array( 'coupon', 'customer', 'order', 'product' ), true ) ) { $topic = 'custom'; } } return array( 'topic' => $topic, 'event' => $event, 'resource' => $resource, ); }