Topic Resolution: Resolved
  • Open
  • Marco Zuppone
    Participant
    August 15, 2019 at 11:28 am #44065

    Hello,

    I’m trying to upload TTF fonts to the theme but all the times I get the error that the files are not allowed for security reasons.
    I tried even to declare define( ‘ALLOW_UNFILTERED_UPLOADS’, true ); in the wp-config.php ut no joy at all.
    I have FTP access to the site so if you tell where to upload the custom fonts or another workaround I will try.
    Kind regards,
    Marco S. Zuppone

    Evgeny
    Keymaster
    Posts: 152
    August 16, 2019 at 5:36 pm #44068

    Hi. First, please consider removing this definition from wp-config – it would be the safer way to go. Second, go to your functions.php file and paste there the code, that I will give in the next message. To make things easier, just paste it in the beginning, right after the opening

    Evgeny
    Keymaster
    Posts: 152
    August 16, 2019 at 5:36 pm #44069

    if ( ! function_exists( ‘evolve_font_mimes’ ) ) {
    function evolve_font_mimes( $mimes = array() ) {
    $mimes[‘woff’] = ‘font/woff’;
    $mimes[‘ttf’] = ‘font/ttf’;
    $mimes[‘svg’] = ‘font/svg’;
    $mimes[‘eot’] = ‘font/eot’;

    return $mimes;
    }

    }

    add_action( ‘upload_mimes’, ‘evolve_font_mimes’ );

    Marco Zuppone
    Participant
    Posts: 9
    August 17, 2019 at 12:28 am #44078

    Hello,

    I followed your recommendations but unfortunately, the problem persists.
    Kind regards,
    Marco

    Marco Zuppone
    Participant
    Posts: 9
    August 17, 2019 at 12:56 am #44080

    Hello,

    I solved it….there was a problem with the quote symbol when I copy and pasted it.
    So all fine! But it works only if I keep the define( ‘ALLOW_UNFILTERED_UPLOADS’, true ); in the wp-config.php

    Not so bad!
    Thanks and regards,
    Marco