Change WordPress user roles and capabilities Forums How to or FAQ quick edit and permalink disable for role Reply To: quick edit and permalink disable for role

#4860
Vladimir
Keymaster

Hi,

You should not call current_user_can() directly from mu-plugin code. You have to enclose it into some function hooked to the action when WordPress will load it’s core code already, like this:


add_action('admin_init', 'load_mu_plugin');
function load_mu_plugin() {
  if ( current_user_can('page-editor') ) {
      add_filter('page_row_actions','remove_quick_edit',10,1);
      add_filter('post_row_actions','remove_quick_edit',10,1);
  }

}