Created
July 7, 2016 15:38
-
-
Save joshfeck/e2936c102f579e1f588299e29a9e2dc9 to your computer and use it in GitHub Desktop.
Sets the Event Espresso 4 ticket selector to display only one time if it's a single post. This is useful for custom placement of the ticket selector with a short code.
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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( 'FHEE_disable_espresso_ticket_selector', 'ee_display_ticket_selector_once' ); | |
function ee_display_ticket_selector_once() { | |
if( ! defined( 'TS_EXECUTED' ) ){ | |
add_filter( 'FHEE_disable_espresso_ticket_selector', '__return_false' ); | |
if ( is_single() ){ | |
define( 'TS_EXECUTED', TRUE ); | |
} | |
} else { | |
add_filter( 'FHEE_disable_espresso_ticket_selector', '__return_true' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment