1. Customize
  2. Expansions
  3. Adding custom roles to manage GamiPress

Adding custom roles to manage GamiPress

On GamiPress settings you are able to choose the minimum role to administer GamiPress. Users on the role chosen or higher will be able to access to GamiPress management areas.

Internally, GamiPress stores the capability that just this role has.

The default settings are:

  • manage_options: Administrator
  • delete_others_posts: Editor
  • publish_posts: Author

For more information about roles and capabilities, check the Roles and Capabilities on WordPress official docs, specially this section.

function my_prefix_add_contributor_on_minimum_role_setting( $fields ) {
    $fields['minimum_role']['options']['edit_posts'] = __( 'Contributor', 'gamipress' );
    return $fields;
add_filter( 'gamipress_general_settings_fields', 'my_prefix_add_contributor_on_minimum_role_setting' );

How can we help?