populate_roles_250() WordPress Function

This function will add roles and capabilities to a WordPress site. It is useful for adding new user roles or capabilities when creating a new plugin or theme.

populate_roles_250() #

Create and modify WordPress roles for WordPress 2.5.


Source

File: wp-admin/includes/schema.php

function populate_roles_250() {
	$role = get_role( 'administrator' );

	if ( ! empty( $role ) ) {
		$role->add_cap( 'edit_dashboard' );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.