{"id":29,"date":"2026-03-23T12:31:37","date_gmt":"2026-03-23T12:31:37","guid":{"rendered":"https:\/\/michelangelotheplay.com\/?wpcode=font-enabler"},"modified":"2026-03-24T06:30:43","modified_gmt":"2026-03-24T06:30:43","slug":"font-enabler","status":"publish","type":"post","link":"https:\/\/michelangelotheplay.com\/?p=29","title":{"rendered":"font enabler"},"content":{"rendered":"<p>\/\/ Allow font uploads (TTF, OTF, WOFF, WOFF2, EOT)<br \/>\nadd_filter(\\&#8217;upload_mimes\\&#8217;, function($mimes) {<br \/>\n    $mimes[\\&#8217;ttf\\&#8217;]   = \\&#8217;font\/ttf\\&#8217;;<br \/>\n    $mimes[\\&#8217;otf\\&#8217;]   = \\&#8217;font\/otf\\&#8217;;<br \/>\n    $mimes[\\&#8217;woff\\&#8217;]  = \\&#8217;font\/woff\\&#8217;;<br \/>\n    $mimes[\\&#8217;woff2\\&#8217;] = \\&#8217;font\/woff2\\&#8217;;<br \/>\n    $mimes[\\&#8217;eot\\&#8217;]   = \\&#8217;application\/vnd.ms-fontobject\\&#8217;; \/\/ important<br \/>\n    return $mimes;<br \/>\n});<\/p>\n<p>\/\/ Fix file type validation issue (WordPress security check)<br \/>\nadd_filter(\\&#8217;wp_check_filetype_and_ext\\&#8217;, function($data, $file, $filename, $mimes) {<br \/>\n    $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));<\/p>\n<p>    if (in_array($ext, [\\&#8217;ttf\\&#8217;,\\&#8217;otf\\&#8217;,\\&#8217;woff\\&#8217;,\\&#8217;woff2\\&#8217;,\\&#8217;eot\\&#8217;])) {<br \/>\n        $data[\\&#8217;ext\\&#8217;]  = $ext;<\/p>\n<p>        if ($ext === \\&#8217;eot\\&#8217;) {<br \/>\n            $data[\\&#8217;type\\&#8217;] = \\&#8217;application\/vnd.ms-fontobject\\&#8217;;<br \/>\n        } else {<br \/>\n            $data[\\&#8217;type\\&#8217;] = \\&#8217;font\/\\&#8217; . $ext;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    return $data;<br \/>\n}, 10, 4);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ Allow font uploads (TTF, OTF, WOFF, WOFF2, EOT) add_filter(\\&#8217;upload_mimes\\&#8217;, function($mimes) { $mimes[\\&#8217;ttf\\&#8217;] = \\&#8217;font\/ttf\\&#8217;; $mimes[\\&#8217;otf\\&#8217;] = \\&#8217;font\/otf\\&#8217;; $mimes[\\&#8217;woff\\&#8217;] = \\&#8217;font\/woff\\&#8217;; $mimes[\\&#8217;woff2\\&#8217;] = \\&#8217;font\/woff2\\&#8217;; $mimes[\\&#8217;eot\\&#8217;] = \\&#8217;application\/vnd.ms-fontobject\\&#8217;; \/\/ important return $mimes; }); \/\/ Fix file type validation issue (WordPress security check) add_filter(\\&#8217;wp_check_filetype_and_ext\\&#8217;, function($data, $file, $filename, $mimes) { $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); if (in_array($ext, [\\&#8217;ttf\\&#8217;,\\&#8217;otf\\&#8217;,\\&#8217;woff\\&#8217;,\\&#8217;woff2\\&#8217;,\\&#8217;eot\\&#8217;])) { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":0,"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michelangelotheplay.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}