Posted: 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. |
|
Hi, The best way is via translation, here is a useful guide – https://eventespresso.com/wiki/how-to-change-wording-with-poedit/ |
|
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! |
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:
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:
|
|
|
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. |
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. |
|
|
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. |
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:
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
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. |
|
|
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 |
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 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 ); |
|
|
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? |
|
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. |
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. |
|
|
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? |
|
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 $strings = array( // Add some more strings here // See if the current string is in the $strings array if ( isset( $strings[$original] ) ) { // This accomplishes the same thing as __() $translations = &get_translations_for_domain( $domain ); return $translated; /* } /* //These messages can be uesd to display the status of the an event. case ‘ACTIVE’: case ‘NOT_ACTIVE’: case ‘ONGOING’: case ‘SECONDARY’: } /* global $wpdb, $org_options; if ($display_desc == ‘Y’){ foreach ($events as $event){ $allow_overflow = $event->allow_overflow; //Address formatting //Google map link creation //These variables can be used with other the espresso_countdown, espresso_countup, and espresso_duration functions and/or any javascript based functions. //This can be used in place of the registration link if you are usign the external URL feature if (!is_user_logged_in() && get_option(‘events_members_active’) == ‘true’ && $member_only == ‘Y’) { |
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 |
|
|
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. |
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: |
|
|
Awesome that did it. Thank you so much for your patience. |
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.