• Resolved deezywonder

    (@deezywonder)


    Hello guys!

    I’m trying to able the companies upload webp/svg logos, but it’s not working. I added this code, but nothing happens:

    function filter_allowed_mime_types( $allowed_mime_types, $field ) {
        if ( 'company_logo' === $field ) {
            $allowed_mime_types = [
                'jpg|jpeg|jpe' => 'image/jpeg',
                'gif'          => 'image/gif',
                'png'          => 'image/png',
    			'webp'		   => 'image/webp',
    			'svg'		   => 'image/svg',
            ];
        } else {
            $allowed_mime_types = [
                'jpg|jpeg|jpe' => 'image/jpeg',
                'gif'          => 'image/gif',
                'png'          => 'image/png',
    			'webp'		   => 'image/webp',
    			'svg'		   => 'image/svg',
                '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', 10, 2 );

    Someone can help me? JPG, PNG works fine… but svg and webp not!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi @deezywonder

    I’ve created an internal issue to look into this and we’ll let you know as soon as we have an update.

    Thread Starter deezywonder

    (@deezywonder)

    Hi @lastsplash, thank you!

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi there, @deezywonder,

    Thanks for bearing with us while we addressed your problem ??

    For starters, WP 5.8 supports?.webp?uploads out of the box, so assuming your site is up-to-date, there’s no need for the filter for?webp.

    That said, our developers looked at the code, and pointed out that the allowed mime types for the company logo come from the field config.

    You need to add a filter to?submit_job_form_fields, and update?$fields['company_logo']['allowed_mime_types']

    This is the Github reference for you if you want to check it.

    As for the?svg files, we would strongly recommend not allowing untrusted users to upload any SVG files: it would be a major security threat. The SVG format is insecure in so many ways!

    For reference, that’s the main reason SVG is not added in the WordPress core. There are a few plugins that try to make it safe, but most of them still only allow admins to upload them by default.

    Hope that answers your question! Please feel free to reach out if you have any other questions or need some more help.

    Plugin Support Jay

    (@bluejay77)

    Hi there,

    It has been a while since we have heard from you, so I’m marking this topic as resolved.

    But if you have any further questions or need some more help, you’re welcome to reply here or open another thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Company Logo Upload SVG/Webp’ is closed to new replies.