wpseo_remove_capabilities

Remove the bulk edit capability from the proper default roles.

Description

wpseo_remove_capabilities(); 

Contributor is still removed for legacy reasons.


Usage

  1. if ( !function_exists( 'wpseo_remove_capabilities' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/inc/wpseo-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wpseo_remove_capabilities(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/wpseo-functions.php  
  1. function wpseo_remove_capabilities() { 
  2. $roles = array( 
  3. 'administrator',  
  4. 'editor',  
  5. 'author',  
  6. 'contributor',  
  7. ); 
  8.  
  9. $roles = apply_filters( 'wpseo_bulk_edit_roles', $roles ); 
  10.  
  11. foreach ( $roles as $role ) { 
  12. $r = get_role( $role ); 
  13. if ( $r ) { 
  14. $r->remove_cap( 'wpseo_bulk_edit' );