Support » Plugins » Bug? Cannot redeclare a pluggable function

  • I just upgraded to 2.8.2 and now a plugin I wrote has broken:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare wp_authenticate() (previously declared in […]/wp-includes/pluggable.php:456) in […]/plugins/myplugin/login.php on line 64

    Is this a bug? Or am I doing something wrong?

    For now I’ve just commented out wp_authenticate in pluggables.php, but that’s not a very good solution!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Bump. Anyone?

    Did you get this figured out, Harry? If so, would you please
    share the solution with the rest of us who are having the same problem?

    Moderator Andrew Nacin


    Lead Developer

    When a plugin goes through the activation process, it gets included *after* pluggable.php gets included. During the load process, it gets included before.

    Any plugin overriding a pluggable function should take care to wrap their function definition in a function_exists check, not only to play nice with the activation process, but also with other plugins.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug? Cannot redeclare a pluggable function’ is closed to new replies.