修复 WordPress 抱歉, 由于安全原因, 这个文件类型不受支持。

修复 WordPress 抱歉, 由于安全原因, 这个文件类型不受支持。


标签: 

正在查看 1 个帖子:11-11 (共 11 个帖子)
  • 作者
    帖子
  • zhangjc
    参与者
    • 文章数量: 21
    @zhangjc

    /********结合你们说的我大致补充下******************************/

    function my_custom_upload_mimes1($mimes1 = array()) {

    // Add a key and value for the SVG file type
    $mimes1[‘TTF’] = “text/TTF”;

    return $mimes1;
    }

    add_action(‘upload_mimes1’, ‘my_custom_upload_mimes1’);

    function my_custom_upload_mimes2($mimes2 = array()) {

    // Add a key and value for the SVG file type
    $mimes2[‘WOFF’] = “text/WOFF”;

    return $mimes2;
    }

    add_action(‘upload_mimes2’, ‘my_custom_upload_mimes2’);

    function my_custom_upload_mimes3($mimes3 = array()) {

    // Add a key and value for the SVG file type
    $mimes3[‘WOFF2’] = “text/WOFF2”;

    return $mimes3;
    }

    add_action(‘upload_mimes3’, ‘my_custom_upload_mimes3’);

    function my_custom_upload_mimes4($mimes4 = array()) {

    // Add a key and value for the SVG file type
    $mimes4[‘SVG’] = “text/SVG”;

    return $mimes4;
    }

    add_action(‘upload_mimes4’, ‘my_custom_upload_mimes4’);

    function my_custom_upload_mimes5($mimes5 = array()) {

    // Add a key and value for the SVG file type
    $mimes5[‘EOT’] = “text/EOT”;

    return $mimes5;
    }

    add_action(‘upload_mimes5’, ‘my_custom_upload_mimes5’);

     

    /*************svg eot woff woff2 ttf 用完可以删除代码**********/

    /************这个加完后,请vi  wordpress的wp-config.php文件加入define( ‘ALLOW_UNFILTERED_UPLOADS’, true );define( ‘ALLOW_UNFILTERED_UPLOADS’, true );********************************************/

正在查看 1 个帖子:11-11 (共 11 个帖子)
  • 哎呀,回复话题必需登录。

未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。

收藏纪念品


有奖活动

参与论坛社区问答,有机会获赠文派瓦普(Wapuu.com)手办模型。

话题信息

商业系统