Posted: January 15, 2022 at 9:24 am
I would like to use the method here (https://gist.github.com/Pebblo/e0b88c12988f1d12c16692e4d4554bf0) to enter an actual. My users regularly forget their password and the default only takes them to create a new membership not find a password. Of course I know they can easily do it from that page but people being people, I get lots of email that they “cannot figure it out”. If I can add the reset password url it would save some calls. The problem is, I cannot figure out the syntax. No matter what I do, I get a parsing error. Can you help? |
|
Hi there, Your example contains multiple single quotes which if you are including in the above function would give you a parse error because the function opens and closes the string using them. So something like this should work:
If you need to include single quotes in the string then you’ll need to escape them using |
|
Ugh… Yes. I knew it was the quotes but I thought it was the double quotes. Thanks! |
|
This reply has been marked as private. | |
Just to give a better example here, when you define a string you can either do:
or
The difference between the 2 is when you use
PHP needs to know where the string starts and ends, so when you open with either one of those it will ‘end’ the string on the next instance:
This works:
And… finally, you can mix and match:
So it’s a case of matching your opening quotes with your closing, escaping any that should be included in the string and choosing either single or double quotes depending on the use case. |
|
(Posted the above whilst you posted your last reply) Thanks for your suggestion on creating a course for these types of customizations for people to learn with. However, I disagree with the assessment of our support load decreasing with those kinds of courses. A ‘PHP for beginners’ type course focuses on learning PHP itself, you take that course because you want to learn some PHP, right? You can then apply those skills to customizations like this… because you know PHP. A ‘PHP for beginners so that you can customize some section of EE’ is basically exactly the same (there’s nothing special about EE’s PHP) but now the premise is to learn EE customizations, not PHP (yes you’d learn PHP but that wouldn’t be the real goal for most taking it). With that type of course the focus is not learning PHP to apply those skills to EE, but to customize EE. That may not seem like much but it means the assumption by the person taking the course (no matter how much we would try and market it otherwise) would be our support for customizations. I suspect we would either end up with more posts here on the forums requesting help with customizations and officially we don’t provide support for any customizations. If I can help point someone in the right direction I will, but that’s still not official EE support. Or, supporting those people wanting to customize a specific section of EE whilst taking the course who don’t understand it because they know very little PHP will start taking time away from here (the ‘official’ EE support channel). So… In my opinion, if someone wants to learn enough to start customizing Event Espresso: 1. Start with a PHP for beginners course (there a dime a dozen, so find one that suits your own learning style and roll with it, you don’t need to be a PHP blackbelt to customize EE). All of those skills can then be applied to almost ANY plugin within WordPress, with the above you didn’t learn how to use an EE specific hook/function to change what you wanted… you learnt how to find that EE specific hook/function and how to correctly make changes with your new skills, that’s a much more useful skill to have. |
|
Thanks, Tony. Your perspective is well understood and hinted at in my question. Your detailed explanation fully explains why it is not smart for EE to do. Php for Beginners – Refresher Course, anyone? |
|
Yeah, sorry. I know you mentioned that above and should have added that to my reply, I just wanted to add some more details on why (at least right now) I personally don’t think it is something we (EventEspresso) could/should take on. It’s a good idea for someone to market specifically to customizing EE as their own niche though 🙂 |
|
The support post ‘Adding a URL to a custom translation’ 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.