#51556 closed defect (bug) (invalid)
Cannot activate a plugin which overrides pluggable function
Reported by: | superpoincare | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | administration | Cc: |
Description
Trying to activate a plugin with a function with the same name as in wp-includes/pluggable.php gives a fatal error and doesn't activate it.
This probably happens because during the activation process, the pluggable.php file loads earlier. In a normal loading process, the plugin would load earlier and not give this error.
The same plugin would however activate without any errors if I remove the lines and activate the plugin. The plugin would also run if the lines are added after the activation, either by FTP or using the code editor.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Hello @superpoincare with your function are you wrapping it in a function_exists? When overriding pluggable functions it's recommended to do so to avoid the fatal you're running into.
Reference: https://codex.wordpress.org/Pluggable_Functions
I hope that helps overcome the issue, marking as close as this is expected behaviour but leaving open for now incase I misunderstood.