Skip to content

Instantly share code, notes, and snippets.

@rafsuntaskin
Created April 27, 2021 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafsuntaskin/9c8d3267f0a3b78fc4c6050b1da25000 to your computer and use it in GitHub Desktop.
Save rafsuntaskin/9c8d3267f0a3b78fc4c6050b1da25000 to your computer and use it in GitHub Desktop.
MA patch for ET+
<?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