📜  Autoriser les concurrenturs à télécharger des images - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:51.850000             🧑  作者: Mango

代码示例1
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');
     }