Skip to content

Instantly share code, notes, and snippets.

@dericleeyy
Last active October 7, 2021 16:04
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 dericleeyy/6190360fd53faf9fb3217a2bf3cb68d9 to your computer and use it in GitHub Desktop.
Save dericleeyy/6190360fd53faf9fb3217a2bf3cb68d9 to your computer and use it in GitHub Desktop.
function filter_allowed_mime_types( $allowed_mime_types ) {
if ( 'company_logo' === $field ) {
$allowed_mime_types = [
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
];
} else {
$allowed_mime_types = [
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'mp4' => 'video/mp4',
];
}
return $allowed_mime_types;
}
add_filter( 'job_manager_mime_types', filter_allowed_mime_types );
@wkjones
Copy link

wkjones commented Oct 7, 2021

I believe the add_filter line (23) is missing single quotes around the filter_allowed_mime_types

Last line should look like this. Correct?
add_filter( 'job_manager_mime_types', 'filter_allowed_mime_types' );

Maybe it helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment