thuthuatweb
24-06-2012, 00:54
Thông thường các thành viên Contributor chỉ giới hạn trong quyền viết và gửi bài viết, hôm nay mình sẽ hướng dẫn các bạn cách thêm quyền upload file .
các bạn vào file functions .php trong theme wordpress của các bạn và pass dòng code sau :
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');
}
nhớ thanks nha mấy bạn
các bạn vào file functions .php trong theme wordpress của các bạn và pass dòng code sau :
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');
}
nhớ thanks nha mấy bạn