Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Forked from joshfeck/ticket_headings.php
Created October 11, 2021 15:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/6cc3d498da3cf61d60e2c295e15325ab to your computer and use it in GitHub Desktop.
Save Pebblo/6cc3d498da3cf61d60e2c295e15325ab to your computer and use it in GitHub Desktop.
Example that shows how to add some headings between ticket selector rows. Requires WordPress + Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'wp_enqueue_scripts', 'my_ee_add_ticket_row_headings', 11 );
function my_ee_add_ticket_row_headings() {
wp_add_inline_script(
'ticket_selector',
'jQuery( document ).ready(function($) {
$(".ee-ticket-tees-for-keys-golf-tournament-executive-sponsor")
.before( "<tr><td colspan=\'3\'><h3>Tees For Keys</h3></td></tr>" );
$(".ee-ticket-home-build-sponsorship-home-partner")
.before( "<tr><td colspan=\'3\'><h3>Home Build Sponsorships</h3></td></tr>" );
} );'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment