Created
April 27, 2021 18:07
-
-
Save rafsuntaskin/9c8d3267f0a3b78fc4c6050b1da25000 to your computer and use it in GitHub Desktop.
MA patch for ET+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tribe_asset_pre_register', 'rt_et_patch_ma_nonce', 99 ); | |
function rt_et_patch_ma_nonce( $assets ) { | |
if ( ! in_array( 'event-tickets-admin', $assets->groups ) ) { | |
return $assets; | |
} | |
foreach ( $assets->localize as $item ) { | |
if ( $item->name != 'TribeTickets' ) { | |
continue; | |
} | |
if ( ! isset( $item->data['tribeTicketsAdminManagerNonce'] ) ) { | |
$item->data['tribeTicketsAdminManagerNonce'] = wp_create_nonce( 'tribe_tickets_admin_manager_nonce' ); | |
} | |
} | |
return $assets; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment