Make WordPress Core


Ignore:
Timestamp:
09/09/2015 03:41:27 AM (9 years ago)
Author:
wonderboymusic
Message:

Ensure that role is not empty before adding it in add_role() function and methods.

Props MikeHansenMe, dannydehaan, michielhab.
Fixes #23746.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities-functions.php

    r33752 r33967  
    472472 */
    473473function add_role( $role, $display_name, $capabilities = array() ) {
     474    if ( empty( $role ) ) {
     475        return;
     476    }
    474477    return wp_roles()->add_role( $role, $display_name, $capabilities );
    475478}
Note: See TracChangeset for help on using the changeset viewer.