Support

Account

Home Forums Front-end Issues Frontend form – custom role can't upload picture Reply To: Frontend form – custom role can't upload picture

  • Hi, Same problem here. Not sure how this worked. I am not using the plugin https://wordpress.org/plugins/theme-my-login/ so where and how the codes should go?

    File upload works fine from backend when logged in as a user.

    I changed the user permission to below:

    add_action('wp', 'allow_employer_uploads');
    function allow_employer_uploads() {
      $employer = get_role('employer');
      // author caps
      $employer->add_cap('edit_published_posts');
      $employer->add_cap('delete_posts');
      $employer->add_cap('edit_posts');
      $employer->add_cap('upload_files');
      // editor caps
      $employer->add_cap('edit_others_posts');
    }
    

    Thanks