enable upload/insert option for contributor in wordpress

If we know about wordpress user role and their accessibility it is known that no contributor can’t upload/insert any image or can’t set feature image for their post …

there is a little code to enable this feature for each contributor anyway .. we have to edit function.php file in theme directory ..

just add the below code to enable this feature for contributor

if ( current_user_can('contributor') && !current_user_can('upload_files') )
	add_action('admin_init', 'allow_contributor_uploads');

function allow_contributor_uploads() {
	$contributor = get_role('contributor');
	$contributor->add_cap('upload_files');
}

One comment on “enable upload/insert option for contributor in wordpress

Leave a comment