Skip to content

Instantly share code, notes, and snippets.

@jgalea
Last active January 31, 2020 10:47
Show Gist options
  • Select an option

  • Save jgalea/5982522 to your computer and use it in GitHub Desktop.

Select an option

Save jgalea/5982522 to your computer and use it in GitHub Desktop.

Revisions

  1. jgalea revised this gist Jul 12, 2013. 1 changed file with 2 additions and 11 deletions.
    13 changes: 2 additions & 11 deletions custom-role.php
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,6 @@
    <?php
    $result = add_role( 'basic_contributor', 'Basic Contributor', array(
    $result = add_role( 'advanced_contributor', 'Advanced Contributor', array(
    'read' => true, // True allows that capability
    'edit_posts' => true,
    'delete_posts' => false, // Use false to explicitly deny
    ));

    if (null !== $result)
    {
    echo 'Yay! New role created!';
    }
    else
    {
    echo 'Oh... the basic_contributor role already exists.';
    }
    ));
  2. jgalea created this gist Jul 12, 2013.
    15 changes: 15 additions & 0 deletions custom-role.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?php
    $result = add_role( 'basic_contributor', 'Basic Contributor', array(
    'read' => true, // True allows that capability
    'edit_posts' => true,
    'delete_posts' => false, // Use false to explicitly deny
    ));

    if (null !== $result)
    {
    echo 'Yay! New role created!';
    }
    else
    {
    echo 'Oh... the basic_contributor role already exists.';
    }