Avoid 'Only variables should be assigned by reference' warnings during installation. props sunnyratilal. fixes #24438.
git-svn-id: https://develop.svn.wordpress.org/trunk@24381 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e210a7f280
commit
de68a37dc4
|
@ -586,7 +586,7 @@ function populate_roles_160() {
|
|||
add_role('subscriber', 'Subscriber');
|
||||
|
||||
// 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');
|
||||
|
@ -619,7 +619,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');
|
||||
|
@ -641,7 +641,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');
|
||||
|
@ -652,14 +652,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');
|
||||
}
|
||||
|
@ -672,7 +672,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;
|
||||
|
||||
|
@ -693,19 +693,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');
|
||||
}
|
||||
|
@ -717,7 +717,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' );
|
||||
|
@ -730,7 +730,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' );
|
||||
|
@ -743,7 +743,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' );
|
||||
|
@ -757,7 +757,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' );
|
||||
|
@ -771,7 +771,7 @@ function populate_roles_270() {
|
|||
* @since 2.8.0
|
||||
*/
|
||||
function populate_roles_280() {
|
||||
$role =& get_role( 'administrator' );
|
||||
$role = get_role( 'administrator' );
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
$role->add_cap( 'install_themes' );
|
||||
|
@ -784,7 +784,7 @@ function populate_roles_280() {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
function populate_roles_300() {
|
||||
$role =& get_role( 'administrator' );
|
||||
$role = get_role( 'administrator' );
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
$role->add_cap( 'update_core' );
|
||||
|
|
Loading…
Reference in New Issue