Support

Home Forums Event Espresso Premium How to change the term "attendee" to "guest".

How to change the term "attendee" to "guest".

Posted: October 18, 2013 at 8:35 am

Viewing 18 reply threads


Joy

October 18, 2013 at 8:35 am

WP – 3.6.1 – EventPlugin – 3.1.35.1.P

What is the best way to change the term “attendee” to “guest” when adding multiple users. Thanks.


Dean

October 20, 2013 at 11:42 pm

Hi,

The best way is via translation, here is a useful guide – https://eventespresso.com/wiki/how-to-change-wording-with-poedit/


Joy

October 21, 2013 at 1:18 pm

Hi Dean,

Thanks for the response. I did see that link before I posted and then decided to give it a try this morning since that was your response. Well here it 3:15 in the afternoon and still no solution. A better link to download this new software I am supposed to learn is here: http://sourceforge.net/projects/poedit/files/latest/download

As for the plugin – it didn’t work for me either. What would be really helpful is if you could just tell me where the term is located so I don’t have to go searching through all the files. Thank you so much!


Josh

  • Support Staff

October 21, 2013 at 2:16 pm

Hi Joy,

If you change the actual term in the files you’ll lose your changes when you update (or avoid updating all together and make it difficult to keep your site functioning properly down the road).

I can’t say for sure, but I think this is the text string you’re looking to change:

__('Add Additional Attendee', 'event_espresso')

The documentation that linked to outlines an option that lets you change text strings on the fly (no software or plugins needed)

Here’s the code example from the documentation:

Lines 6 and 7 have example strings that can be replaced with your custom strings. So for changing attendee to guest line 6 can be changed to:

'Add Additional Attendee' => 'Add Additional Guest',


Joy

October 21, 2013 at 2:52 pm

Thanks. I am aware of the update issue. I’m new to Events, but I have just installed on two sites so I am sure I will become very familiar with your plugin. I thought I saw the option of Customization and am surprised you aren’t leading me that direction versus guessing. I guess I will have to work this out myself.


Josh

  • Support Staff

October 21, 2013 at 3:27 pm

Hi Joy,

I’m sorry, is there something in the above instructions that are not quite making sense? The codesnippet shows you how to make this customization with no guess work required. You can copy and paste the code that I gave you in the above reply, edit line 6 as I wrote above and it will make the change happen.

If there’s a part of the customization that you need help with or you need help with how to implement it please let us know. We’re here to help.


Joy

October 21, 2013 at 3:51 pm

Hi Josh:

Yes, I guess it is a bit confusing. Copy and paste where? Plus line 6 ($strings = array()) doesn’t look like it is replaceable with this ‘Add Additional Attendee’ => ‘Add Additional Guest’, and then there is this statement: “I can’t say for sure, but I think this is the text string you’re looking to change:”

Remember I just spent all morning and part of this afternoon on installing software etc. and installing a plugin from the first response. So, no not really interested in playing more if this is a guess.


Josh

  • Support Staff

October 21, 2013 at 4:09 pm

You didn’t say which string you wanted to change but I figured I’d still try to help!

For now, I’ll go with this one as it’s something that’s found on the registration page:

__('Add Additional Attendee', 'event_espresso')

That’s the string we’ll change in this example, but you can change any strings you’d like.

If you go here you’ll see a paragraph that answers your question about where to copy the function:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#plugins

Or you can add a custom function to your theme’s functions.php file or the custom_functions.php file that is included with Event Espresso’s Custom Files add-on.

Your theme’s functions.php file is already in place. If you prefer to copy the function to custom_functions.php you can install the custom files add-on.

Just below line where it says $strings = array( you’ll see this line:

‘Register’ => ‘Sign up’,

that will replace every instance of Register with Sign Up. You can swap that out with:

‘Add Additional Attendee’ => ‘Add Additional Guest’,

If that’s not the string you’d like change please let us know the exact term where you would like to change “attendee” to “guest” and we’ll be glad to help you with the one you want changed.


Joy

October 21, 2013 at 4:42 pm

I would really, really appreciated if you would tell me where in the files this is located, let me worry about the upgrades. I did find this file under templates to be promising: multi_registration_page_display.php

This is the test site page for term which is located toward the bottom: http://wcrbonita.awdtestsite.com/?page_id=3017&ee=1


Josh

  • Support Staff

October 21, 2013 at 5:10 pm

Hi Joy,

Please note that we do not support customizations made directly to core files because it ends up causing more support issues down the road. You asked for the best way to make this change. The best way to make the change is via a custom function. This not only prevents a lot of work from needing to be done after each update, but is a lot less initial work too.

So here are the strings I’m seeing on that page that appear to be what you’d like to be changed. Please let me know if I’m missing any and I’ll add more:

Remove Attendee Above
Add Additional Attendee
Attendee #
Add More Attendees? (click to toggle, limit 4)

These are located in the /includes/functions/main.php file in the function that starts on 116 and ends on 226, but please, pretty please do not change them there.

Please use this custom function instead:

function tatg_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Add More Attendees? (click to toggle, limit %s)' => 'Add More Guests? (click to toggle, limit %s)',
        'Remove Attendee Above' => 'Remove Guest Above',
        'Add Additional Attendee' => 'Add Additional Guest',
        'Attendee #' => 'Guest #'
        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace it's translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'tatg_filter_gettext', 10, 3 );


Joy

October 21, 2013 at 5:32 pm

Ok thanks!- I will give it a try in the morning. But, is there a reason you can’t just add the updated template page to the custom files?


Joy

October 22, 2013 at 6:11 am

Good Morning Josh,

I just tried adding it to the custom_function.php and it didn’t work. Did I do something wrong? I added the custom files to /wp-content/uploads/espresso/. At first I added all of the custom files and when it didn’t work I removed all but the custom_function.php and it still isn’t working.

I also tried the strings you gave me versus just the word “attendee” in the quick-localization plugin, which also didn’t work.


Josh

  • Support Staff

October 22, 2013 at 8:23 am

Hi there,

The name of the file needs to be custom_functions.php or Event Espresso will not read it. After verifying that the name of the file is custom_functions.php please be sure that the code follows right after the opening PHP tag. It will look like this screenshot.


Joy

October 22, 2013 at 8:43 am

The file name is correct. I just copied it over and missed the s when typing.

There is other code that was included in the file. Should I delete that and just have your code?


Joy

October 22, 2013 at 8:50 am

Just added to the top and it still isn’t changing the text. Here is what I have: `<?php

function tatg_filter_gettext( $translated, $original, $domain ) {

// This is an array of original strings
// and what they should be replaced with

$strings = array(
‘Add More Attendees? (click to toggle, limit %s)’ => ‘Add More Guests? (click to toggle, limit %s)’,
‘Remove Attendee Above’ => ‘Remove Guest Above’,
‘Add Additional Attendee’ => ‘Add Additional Guest’,
‘Attendee #’ => ‘Guest #’

// Add some more strings here
);

// See if the current string is in the $strings array
// If so, replace it’s translation

if ( isset( $strings[$original] ) ) {

// This accomplishes the same thing as __()
// but without running it through the filter again

$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}

return $translated;
}
add_filter( ‘gettext’, ‘tatg_filter_gettext’, 10, 3 );

/*
Function Name: Maximum Date Display
Author: Seth Shoultes
Contact: seth@smartwebutah.com
Website: http://shoultes.net
Description: This function is used in the Events Table Display template file to show events for a maximum number of days in the future
Usage Example:
Requirements: Events Table Display template file
Notes:
*/
function display_event_espresso_date_max($max_days=”null”){
global $wpdb;
//$org_options = get_option(‘events_organization_settings’);
//$event_page_id =$org_options[‘event_page_id’];
if ($max_days != “null”){
if ($_REQUEST[‘show_date_max’] == ‘1’){
foreach ($_REQUEST as $k=>$v) $$k=$v;
}
$max_days = $max_days;
$sql = “SELECT * FROM ” . EVENTS_DETAIL_TABLE . ” WHERE ADDDATE(‘”.date ( ‘Y-m-d’ ).”‘, INTERVAL “.$max_days.” DAY) >= start_date AND start_date >= ‘”.date ( ‘Y-m-d’ ).”‘ AND is_active = ‘Y’ ORDER BY date(start_date)”;
event_espresso_get_event_details($sql);//This function is called from the event_list.php file which should be located in your templates directory.

}
}

/*
Function Name: Event Status
Author: Seth Shoultes
Contact: seth@eventespresso.com
Website: https://eventespresso.com
Description: This function is used to display the status of an event.
Usage Example: Can be used to display custom status messages in your events.
Requirements:
Notes:
*/
if (!function_exists(‘espresso_event_status’)) {
function espresso_event_status($event_id){
$event_status = event_espresso_get_is_active($event_id);

//These messages can be uesd to display the status of the an event.
switch ($event_status[‘status’]){
case ‘EXPIRED’:
$event_status_text = __(‘This event is expired.’,’event_espresso’);
break;

case ‘ACTIVE’:
$event_status_text = __(‘This event is active.’,’event_espresso’);
break;

case ‘NOT_ACTIVE’:
$event_status_text = __(‘This event is not active.’,’event_espresso’);
break;

case ‘ONGOING’:
$event_status_text = __(‘This is an ongoing event.’,’event_espresso’);
break;

case ‘SECONDARY’:
$event_status_text = __(‘This is a secondary/waiting list event.’,’event_espresso’);
break;

}
return $event_status_text;
}
}

/*
Function Name: Custom Event List Builder
Author: Seth Shoultes
Contact: seth@eventespresso.com
Website: https://eventespresso.com
Description: This function creates lists of events using custom templates.
Usage Example: Create a page or widget template to show events.
Requirements: Template files must be stored in your wp-content/uploads/espresso/templates directory
Notes:
*/
if (!function_exists(‘espresso_list_builder’)) {
function espresso_list_builder($sql, $template_file, $before, $after){

global $wpdb, $org_options;
//echo ‘This page is located in ‘ . get_option( ‘upload_path’ );
$event_page_id = $org_options[‘event_page_id’];
$currency_symbol = $org_options[‘currency_symbol’];
$events = $wpdb->get_results($sql);
$category_id = $wpdb->last_result[0]->id;
$category_name = $wpdb->last_result[0]->category_name;
$category_desc = html_entity_decode( wpautop($wpdb->last_result[0]->category_desc) );
$display_desc = $wpdb->last_result[0]->display_desc;

if ($display_desc == ‘Y’){
echo ‘<p id=”events_category_name-‘. $category_id . ‘” class=”events_category_name”>’ . stripslashes_deep($category_name) . ‘</p>’;
echo wpautop($category_desc);
}

foreach ($events as $event){
$event_id = $event->id;
$event_name = $event->event_name;
$event_identifier = $event->event_identifier;
$active = $event->is_active;
$registration_start = $event->registration_start;
$registration_end = $event->registration_end;
$start_date = $event->start_date;
$end_date = $event->end_date;
$reg_limit = $event->reg_limit;
$event_address = $event->address;
$event_address2 = $event->address2;
$event_city = $event->city;
$event_state = $event->state;
$event_zip = $event->zip;
$event_country = $event->country;
$member_only = $event->member_only;
$externalURL = $event->externalURL;
$recurrence_id = $event->recurrence_id;

$allow_overflow = $event->allow_overflow;
$overflow_event_id = $event->overflow_event_id;

//Address formatting
$location = ($event_address != ” ? $event_address :”) . ($event_address2 != ” ? ‘<br />’ . $event_address2 :”) . ($event_city != ” ? ‘<br />’ . $event_city :”) . ($event_state != ” ? ‘, ‘ . $event_state :”) . ($event_zip != ” ? ‘<br />’ . $event_zip :”) . ($event_country != ” ? ‘<br />’ . $event_country :”);

//Google map link creation
$google_map_link = espresso_google_map_link(array( ‘address’=>$event_address, ‘city’=>$event_city, ‘state’=>$event_state, ‘zip’=>$event_zip, ‘country’=>$event_country, ‘text’=> ‘Map and Directions’, ‘type’=> ‘text’) );

//These variables can be used with other the espresso_countdown, espresso_countup, and espresso_duration functions and/or any javascript based functions.
$start_timestamp = espresso_event_time($event_id, ‘start_timestamp’, get_option(‘time_format’));
$end_timestamp = espresso_event_time($event_id, ‘end_timestamp’, get_option(‘time_format’));

//This can be used in place of the registration link if you are usign the external URL feature
$registration_url = $externalURL != ” ? $externalURL : get_option(‘siteurl’) . ‘/?page_id=’.$event_page_id.’&regevent_action=register&event_id=’. $event_id;

if (!is_user_logged_in() && get_option(‘events_members_active’) == ‘true’ && $member_only == ‘Y’) {
//Display a message if the user is not logged in.
//_e(‘Member Only Event. Please ‘,’event_espresso’) . event_espresso_user_login_link() . ‘.’;
}else{
//Serve up the event list
//As of version 3.0.17 the event lsit details have been moved to event_list_display.php
echo $before = $before == ”? ” : $before;
include(‘templates/’. $template_file);
echo $after = $after == ”? ” : $after;
}
}
//Check to see how many database queries were performed
//echo ‘<p>Database Queries: ‘ . get_num_queries() .'</p>’;
}
}


Josh

  • Support Staff

October 22, 2013 at 9:25 am

I found the reason why it’s not working for you. The custom_functions.php file is in the wrong location. It should be in the /wp-content/uploads/espresso/ directory (one level up from where it is now).

As an aside, it would be a good idea to make sure the contents of /wp-content/uploads is not browsable for the sake of security. While it’s neat that I could browse to it for support reasons, there are folks out there who can use this for nefarious purposes. Here’s a thread at wordpress.org that outlines a few options on how to disable browsing of the wp-content/uploads directory:

http://wordpress.org/support/topic/security-risk-at-wp-contentuploads-preventing-unauthorized-access


Joy

October 22, 2013 at 9:51 am

Still no cigar and thanks for the tip. As soon as we get this worked out I will update it. This is a test site – do you want access to play? If so, give me a secure location for login info.


Josh

  • Support Staff

October 22, 2013 at 10:19 am

Hi Joy,

The reason it’s not working is the custom_functions.php file is in the wrong location.

Now it’s in /wp-content/uploads/espresso/directory/custom-files.3.1/custom_functions.php

It should be /wp-content/uploads/espresso/custom_functions.php

Event Espresso does not know to look in a /directory/ directory. You can visualize this by thinking of a file cabinet that has folders. If someone told you to look for a file in the “espresso” folder, that’s where you would look right? The same is true with the Event Espresso software. It’s told to go to the /espresso/ directory (or folder) and look for a custom_functions.php file there. It doesn’t know to look in /directory/custom-files.3.1. So in a nutshell, It will only load up the custom code directly from the espresso folder; It ignores the folders that are being added.

There is some additional documentation here that outlines the exact locations to upload the custom files:

https://eventespresso.com/wiki/custom-files-addon/


Joy

October 22, 2013 at 10:24 am

Awesome that did it. Thank you so much for your patience.

Viewing 18 reply threads

The support post ‘How to change the term "attendee" to "guest".’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso