[WordPress] 外掛分享: CSS Flags library

WordPress 外掛 CSS Flags library 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「CSS Flags library」是 2015-06-17 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2016-12-18,距離現在已有 3059 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

pers |

外掛標籤

link | header |

內容簡介

CSS Flags是一款用於WordPress的插件/庫,它可以加載具有響應式旗幟的CSS。

注意:CSS Flags並不是一個獨立的插件/庫。為了顯示旗幟,您需要使用您自己的插件或主題functions.php文件添加代碼到您的主題。

您可以在我的網站上查看這些旗幟。

樣本CSS:

.css-flag.sami {
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHZlcnNpb249IjEuMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAyMCIgaGVpZ2h0PSIxNTAwIj48cmVjdCB3aWR0aD0iNjQ1IiBoZWlnaHQ9IjE1MDAiIGZpbGw9IiNkODFlMDUiLz48cmVjdCB4PSI2NDUiIHdpZHRoPSIxNDAiIGhlaWdodD0iMTUwMCIgZmlsbD0iIzAwN2EzZCIvPjxyZWN0IHg9Ijc4NSIgd2lkdGg9IjE0MCIgaGVpZ2h0PSIxNTAwIiBmaWxsPSIjZmNkMTE2Ii8+PHJlY3QgeD0iOTI1IiB3aWR0aD0iMTA5NSIgaGVpZ2h0PSIxNTAwIiBmaWxsPSIjMDAzOGE4Ii8+PHBhdGggZD0iTSA3ODUsMzEwIGEgNDQwIDQ0MCAwIDAgMCAwLDg4MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAzOGE4IiBzdHJva2Utd2lkdGg9IjgwIi8+PHBhdGggZD0iTSA3ODUsMzEwIGEgNDQwIDQ0MCAwIDAgMSAwLDg4MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDgxZTA1IiBzdHJva2Utd2lkdGg9IjgwIi8+PC9zdmc+');
height: 100%;
width: 134.666666667%;
background-size: 100% 100%;
}
.css-flag.sami-landscape {
height: 100%;
width: 134.666666667%;
}
.css-flag.sami-portrait {
height: 74.2574257426%;
width: 100%;
}

使用方法

CSS文件總大小為4 MB,您不希望將所有數據都發送給用戶,所以必須在您的插件或主題中使用以下過濾器之一。

css_flags_countries:為一個或多個國家加載旗幟

add_filter('css_flags_countries', function() {
return array('no'); // ISO_3166-1_alpha-2國家代碼的數組: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
});

css_flags_regions:為一個或多個地區加載旗幟。您可以在歐洲、大洋洲、非洲、亞洲、北美洲、南美洲和中東之間進行選擇。

add_filter('css_flags_regions', function() {
return array('europe'); //europe, oceania, africa, asia, northamerica, southamerica, middleeast
});

css_flags_exclude:從列表中排除某些國家。這個過濾器必須與css_flags_countries或css_flags_regions過濾器結合使用

add_filter('css_flags_exclude', function() {
return array('eu');
});

css_flags_cachetime:更改緩存時間,默認為7200(60x60x2 = 2小時)

add_filter('css_flags_cachetime', function() {
return 172800; // 2 days
});

如果您必須(但不應該)加載所有CSS旗幟,請使用以下方法:

add_filter('css_flags_countries', function() {
return array('all'); // 加載所有國家旗幟(不要這樣做,因為它是4MB)
});

更多信息請參見GitHub

學分

原始CSS文件來自http://www.phoca.cz/cssflags/。如果您只需要CSS文件,請去那裡獲取。

原文外掛簡介

The CSS Flags plugin / library for WordPress loads a dynamicaly created CSS with responsive flags.
Note: CSS Flags is not a standalone plugin/library, To display the flags you will have to add code to your theme using your own plugin or theme functions.php
You can view the flags at my site
Sample CSS:
.css-flag.sami {
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHZlcnNpb249IjEuMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAyMCIgaGVpZ2h0PSIxNTAwIj48cmVjdCB3aWR0aD0iNjQ1IiBoZWlnaHQ9IjE1MDAiIGZpbGw9IiNkODFlMDUiLz48cmVjdCB4PSI2NDUiIHdpZHRoPSIxNDAiIGhlaWdodD0iMTUwMCIgZmlsbD0iIzAwN2EzZCIvPjxyZWN0IHg9Ijc4NSIgd2lkdGg9IjE0MCIgaGVpZ2h0PSIxNTAwIiBmaWxsPSIjZmNkMTE2Ii8+PHJlY3QgeD0iOTI1IiB3aWR0aD0iMTA5NSIgaGVpZ2h0PSIxNTAwIiBmaWxsPSIjMDAzOGE4Ii8+PHBhdGggZD0iTSA3ODUsMzEwIGEgNDQwIDQ0MCAwIDAgMCAwLDg4MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAzOGE4IiBzdHJva2Utd2lkdGg9IjgwIi8+PHBhdGggZD0iTSA3ODUsMzEwIGEgNDQwIDQ0MCAwIDAgMSAwLDg4MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDgxZTA1IiBzdHJva2Utd2lkdGg9IjgwIi8+PC9zdmc+');
height: 100%;
width: 134.666666667%;
background-size: 100% 100%;
}
.css-flag.sami-landscape {
height: 100%;
width: 134.666666667%;
}
.css-flag.sami-portrait {
height: 74.2574257426%;
width: 100%;
}

Usage
The total CSS file size is 4 MB, and you don’t want to send all that data back to the users, so you must use one of the following filters in your plugin or theme.
css_flags_countries: Load flags for one or more countries
add_filter('css_flags_countries', function() {
return array('no'); // Array with ISO_3166-1_alpha-2 country codes: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
});

css_flags_regions: Load the flags for one or more regions. You can choose between europe, oceania, africa, asia, northamerica, southamerica and middleeast.
add_filter('css_flags_regions', function() {
return array('europe'); //europe, oceania, africa, asia, northamerica, southamerica, middleeast
});

css_flags_exclude: Exclude some countries from the list. This filter must be used in combination with the css_flags_countries or css_flags_regions filters
add_filter('css_flags_exclude', function() {
return array('eu');
});

css_flags_cachetime: Change the cache time, default it’s 7200 (60x60x2 = 2 hours)
add_filter('css_flags_cachetime', function() {
return 172800; // 2 days
});

If you must (but you shouldn’t), you can load all the CSS flags using the following:
add_filter('css_flags_countries', function() {
return array('all'); // load all country flags (don't it's 4MB)
});

More information at GitHub
Credits
The original CSS file is from http://www.phoca.cz/cssflags/. If you only need the CSS file, grab it there.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「CSS Flags library」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1.5 | 0.1.6 | 0.1.7 | 0.1.8 | 0.1.9 | 0.2.0 | 0.2.1 | 0.2.2 | 0.3.0 | trunk |

延伸相關外掛(你可能也想知道)

  • Page Links To 》這個外掛可以讓你將 WordPress 的頁面(或文章或自訂文章類型)連結至你選擇的 URL,而非 WordPress 的 URL。此外,它還會將前往舊的 URL(或「正常」的 URL...。
  • Custom Post Type Permalinks 》自訂文章類型永久連結允許您編輯自訂文章類型的永久連結結構。, 更改自訂分類目錄的永久鏈接,以“example.org/post_type/taxonomy_name/term_slug̶...。
  • Custom Permalinks 》name or slug), add the filter that looks like this:, function yasglobal_exclude_posts( $post ) {, // Replace '2' with ID of the post you want to ...。
  • VK Link Target Controller 》外掛介紹, VK Link Target Controller 外掛可在最近文章列表或存檔頁面中,讓使用者點選文章標題時轉址到其他網頁而非文章內容頁面。, 使用範例, 假設你在 eB...。
  • Title and Nofollow For Links (Classic Editor) 》這個外掛程式在插入連結彈出框中恢復了 WordPress 4.2 中刪除的「Title」欄位,並新增了一個「將連結加上 rel="nofollow"」的勾選框。, Gutengerg(區塊編輯...。
  • Flexy Breadcrumb 》PressTigers 的 Flexy Breadcrumb 是一個簡單而強大的麵包屑導覽系統外掛,適用於 WordPress 網站。使用此外掛,您可以透過 [flexy_breadcrumb] 短碼在網站的...。
  • Nofollow for external link 》這個外掛可以自動為您網站文章、頁面或主題菜單中所有外部連結插入 rel=nofollow 和 target=_blank。, 您也可以設置要排除的域名,選擇不為特定外部連結添加 ...。
  • Link Library 》此外掛用於在您的網站上建立一個頁面,列出 WordPress 管理介面內的 "連結" 部分中所定義的所有連結分類及其內所包含的所有連結。使用者可以選擇是否顯示某些...。
  • Link Juice Keeper 》錯誤 404 ( 找不到頁面 ) 很常見,也是造成搜尋引擎,例如 Google,把網站排名降低的主要原因之一。處理 404 錯誤對於非技術人員來說可能相當複雜。有了這個...。
  • rus to lat advanced 》這款 WordPress 外掛將俄文標題的文件名和連結(從標題中建立)轉換為拉丁字母。俄文標題的文件名和連結在 WordPress 中儲存時經常是不正確的。, 例如,在標...。
  • Custom Meta Widget 》這個外掛的功能和 WordPress 標準的 Meta widget 完全相同,除了它增加了選項來控制要顯示哪些 5 個標準的 Meta widget 連結,並提供一個新增自訂連結的選項...。
  • Autologin Links 》這個外掛讓管理員可以為其 WordPress 網站生成自動登入連結,並以特定使用者名稱登入訪客。管理員可以編輯(生成和刪除)使用者的自動登入連結,而使用者只能...。
  • Track The Click 》追踪點擊次數, Track The Click 外掛能夠幫助網站擁有者更好地了解網站訪客與網站上連結的互動情形。這款外掛主要功能是即時追踪 WordPress 網站上發生的點擊...。
  • Sape – website monetization 》這個外掛程式能夠自動將 Sape 系統的程式碼安裝到網站上。, 這是一個從 Sape 取得利益的網站收益外掛程式。此外掛支援以下的網站收益方式:, , 租借連結, 全...。
  • Ambrosite Next/Previous Post Link Plus 》重要提示:請確保使用正確的外掛程式。, , Next/Previous Post Link Plus 外掛程式適用於單篇文章模板。, Next/Previous Page Link Plus 外掛程式適用於頁面...。

文章
Filter
Apply Filters
Mastodon