kaleido

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Rewording "tickets left" to "places left" #1544756
    kaleido
    Participant

    Hey thereelscene,
    I found a post that really helped out a lot and I was about to get this working for the site I’m working on. Here’s a link to the page: https://webandprosper.co.uk/events-calendar-pro-custom-photo-view/

    Below is the code I used. I haven’t had any issues with it so far.
    I hope you find this helpful.

    //TARGETS NUMBER OF TICKETS AND REPLACES WITH PLACES
    add_filter( 'tribe_tickets_buy_button', 'changes_button_text', 11, 2 );
    
    function changes_button_text( $html ) {
    
    		$html = str_replace("tickets left", "seats left", $html);
    		$html = str_replace("ticket left", "seat left", $html);                                                                                                                                                       
        return $html;
    }
    
    /*
     * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
     * See the codex to learn more about WP text domains:
     * http://codex.wordpress.org/Translating_WordPress#Localization_Technology
     * Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
     */
    function tribe_custom_theme_text ( $translations, $text, $domain ) {
     
    // Put your custom text here in a key => value pair
    // Example: 'Text you want to change' => 'This is what it will be changed to'
    // The text you want to change is the key, and it is case-sensitive
    // The text you want to change it to is the value
    // You can freely add or remove key => values, but make sure to separate them with a comma
    // This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
    $custom_text = array(
    		//'Photo' => 'Grid',
    		//'Month' => 'Calendar',
    		'Buy Now!' => 'Book Now!',
    		'Buy Now' => 'Book Now',
    );
     
    // If this text domain starts with "tribe-" or "the-events-", and we have replacement text
    if((strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($text, $custom_text) ) {
    	$text = $custom_text[$text];
    }
    
    return $text;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
    in reply to: Rewording "tickets left" to "places left" #1543607
    kaleido
    Participant

    thereelscene,

    did you ever get your code worked out for rewording “tickets left” to “places left”? I’ve been trying to figure this out as well. I tried all the suggestions on the same threads you mentioned, but nothing works.

    Any insight on this would be much appreciated.

    in reply to: Which product is best for my need? #1505204
    kaleido
    Participant

    Never mind – got it figured out.

Viewing 3 posts - 1 through 3 (of 3 total)