Title: [Plugin: Restrict Content] Using this plugin with edited role names
Last modified: August 20, 2016

---

# [Plugin: Restrict Content] Using this plugin with edited role names

 *  Resolved [ElTeniente](https://wordpress.org/support/users/elteniente/)
 * (@elteniente)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-content-using-this-plugin-with-edited-role-names/)
 * Hi,
 * I’ve changed the names of the contributor and subscriber roles using this code
   in my theme function.php file:
 * function change_role_name() {
    global $wp_roles;
 *  if ( ! isset( $wp_roles ) )
    $wp_roles = new WP_Roles();
 *  //You can list all currently available roles like this…
    //$roles = $wp_roles-
   >get_names(); //print_r($roles);
 *  //You can replace “administrator” with any other role “editor”, “author”, “contributor”
   or “subscriber”…
    $wp_roles->roles[‘subscriber’][‘name’] = ‘Non-Resident’; $wp_roles-
   >role_names[‘subscriber’] = ‘Non-Resident’; $wp_roles->roles[‘contributor’][‘
   name’] = ‘Property Owner / Resident’; $wp_roles->role_names[‘contributor’] = ‘
   Property Owner / Resident’;
 * }
    add_action(‘init’, ‘change_role_name’);
 * I can make this plugin work fine with this code with one exception. When selecting
   the restriction access in the plugin’s dialog box on each post, the drop down
   menu still shows contributor and subscriber. I would like it to show my new role
   names instead. I know where the array is for the drop down selection menu and
   that will change the names in the drop down, but the restriction then fails to
   work. I’m sure I need to change the role names in the other plugin files, but
   I’m not sure what changes need to be made. Can anyone help?
 * Basically, I need this plugin to allow me to select the custom role names I’m
   using (when creating new posts)and still function properly.
 * Thanks
 * [http://wordpress.org/extend/plugins/restrict-content/](http://wordpress.org/extend/plugins/restrict-content/)

Viewing 1 replies (of 1 total)

 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-content-using-this-plugin-with-edited-role-names/#post-2430944)
 * You will need to change the names in several different places. You’re on the 
   right track by changing them in the meta box, but you also need to change them
   in the display-functions.php file.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Restrict Content] Using this plugin with edited role names’ 
is closed to new replies.

 * ![](https://ps.w.org/restrict-content/assets/icon.svg?rev=3529325)
 * [Membership Plugin - Kadence Memberships](https://wordpress.org/plugins/restrict-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-content/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-content/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-restrict-content-using-this-plugin-with-edited-role-names/#post-2430944)
 * Status: resolved