[wp-trac] Re: [WordPress Trac] #9915: Cannot activate plugin which
override function from pluggable.php
WordPress Trac
wp-trac at lists.automattic.com
Sat May 23 08:26:48 GMT 2009
#9915: Cannot activate plugin which override function from pluggable.php
--------------------------+-------------------------------------------------
Reporter: sirzooro | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: General | Version: 2.7.1
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Comment(by dd32):
{{{
Plugin could not be activated because it triggered a fatal error. Fatal
error: Cannot redeclare wp_new_user_notification() (previously declared in
/some/path/wp-includes/pluggable.php:1100) in /some/path/wp-
content/plugins/plugin/plugin.php on line xxx
}}}
Deactivate all other plugins, and try again.
As long as your plugin file has the function in the global scope when its
included, that error shouldnt occur. I think theres 1 or 2 dodgy plugins
which do a include_once('pluggables.php'); when they shouldnt (see #9826)
But yes, You're right, There needs to be better support for this sort of
thing, Pluggables shouldn't be EVER used, and instead, Filters should be
used.. (I only say that, since Pluggable functions, like you've mentioned,
can only be replaced once..)
See #8833 for a new direction of pluggables
Probably should close this as a dupe of that. (Because you're original
problem is invalid, but the idea to change the rest of it is elsewhere)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9915#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list