Posted: May 12, 2014 at 6:24 am
|
Is it possible to disable the links to events on the My Events page without editing core files? Currently the link goes to the event itself. I’d rather it simply display the event title – no hyperlink. I couldn’t find a corresponding template file or setting to change it. If it means editing core files, then so be it, but worth asking first. http://jobza.co.za/wp-content/uploads/2014/05/Screen-Shot-2014-05-12-at-2.09.27-PM.png |
|
Hi Simon, There is no option for removing those, so you have 3 choices: 1) Copy the event_espresso_my_events function from the my_events_page.php file to a custom_functions.php file in the uploads/espresso folder or to a custom plugin and edit there (recommended) http://codex.wordpress.org/Pluggable_Functions 2) Edit the event_espresso_my_events function directly in the core file (not recommended). 3) Use JavaScript to disable the links. |
|
First option sounds great. I’m digging around in the EE plugin.. can’t seem to find my_events_page.php. What’s the file path? |
Hi Simon, my_events_page.php is not actually a part of Event Espresso core. It is included within the WP_Members Add-on, you’ll find it within: wp-content/plugins/espresso-members/my_events_page.php Hope that helps ๐ |
|
|
Thanks Tony and Dean.. making some headway. So looking at function event_espresso_my_events() I don’t see how it turns the event title in the My Events page into a hyperlink, although I do see an $event_link variable defined lower down in that file – not sure I should touch that, though.. |
You’ll need to change Line 170: <td class="post-title page-title column-title"><strong><?php echo $event_link?></strong></td> Change that to: <td class="post-title page-title column-title"><strong><?php echo stripslashes_deep($event->event_name);?></strong></td> That will then only output the event name, rather than the link. |
|
|
Ah, I see.. the function takes up almost the whole file. Sorry, was visually mis-aligning my curly braces. I’ve pasted the modified* event_espresso_my_events function into /uploads/espresso/custom_files.php My titles are still links. Am I missing something? * from the beginning of the original code I removed |
Sorry, that’s a typo. The file should be named custom_functions.php and is included within the Custom Files Add-on (to explain where the typo has come from) I’ll amend Deans post as to not cause confusion in the future. Once you rename that file it should work correctly. |
|
|
Thanks Tony, |
Hi Simon, You do not need to purchase the Add-on, just simply rename your current custom_files.php file to custom_functions.php The Custom Files reference was just to explain where _files.php come from. |
|
|
Thanks Tony, custom_functions.php is a useful feature. * up to line 224, and removing the opening if statement |
|
Here’s the full custom_functions.php: |
Hi Simon, Apologies, I have found the issue. On line 8 of your function you’ll find: require_once('user_vars.php'); Change that to: require_once(EVENT_ESPRESSO_MEMBERS_DIR . 'user_vars.php'); That function is looking for the file user_vars.php within the same directory of the function itself (wp-content/uploads/espresso/) That change forces it to use the correct directory. (alternatively you could copy user_vars.php to the same directory although the fix above will continue to use updated versions when released) I have created a ticket to include either this or a similar fix within newer versions of the Members Add-on. |
|
|
Spot on! – all working now.. Thanks so much Tony : ) |
No Problem ๐ |
|
The support post ‘Disable Links on My Events page without editing core files’ 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.