Making WordPress.org

Changeset 2979


Ignore:
Timestamp:
04/19/2016 07:59:19 PM (10 years ago)
Author:
obenland
Message:

Plugins Directory: Smoothen out capability set up.

Only adds caps to built-in roles if they still exist.
Sets the default role to what plugin authors/committers will have.

See #1570, #1571.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php

    r2930 r2979  
    106106                        $wp_role = get_role( $role );
    107107
     108                        if ( ! $wp_role ) {
     109                                continue;
     110                        }
     111
    108112                        foreach ( $committer as $committer_cap ) {
    109113                                $wp_role->add_cap( $committer_cap );
    … …  
    116120                        }
    117121                }
     122
     123                update_option( 'default_role', 'plugin_committer' );
    118124        }
    119125}
Note: See TracChangeset for help on using the changeset viewer.