Those who have upgraded to WordPress 1.5.1 have noticed that the upgrade broke a few plugins, such as Post Levels.
This was due to some changes in the WordPress architecture that allow plugin developers to replace some of the core functions in WordPress. However, this means that those functions will not be available when your plugin gets loaded. The functions are now defined in wp-includes/pluggable-functions.php, as of 1.5.1 the following functions are pluggable:
get_currentuserinfoget_userdataget_userdatabyloginwp_mailwp_loginauth_redirectwp_redirectwp_setcookiewp_clearcookiewp_notify_postauthorwp_notify_moderator
Plugins that depend on any of the above functions need to make sure all uses of the function occur after all plugins have loaded. This is only an issue for code that is executed when the plugin is initialized (as opposed to code that is hooked into an action or filter). Initialization code should be refactored to run after WordPress has initliazed, as in the sample below:
// Run setup after the pluggable functions have loaded
add_action('init', 'myplugin_setup')
function myplugin_setup()
{
// Code lives here
}
Alternatively, you can hook into plugins_loaded, which is also executed after the pluggable functions have loaded.
Viewing 4 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Trackbacks
(Trackback URL)