WordPress at Your Fingertips
function is not described

WC_Coupons_Tracking::tracks_coupons_bulk_actions() public WC 1.0

Add a listener on the "Apply" button to track bulk actions.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Coupons_Tracking = new WC_Coupons_Tracking();
$WC_Coupons_Tracking->tracks_coupons_bulk_actions();

Code of WC_Coupons_Tracking::tracks_coupons_bulk_actions() WC 5.8.0

public function tracks_coupons_bulk_actions() {
	wc_enqueue_js(
		"
		function onApplyBulkActions( event ) {
			var id = event.data.id;
			var action = $( '#' + id ).val();
			
			if ( action && '-1' !== action ) {
				window.wcTracks.recordEvent( 'coupons_view_bulk_action', {
					action: action
				} );
			}
		}
		$( '#doaction' ).on( 'click', { id: 'bulk-action-selector-top' }, onApplyBulkActions );
		$( '#doaction2' ).on( 'click', { id: 'bulk-action-selector-bottom' }, onApplyBulkActions );
	"
	);
}