Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matadorjobs/891dc2086728563e15f6c12745ac40d5 to your computer and use it in GitHub Desktop.
Save matadorjobs/891dc2086728563e15f6c12745ac40d5 to your computer and use it in GitHub Desktop.
Matador Docs Example: Require Resume Submission at Processing Level
<?php // omit opening PHP tag
add_filter( 'matador_application_data_raw', 'matador_docs_require_resume_submission_at_processing_level', 20 );
/**
* Matador Docs Example: Require Resume Submission at Processing Level
*
* In the event spam bots have found a way to bypass your resume requirement, this is an added layer of validation to
* stop the spam from sneaking through. This will have a poor User Interface in the event you use this on forms where
* a resume is optional and this is a site-wide "hammer" solution, so all applications must require resume if you intend
* to use this. Further, this will break the "Matador Jobs Pro - Contact Form Extension" if you use it.
*
* @since 2023-05-02
*
* @author Matador US, LP, @jeremyescott
*
* @param array $submission
* @return array|false
*/
function matador_docs_require_resume_submission_at_processing_level( $submission ) {
if ( empty( $_FILES ) ) {
return false;
}
if ( ! isset( $_FILES[ 'resume' ] ) ) {
return false;
}
return $submission;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment