Hello,
When I try to remove some dashboard widgets for instructor using this code :
// Create the function to use in the action hook
function example_remove_dashboard_widget() {
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
}
// Hook into the 'wp_dashboard_setup' action to register our function
if (!current_user_can('manage_options')) {
add_action('wp_dashboard_setup', 'example_remove_dashboard_widget' );
}
I get that :
Fatal error: Call to undefined function wp_get_current_user() in /home/site/www/wplms/wp-includes/capabilities.php on line 1441