function name conflict with theme – solution included
-
Hello,
I got the following server-side fatal error after updating site theme:
PHP Fatal error: Cannot redeclare function get_product_name() (previously declared in /wp-content/themes/consulting/admin/admin-notifications-popup/admin-notification-popup.php:14) in /wp-content/plugins/woocommerce-delivery-notes/includes/wcdn-template-functions.php on line 894I have checked the
wcdn-template-functions.phpfile and found that almost every function name begins with ‘wcdn_‘ except the last ones. I have added the ‘wcdn_‘ prefix to those function names, changed all occurences in your plugin’s files and now everything works fine.
Plesae find the list of changes I have made and include it in the next update release:\includes\wcdn-template-functions.php file:line 894get_product_name -> wcdn_get_product_name(used at: all files in \includes\admin\views\Preview_template folder, all files in subfolders of \templates folder)line 996
get_adjusted_quantity -> wcdn_get_adjusted_quantity(used at: all files in \includes\admin\views\Preview_template folder, all files in subfolders of \templates folder)line 1010
add_guest_access_token_to_order -> wcdn_add_guest_access_token_to_order(used at: wcdn-template-hooks.php line 35)line 1021
add_guest_access_token_to_order_blocks -> wcdn_add_guest_access_token_to_order_blocks(used at: wcdn-template-hooks.php line 36)line 1032
add_guest_access_token -> wcdn_add_guest_access_token(used at: lines 1012 and 1023)Thank you!
Best regards,
Endre
The topic ‘function name conflict with theme – solution included’ is closed to new replies.