I copied event_espresso_price_dropdown() to custom_functions.php and I get this error: Fatal error: Cannot redeclare event_espresso_price_dropdown() in …/plugins/espresso-members/member_functions.php on line 345
I didn’t make any changes in that function. The custom_functions.php is in folder: wp-content/uploads/espresso
My Event Espresso version is 3.1.31.1 and WP is 3.5.1. The installation is new and only on my local computer.
Just remove the two slashes at the start of the line, and place a corresponding ending curly bracket on line 463, after the end of that function. That should prevent the fatal error. If you are modifying that function in the custom files with the members add-on running, then that copy from the members add-on may be the one that you want to copy into the custom files and modify.
Fatal error: Cannot redeclare event_espresso_price_dropdown() (previously declared in …wp-content/uploads/espresso/custom_functions.php:159) in …/wp-content/plugins/espresso-members/member_functions.php on line 345
On member_functions.php on line 343 it says:
“if (!function_exists(‘event_espresso_member_price_dropdown‘))” and the next function is named “event_espresso_price_dropdown”. So should I name my function in custom_functions.php “event_espresso_price_dropdown” or “event_espresso_member_price_dropdown“. Which one is correct?
Either can be correct, but they should be consistent. Since you’re trying to override event_espresso_price_dropdown, the conditional check on line 342 should be:
if (!function_exists('event_espresso_price_dropdown')) {
I checked and at one time there was an event_espresso_member_price_dropdown function, but it’s not in the plugin anymore. I’ll make a ticket so the conditional wrapper gets updated in a future version.
Viewing 3 reply threads
The support post ‘Custom Files: Cannot redeclare event_espresso_price_dropdown’ 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.
Support forum for the Custom Files add-on for EE3.