WordPress.org

Support

Support » Plugins and Hacks » WP User Frontend » [Plugin: WP User Frontend] Require to upload pictures before post

[Plugin: WP User Frontend] Require to upload pictures before post

Viewing 3 replies - 1 through 3 (of 3 total)
  • Add this to functions.php in your theme file.

    // Require an attachment upload
    function my_add_post_validation($errors) {
     if ( empty($_POST['wpuf_attach_title']) ) {
      $errors[] = __( 'Photo upload is required', 'wpuf' );
     }
     return $errors;
    }
    add_filter( 'wpuf_add_post_validation', 'my_add_post_validation');

    If you want to require a featured image instead of an attachment, use $_POST[‘wpuf_featured_img’].

    Hi staceym
    I have a question for you that where should we add that code in the functions.php? and is functions.php of Theme or the plugin?
    Thanks

    Moderator cubecolour

    @numeeja

    ɹoʇɐɹǝpoɯ

    quote: staceym

    Add this to functions.php in your theme file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP User Frontend] Require to upload pictures before post’ is closed to new replies.
Skip to toolbar