Title: [Hook request] Make the input:file required
Last modified: January 10, 2017

---

# [Hook request] Make the input:file required

 *  [Geoffrey](https://wordpress.org/support/users/creativejuiz/)
 * (@creativejuiz)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/hook-request-make-the-inputfile-required/)
 * Hello,
 * I need to make the front input:file field required to avoid too quick submission
   by the users.
 * In init.php I did something like that, waiting for your approval for this hook
   request. Line 332.
 *     ```
       $required = apply_filters( 'bua_is_input_file_required', false ) ? ' required' : '';
       echo '<p><input type="file" name="basic-user-avatar" id="basic-local-avatar"' . $required . ' /></p>';
       ```
   
 * I think you should allow custom attributes here to improve your code, like the
   capture attribute and accept attribute.
    [https://www.w3.org/TR/html-media-capture/](https://www.w3.org/TR/html-media-capture/)
 * Thank you 🙂
    -  This topic was modified 9 years, 4 months ago by [Geoffrey](https://wordpress.org/support/users/creativejuiz/).

The topic ‘[Hook request] Make the input:file required’ is closed to new replies.

 * ![](https://ps.w.org/basic-user-avatars/assets/icon-256x256.png?rev=2560641)
 * [Basic User Avatars](https://wordpress.org/plugins/basic-user-avatars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basic-user-avatars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basic-user-avatars/)
 * [Active Topics](https://wordpress.org/support/plugin/basic-user-avatars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basic-user-avatars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basic-user-avatars/reviews/)

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [improvement](https://wordpress.org/support/topic-tag/improvement/)
 * [request](https://wordpress.org/support/topic-tag/request/)

 * 0 replies
 * 1 participant
 * Last reply from: [Geoffrey](https://wordpress.org/support/users/creativejuiz/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/hook-request-make-the-inputfile-required/)
 * Status: not a support question