How to Override a Function
-
I read a WP “how to” thread on overriding a function.
I am trying to override a function that exists in pluggable.php. I am under the impression that all I needed to do is name my function the same thing as it is named in pluggable. Because pluggable (supposedly) first checks to see if the function exists, it will not try to recreate an instance of it. That was my understanding from reading the PW thread.
So I went to activate my plugin with the identical function name that exists in pluggable and I got an error:
Plugin could not be activated because it triggered a fatal error. Fatal error: Cannot redeclare wp_new_user_notification() (previously declared in /home/abcd/public_html/blogs/wp-includes/pluggable.php:1182) in /home/abcd/public_html/blogs/wp-content/plugins/my_new_user_notification/plugin.php on line 30"
- The topic ‘How to Override a Function’ is closed to new replies.