Change Events Calendar Admin Form Strings using a function

Home Forums Calendar Products Events Calendar PRO Change Events Calendar Admin Form Strings using a function

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24279
    Brian
    Member

    Based on the post from Jonah West, “Change Events Calendar Strings Without Editing Language Files”

    URL: https://theeventscalendar.com/change-events-calendar-strings-without-editing-language-files/

    Add reading up on ‘gettext’, I created a function to modify fields single event admin page for “The Events Calendar” since Jonah’s code only modifies the public page. I’ve run into an issue with the text modification for “Phone:” under “Event Location Details” to display “Venue Phone;”. This works correctly but the function also updates “Phone:” under the Event Organizer Details to also display “Venue Phone:”.

    I have been searching for an solution to refine my Switch/Case statement to either “EventPhone” or “venue[Phone]”. So far I haven’t found any options.

    Can someone from Modern Tribe help? I am developing this on a local site before I upload the code to the Events Pro site. So, I don’t have a URL to show at the moment.

    Here is the code for my function, “theme_change_admin_field_name”.

    add_filter( ‘gettext’, ‘theme_change_admin_field_names’, 20, 3 );
    /**
    * Change comment form default field names.
    *
    * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
    */
    function theme_change_admin_field_names( $translated_text, $text, $domain ) {

    if ( is_admin() ) {

    switch ( $translated_text ) {

    case ‘Organizer Name:’ :

    $translated_text = __( ‘Contact:’, ‘theme_text_domain’ );
    break;

    case ‘Phone:’ :

    $translated_text = __( ‘Venue Phone:’, ‘theme_text_domain’ );
    break;

    }

    }

    return $translated_text;
    }

    #24298
    Jonah
    Participant

    Hi Brian,

    What I would suggest is to modify the language files for the changes you need to make. Instructions are provided here: https://theeventscalendar.com/faq/can-i-change-the-language-that-the-content-of-my-calendar-appears-in-on-the-site/

    I hope that helps but let me know if you need anything else.

    – Jonah

    #977640
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Change Events Calendar Admin Form Strings using a function’ is closed to new replies.