[WordPress] 外掛分享: Google-Fonts-Wrapper

首頁外掛目錄 › Google-Fonts-Wrapper
WordPress 外掛 Google-Fonts-Wrapper 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
100+
安裝啟用
尚無評分
883 天前
最後更新
問題解決
WordPress 4.0+ PHP 5.6+ v0.4.2 上架:2018-06-18

內容簡介

此外掛會自動解析所有註冊的樣式(styles),並從 Google 匯入資源到你的伺服器中,並載入它們。

使用方式

只需使用 wp_enqueue_scripts,就可以從 Google 包含字體。

此外掛會解析從已經佇列的樣式表中取得的 URL,以及檢測 Google 的前端。

檔案會下載到你的伺服器,並修改 CSS 以適應新的路徑。

你可以使用管理列中的按鈕清除你的伺服器中的字體。

注意事項

當在一個樣式標籤中使用多個字體時,請務必使用不帶版本號的腳本,以避免 WordPress 將 URL 正常化。

wp_enqueue_style('...', '...', [], null);

由於 Google 可以將參數 family 接受多次,因此 WordPress 會將它們合併為一個。

請注意,某些同時提供最小化和快取功能的插件,可能會導致此插件失效,因為字體將在插件鉤子之前被解析。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.4.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Google-Fonts-Wrapper」→ 直接安裝(推薦)

原文外掛簡介

The plugin will automatically parse all registered styles and import the ressources from Google to your server and load them.
Usage
Simply include the fonts from Google by using wp_enqueue_scripts.
The plugin will parse the URL from the enqueued stylesheets and detect front from Google.
The files will be downloaded to your server and the CSS will be changed to match the new paths.
You may flush the fonts from your server using the button in the admin bar.
Notes
When using multiple fonts in one style-tag, please make sure to use no load the script without a version, to avoid WordPress from normalizing the URL.
wp_enqueue_style('...', '...', [], null);

As Google will accept the parameter family multiple times, WordPress will merge them into one.
Be aware, that some caching plugins which also provide minification, may cause this plugin to break, as the fonts will be parsed before the plugin hook.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon