WordPress tip: Modify any role name to fit your needs
Tento článek (nebo jeho část) je převzat z externího zdroje. Je tedy slušností jej uvést včetně případného autora.
Have you ever wanted to change the default role names (Administrator, Editor, Author, Contributor, Subscriber) within WordPress? Here is a super useful snippet to do so.
Simply paste this code into your function.php file. Edit lines 5 and 6 at your convenience.
1 2 3 4 5 6 7 8 |
function wps_change_role_name() { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); $wp_roles->roles['contributor']['name'] = 'Owner'; $wp_roles->role_names['contributor'] = 'Owner'; } add_action('init', 'wps_change_role_name'); |
Napsat komentář