Home › Forums › Calendar Products › Events Calendar PRO › Change Events Calendar Admin Form Strings using a function
- This topic has 2 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
August 29, 2012 at 7:58 am #24279
Brian
MemberBased 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;
}August 29, 2012 at 11:14 am #24298Jonah
ParticipantHi 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
July 7, 2015 at 6:25 am #977640Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Change Events Calendar Admin Form Strings using a function’ is closed to new replies.
