Skip to content

Instantly share code, notes, and snippets.

@slimndap
Created March 4, 2017 21:31
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 slimndap/22aa5b8747c02080764c4b07eba82177 to your computer and use it in GitHub Desktop.
Save slimndap/22aa5b8747c02080764c4b07eba82177 to your computer and use it in GitHub Desktop.
How to add an extra CSS class to tickets buttons, using the Theater for WordPress plugin.
<?php
/**
* Adds an 'art-button' CSS class to the tickets buttons of events.
*
* @param array $classes The current CSS classes of tickets buttons.
* @param WPT_Event $event The event that the button belongs to.
* @return array The new CSS classes.
*/
function add_class_to_tickets_buttons( $classes, $event ) {
// Don't add anything when inside the WordPress admin.
if ( is_admin() ) {
return $classes;
}
$classes[] = 'art-button';
return $classes;
}
add_filter( 'wpt/event/tickets/url/classes', 'add_class_to_tickets_buttons', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment