Make WordPress Core


Ignore:
Timestamp:
02/11/2006 09:56:02 AM (19 years ago)
Author:
ryan
Message:

Add new page caps now that pages can be draft or publish. Brings page caps to parity with posts. Add delete caps for posts and pages. fixes #2382 #2336 #2301

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-schema.php

    r3510 r3513  
    245245
    246246function populate_roles() {
    247     populate_roles_160();   
     247    populate_roles_160();
     248    populate_roles_210();
    248249}
    249250
     
    337338}
    338339
     340function populate_roles_210() {
     341    $roles = array('administrator', 'editor');
     342    foreach ($roles as $role) {
     343        $role = get_role($role);
     344        if ( empty($role) )
     345            continue;
     346
     347        $role->add_cap('edit_others_pages');
     348        $role->add_cap('edit_published_pages');
     349        $role->add_cap('publish_pages');
     350        $role->add_cap('delete_pages');
     351        $role->add_cap('delete_others_pages');
     352        $role->add_cap('delete_published_pages');
     353        $role->add_cap('delete_posts');
     354        $role->add_cap('delete_others_posts');
     355        $role->add_cap('delete_published_posts');
     356    }
     357   
     358    $role = get_role('author');
     359    if ( ! empty($role) ) {
     360        $role->add_cap('delete_posts');
     361        $role->add_cap('delete_published_posts');       
     362    }
     363
     364    $role = get_role('contributor');   
     365    if ( ! empty($role) ) {
     366        $role->add_cap('delete_posts');
     367    }
     368}
     369
    339370?>
Note: See TracChangeset for help on using the changeset viewer.