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’].

    canbe3d

    (@canbe3d)

    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)

    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.