Bad call to pluggable.php
-
Hi, thanks for the plugin.
You are including pluggable.php on line 25(ish) of your plugin in the main plugin file. This is causing all pluggable functions to be instantiated before other plugins can overwrite them.
Please edit your plugin to save the settings within a function. I wrote this as an example.
add_action( ‘admin_init’, ‘wpclpl_save_options’ );
function wpclpl_save_options(){
// if(!function_exists(‘wp_get_current_user’)) {
// include(ABSPATH . “wp-includes/pluggable.php”);
// }$wpclpl_save = (isset($_POST[‘wpclpl_save’])) ? filter_var($_POST[‘wpclpl_save’],FILTER_SANITIZE_STRING) : 0;
$current_user = wp_get_current_user();
$current_user_role = array(‘administrator’);
if( array_intersect($current_user_role, $current_user->roles ) && is_admin() && $wpclpl_save==’1′) {
wpclpl_update_options();
}
}
- The topic ‘Bad call to pluggable.php’ is closed to new replies.