修復 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 個帖子)
  • 哎呀,回覆話題必需登錄。

話題信息

  • 當前位於:疑難雜症
  • 10 條回覆
  • 3 個參與人
  • 最後回覆:<a href="https://bbs.weixiaoduo.com/users/zhangjc/" title=" 查看 zhangjc 的個人資料" class="bbp-author-link"><span class="bbp-author-name">zhangjc</span></a>
  • 上次活動:<a href="https://bbs.weixiaoduo.com/topic/25391/page/2/#post-38895" title=" 回覆至:修復 WordPress 抱歉, 由於安全原因, 這個文件類型不受支持。">3 年、 9 月前</a>