Skip to main content
Restore the wphardcore article from archive.org, since it was listed as a reference for the answer. Although I'll leave the kinsta link too.
Source Link
Rup
  • 4.4k
  • 4
  • 28
  • 29

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References:

https://wordpress.org/support/article/roles-and-capabilities/

http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

and a more modern article from a suggested edit:
https://kinsta.com/blog/wordpress-user-roles/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References:

https://wordpress.org/support/article/roles-and-capabilities/

https://kinsta.com/blog/wordpress-user-roles/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References:

https://wordpress.org/support/article/roles-and-capabilities/

http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

and a more modern article from a suggested edit:
https://kinsta.com/blog/wordpress-user-roles/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References: http://codex.wordpress.org/Roles_and_Capabilities http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

https://wordpress.org/support/article/roles-and-capabilities/

https://kinsta.com/blog/wordpress-user-roles/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References: http://codex.wordpress.org/Roles_and_Capabilities http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References:

https://wordpress.org/support/article/roles-and-capabilities/

https://kinsta.com/blog/wordpress-user-roles/

added 18 characters in body
Source Link
sorich87
  • 8k
  • 36
  • 28

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References: http://codex.wordpress.org/Roles_and_Capabilities http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References: http://codex.wordpress.org/Roles_and_Capabilities http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

This is what you may want to do (add the following code to your theme functions.php file or a custom plugin):

function add_custom_role() {
    global $wp_roles;
    
    $custom_capabilities = array(
        'read', 'edit_posts', 'upload_files',
        'read_private_pages', 'edit_private_pages', 'read_private_posts',
        'edit_private_posts', 'edit_published_pages', 'edit_others_pages',
        'edit_pages', 'edit_published_posts', 'edit_others_post',
        'unfiltered_html', 'manage_options'
    );

    $wp_roles->add_role( 'custom_role', 'Custom Role', $custom_capabilities );
}

add_action( 'init', 'add_custom_role' );

References: http://codex.wordpress.org/Roles_and_Capabilities http://www.wphardcore.com/2010/ultimate-guide-to-roles-and-capabilities/

added 91 characters in body
Source Link
sorich87
  • 8k
  • 36
  • 28
Loading
added 756 characters in body
Source Link
sorich87
  • 8k
  • 36
  • 28
Loading
Source Link
sorich87
  • 8k
  • 36
  • 28
Loading