Title: populate_roles_300
Published: April 25, 2014
Last modified: May 20, 2026

---

# populate_roles_300()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#wp--skip-link--target)

Create and modify WordPress roles for WordPress 3.0.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#source)󠁿

    ```php
    function populate_roles_300() {
    	$role = get_role( 'administrator' );

    	if ( ! empty( $role ) ) {
    		$role->add_cap( 'update_core' );
    		$role->add_cap( 'list_users' );
    		$role->add_cap( 'remove_users' );
    		$role->add_cap( 'promote_users' );
    		$role->add_cap( 'edit_theme_options' );
    		$role->add_cap( 'delete_themes' );
    		$role->add_cap( 'export' );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/schema.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/schema.php#L957)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/schema.php#L957-L969)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#related)󠁿

| Uses | Description | 
| [get_role()](https://developer.wordpress.org/reference/functions/get_role/)`wp-includes/capabilities.php` |

Retrieves role object.

  |

| Used by | Description | 
| [populate_roles()](https://developer.wordpress.org/reference/functions/populate_roles/)`wp-admin/includes/schema.php` |

Execute WordPress role creation for the various WordPress versions.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/populate_roles_300/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fpopulate_roles_300%2F)
before being able to contribute a note or feedback.