Last active
October 7, 2021 16:04
-
-
Save dericleeyy/6190360fd53faf9fb3217a2bf3cb68d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.