Link to home
Start Free TrialLog in
Avatar of 911bob
911bobFlag for United States of America

asked on

Modify Filter to cause a field to be not Required

Working with a Simple Job Board Plug in the is requiring the user to upload a resume. I have very simple needs and do not need to have the resume attached (but would like to leave it as optional)

I have narrowed the code down to the line:
apply_filters('sjb_resume_required', 'required="required"')

But I am unsure how to "turn it off.
Any guidance would be appreciated.
Below is a bit more of the code before and after..


$sjb_attach_resume = '<div class="form-group">'
                    . '<label for="applicant_resume">' . apply_filters('sjb_resume_label', __('Attach Resume', 'simple-job-board')) . '<span class="sjb-required required">*</span></label>'
                    . '<input type="file" name="applicant_resume" id="applicant-resume" class="sjb-attachment form-control "' . apply_filters('sjb_resume_required', 'required="required"') . '>'
                    . '<span class="sjb-invalid-attachment validity-note" id="file-error-message"></span>'
                    . '</div>';
            echo apply_filters('sjb_attach_resume', $sjb_attach_resume);
Avatar of lenamtl
lenamtl
Flag of Canada image

You can just remove
 'required="required"

Open in new window

from any field that is not required.
If it's still requesting to fill the field then
you  have to check the javascript validation and php server side validation, if there is any validation rule about 'required' for this specific field.
ASKER CERTIFIED SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 911bob

ASKER

Thanks