Ticket #24438: 24438.diff
| File 24438.diff, 3.5 KB (added by , 13 years ago) |
|---|
-
wp-admin/includes/schema.php
586 586 add_role('subscriber', 'Subscriber'); 587 587 588 588 // Add caps for Administrator role 589 $role = &get_role('administrator');589 $role = get_role('administrator'); 590 590 $role->add_cap('switch_themes'); 591 591 $role->add_cap('edit_themes'); 592 592 $role->add_cap('activate_plugins'); … … 619 619 $role->add_cap('level_0'); 620 620 621 621 // Add caps for Editor role 622 $role = &get_role('editor');622 $role = get_role('editor'); 623 623 $role->add_cap('moderate_comments'); 624 624 $role->add_cap('manage_categories'); 625 625 $role->add_cap('manage_links'); … … 641 641 $role->add_cap('level_0'); 642 642 643 643 // Add caps for Author role 644 $role = &get_role('author');644 $role = get_role('author'); 645 645 $role->add_cap('upload_files'); 646 646 $role->add_cap('edit_posts'); 647 647 $role->add_cap('edit_published_posts'); … … 652 652 $role->add_cap('level_0'); 653 653 654 654 // Add caps for Contributor role 655 $role = &get_role('contributor');655 $role = get_role('contributor'); 656 656 $role->add_cap('edit_posts'); 657 657 $role->add_cap('read'); 658 658 $role->add_cap('level_1'); 659 659 $role->add_cap('level_0'); 660 660 661 661 // Add caps for Subscriber role 662 $role = &get_role('subscriber');662 $role = get_role('subscriber'); 663 663 $role->add_cap('read'); 664 664 $role->add_cap('level_0'); 665 665 } … … 672 672 function populate_roles_210() { 673 673 $roles = array('administrator', 'editor'); 674 674 foreach ($roles as $role) { 675 $role = &get_role($role);675 $role = get_role($role); 676 676 if ( empty($role) ) 677 677 continue; 678 678 … … 693 693 $role->add_cap('read_private_pages'); 694 694 } 695 695 696 $role = &get_role('administrator');696 $role = get_role('administrator'); 697 697 if ( ! empty($role) ) { 698 698 $role->add_cap('delete_users'); 699 699 $role->add_cap('create_users'); 700 700 } 701 701 702 $role = &get_role('author');702 $role = get_role('author'); 703 703 if ( ! empty($role) ) { 704 704 $role->add_cap('delete_posts'); 705 705 $role->add_cap('delete_published_posts'); 706 706 } 707 707 708 $role = &get_role('contributor');708 $role = get_role('contributor'); 709 709 if ( ! empty($role) ) { 710 710 $role->add_cap('delete_posts'); 711 711 } … … 717 717 * @since 2.3.0 718 718 */ 719 719 function populate_roles_230() { 720 $role = &get_role( 'administrator' );720 $role = get_role( 'administrator' ); 721 721 722 722 if ( !empty( $role ) ) { 723 723 $role->add_cap( 'unfiltered_upload' ); … … 730 730 * @since 2.5.0 731 731 */ 732 732 function populate_roles_250() { 733 $role = &get_role( 'administrator' );733 $role = get_role( 'administrator' ); 734 734 735 735 if ( !empty( $role ) ) { 736 736 $role->add_cap( 'edit_dashboard' ); … … 743 743 * @since 2.6.0 744 744 */ 745 745 function populate_roles_260() { 746 $role = &get_role( 'administrator' );746 $role = get_role( 'administrator' ); 747 747 748 748 if ( !empty( $role ) ) { 749 749 $role->add_cap( 'update_plugins' ); … … 757 757 * @since 2.7.0 758 758 */ 759 759 function populate_roles_270() { 760 $role = &get_role( 'administrator' );760 $role = get_role( 'administrator' ); 761 761 762 762 if ( !empty( $role ) ) { 763 763 $role->add_cap( 'install_plugins' ); … … 771 771 * @since 2.8.0 772 772 */ 773 773 function populate_roles_280() { 774 $role = &get_role( 'administrator' );774 $role = get_role( 'administrator' ); 775 775 776 776 if ( !empty( $role ) ) { 777 777 $role->add_cap( 'install_themes' ); … … 784 784 * @since 3.0.0 785 785 */ 786 786 function populate_roles_300() { 787 $role = &get_role( 'administrator' );787 $role = get_role( 'administrator' ); 788 788 789 789 if ( !empty( $role ) ) { 790 790 $role->add_cap( 'update_core' );