WordPress:允許Contributors上傳與編輯自己的圖片

只要在functions.php加入以下程式碼即可。

//Allow Contributors to Add Media
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');
}

參考文章:
http://viralpatel.net/blogs/wordpress-allow-contributors-add-media/

預設圖片
HC
文章: 241