Skip to content

Instantly share code, notes, and snippets.

@jgalea
Last active December 19, 2015 16:19
Show Gist options
  • Select an option

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

Select an option

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

Revisions

  1. jgalea revised this gist Jul 12, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion add-capability.php
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,6 @@ function add_capability() {
    $role = get_role( 'author' );

    // This only works, because it accesses the class instance.
    // would allow the author to edit others' posts for current theme only
    $role->add_cap( 'edit_others_posts' );
    }
    add_action( 'admin_init', 'add_capability');
  2. jgalea created this gist Jul 12, 2013.
    10 changes: 10 additions & 0 deletions add-capability.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <?php
    function add_capability() {
    // gets the author role
    $role = get_role( 'author' );

    // This only works, because it accesses the class instance.
    // would allow the author to edit others' posts for current theme only
    $role->add_cap( 'edit_others_posts' );
    }
    add_action( 'admin_init', 'add_capability');