mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-10 12:50:18 +01:00
Explicitly return ref for the sake of PHP4. Fixes user_level being empty when installing on PHP4. Props Mr Pete. fixes #8317 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ac9c3cfe37
commit
4f05c6ff22
@ -351,7 +351,7 @@ function populate_roles_160() {
|
||||
add_role('subscriber', 'Subscriber|User role');
|
||||
|
||||
// Add caps for Administrator role
|
||||
$role = get_role('administrator');
|
||||
$role =& get_role('administrator');
|
||||
$role->add_cap('switch_themes');
|
||||
$role->add_cap('edit_themes');
|
||||
$role->add_cap('activate_plugins');
|
||||
@ -384,7 +384,7 @@ function populate_roles_160() {
|
||||
$role->add_cap('level_0');
|
||||
|
||||
// Add caps for Editor role
|
||||
$role = get_role('editor');
|
||||
$role =& get_role('editor');
|
||||
$role->add_cap('moderate_comments');
|
||||
$role->add_cap('manage_categories');
|
||||
$role->add_cap('manage_links');
|
||||
@ -406,7 +406,7 @@ function populate_roles_160() {
|
||||
$role->add_cap('level_0');
|
||||
|
||||
// Add caps for Author role
|
||||
$role = get_role('author');
|
||||
$role =& get_role('author');
|
||||
$role->add_cap('upload_files');
|
||||
$role->add_cap('edit_posts');
|
||||
$role->add_cap('edit_published_posts');
|
||||
@ -417,14 +417,14 @@ function populate_roles_160() {
|
||||
$role->add_cap('level_0');
|
||||
|
||||
// Add caps for Contributor role
|
||||
$role = get_role('contributor');
|
||||
$role =& get_role('contributor');
|
||||
$role->add_cap('edit_posts');
|
||||
$role->add_cap('read');
|
||||
$role->add_cap('level_1');
|
||||
$role->add_cap('level_0');
|
||||
|
||||
// Add caps for Subscriber role
|
||||
$role = get_role('subscriber');
|
||||
$role =& get_role('subscriber');
|
||||
$role->add_cap('read');
|
||||
$role->add_cap('level_0');
|
||||
}
|
||||
@ -437,7 +437,7 @@ function populate_roles_160() {
|
||||
function populate_roles_210() {
|
||||
$roles = array('administrator', 'editor');
|
||||
foreach ($roles as $role) {
|
||||
$role = get_role($role);
|
||||
$role =& get_role($role);
|
||||
if ( empty($role) )
|
||||
continue;
|
||||
|
||||
@ -458,19 +458,19 @@ function populate_roles_210() {
|
||||
$role->add_cap('read_private_pages');
|
||||
}
|
||||
|
||||
$role = get_role('administrator');
|
||||
$role =& get_role('administrator');
|
||||
if ( ! empty($role) ) {
|
||||
$role->add_cap('delete_users');
|
||||
$role->add_cap('create_users');
|
||||
}
|
||||
|
||||
$role = get_role('author');
|
||||
$role =& get_role('author');
|
||||
if ( ! empty($role) ) {
|
||||
$role->add_cap('delete_posts');
|
||||
$role->add_cap('delete_published_posts');
|
||||
}
|
||||
|
||||
$role = get_role('contributor');
|
||||
$role =& get_role('contributor');
|
||||
if ( ! empty($role) ) {
|
||||
$role->add_cap('delete_posts');
|
||||
}
|
||||
@ -482,7 +482,7 @@ function populate_roles_210() {
|
||||
* @since 2.3.0
|
||||
*/
|
||||
function populate_roles_230() {
|
||||
$role = get_role( 'administrator' );
|
||||
$role =& get_role( 'administrator' );
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
$role->add_cap( 'unfiltered_upload' );
|
||||
@ -495,7 +495,7 @@ function populate_roles_230() {
|
||||
* @since 2.5.0
|
||||
*/
|
||||
function populate_roles_250() {
|
||||
$role = get_role( 'administrator' );
|
||||
$role =& get_role( 'administrator' );
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
$role->add_cap( 'edit_dashboard' );
|
||||
@ -508,7 +508,7 @@ function populate_roles_250() {
|
||||
* @since 2.6.0
|
||||
*/
|
||||
function populate_roles_260() {
|
||||
$role = get_role( 'administrator' );
|
||||
$role =& get_role( 'administrator' );
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
$role->add_cap( 'update_plugins' );
|
||||
@ -522,7 +522,7 @@ function populate_roles_260() {
|
||||
* @since 2.7.0
|
||||
*/
|
||||
function populate_roles_270() {
|
||||
$role = get_role( 'administrator' );
|
||||
$role =& get_role( 'administrator' );
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
$role->add_cap( 'install_plugins' );
|
||||
|
@ -533,7 +533,7 @@ class WP_User {
|
||||
//Build $allcaps from role caps, overlay user's $caps
|
||||
$this->allcaps = array();
|
||||
foreach ( (array) $this->roles as $role ) {
|
||||
$role = $wp_roles->get_role( $role );
|
||||
$role =& $wp_roles->get_role( $role );
|
||||
$this->allcaps = array_merge( $this->allcaps, $role->capabilities );
|
||||
}
|
||||
$this->allcaps = array_merge( $this->allcaps, $this->caps );
|
||||
|
Loading…
Reference in New Issue
Block a user