Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Created March 3, 2017 15:58
Show Gist options
  • Save lorenzocaum/28a23cc7fa2c8c5013967350620d8a2e to your computer and use it in GitHub Desktop.
Save lorenzocaum/28a23cc7fa2c8c5013967350620d8a2e to your computer and use it in GitHub Desktop.
How to change the sold out messaging in the Events Table View Template

Add the sample code below to your child theme's functions.php file or in a site specific plugin. Then change REPLACE ME to the new messaging that you would like to display.

<?php
//* Do NOT include the opening php tag

//* Change the sold out messaging in the events table view template to something else
function ee_custom_messaging_sold_out( $translated, $original, $domain ) {
    $strings = array(
        'Sold Out' => 'REPLACE ME',
    );
    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
}
add_filter( 'gettext', 'ee_custom_messaging_sold_out', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment