{"id":37028,"date":"2015-06-18T08:21:12","date_gmt":"2015-06-18T08:21:12","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/css-flags\/"},"modified":"2016-12-18T12:39:15","modified_gmt":"2016-12-18T12:39:15","slug":"css-flags","status":"publish","type":"plugin","link":"https:\/\/fa.wordpress.org\/plugins\/css-flags\/","author":3803,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.3.0","stable_tag":"0.3.0","tested":"4.7.33","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"CSS Flags","header_author":"Per Soderlind","header_description":"","assets_banners_color":"956f76","last_updated":"2016-12-18 12:39:15","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/soderlind.no\/donate\/","header_plugin_uri":"https:\/\/github.com\/soderlind\/css-flags","header_author_uri":"http:\/\/soderlind.no","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1942,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1183216","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1183216","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1462188","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1462188","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["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"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1431,537],"plugin_category":[],"plugin_contributors":[78884],"plugin_business_model":[],"class_list":["post-37028","plugin","type-plugin","status-publish","hentry","plugin_tags-header","plugin_tags-link","plugin_contributors-pers","plugin_committers-pers"],"banners":{"banner":"https:\/\/ps.w.org\/css-flags\/assets\/banner-772x250.png?rev=1462188","banner_2x":"https:\/\/ps.w.org\/css-flags\/assets\/banner-1544x500.png?rev=1462188","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/css-flags\/assets\/icon-128x128.png?rev=1183216","icon_2x":"https:\/\/ps.w.org\/css-flags\/assets\/icon-256x256.png?rev=1183216","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>The CSS Flags plugin \/ library for WordPress loads a dynamicaly created CSS with responsive flags.<\/p>\n\n<p><strong>Note:<\/strong> CSS Flags is not a standalone plugin\/library, To display the flags you will have to <a href=\"https:\/\/github.com\/soderlind\/css-flags\/#example-1\">add code to your theme<\/a> using your own plugin or theme functions.php<\/p>\n\n<p>You can <a href=\"https:\/\/soderlind.no\/css-flags-plugin-for-wordpress\/\">view the flags at my site<\/a><\/p>\n\n<p>Sample CSS:<\/p>\n\n<pre><code>.css-flag.sami {\n    background-image: url('data:image\/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHZlcnNpb249IjEuMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAyMCIgaGVpZ2h0PSIxNTAwIj48cmVjdCB3aWR0aD0iNjQ1IiBoZWlnaHQ9IjE1MDAiIGZpbGw9IiNkODFlMDUiLz48cmVjdCB4PSI2NDUiIHdpZHRoPSIxNDAiIGhlaWdodD0iMTUwMCIgZmlsbD0iIzAwN2EzZCIvPjxyZWN0IHg9Ijc4NSIgd2lkdGg9IjE0MCIgaGVpZ2h0PSIxNTAwIiBmaWxsPSIjZmNkMTE2Ii8+PHJlY3QgeD0iOTI1IiB3aWR0aD0iMTA5NSIgaGVpZ2h0PSIxNTAwIiBmaWxsPSIjMDAzOGE4Ii8+PHBhdGggZD0iTSA3ODUsMzEwIGEgNDQwIDQ0MCAwIDAgMCAwLDg4MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAzOGE4IiBzdHJva2Utd2lkdGg9IjgwIi8+PHBhdGggZD0iTSA3ODUsMzEwIGEgNDQwIDQ0MCAwIDAgMSAwLDg4MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDgxZTA1IiBzdHJva2Utd2lkdGg9IjgwIi8+PC9zdmc+');\n    height: 100%;\n    width: 134.666666667%;\n    background-size: 100% 100%;\n}\n.css-flag.sami-landscape {\n    height: 100%;\n    width: 134.666666667%;\n}\n.css-flag.sami-portrait {\n    height: 74.2574257426%;\n    width: 100%;\n}\n<\/code><\/pre>\n\n<h4>Usage<\/h4>\n\n<p>The total CSS file size is 4 MB, and you don't want to send all that data back to the users, so you <strong>must<\/strong> use one of the following filters in your plugin or theme.<\/p>\n\n<p><strong>css_flags_countries<\/strong>: Load flags for one or more countries<\/p>\n\n<pre><code>add_filter('css_flags_countries', function() {\n    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\n});\n<\/code><\/pre>\n\n<p><strong>css_flags_regions<\/strong>: Load the flags for one or more regions. You can choose between europe, oceania, africa, asia, northamerica, southamerica and middleeast.<\/p>\n\n<pre><code>add_filter('css_flags_regions', function() {\n    return array('europe'); \/\/europe, oceania, africa, asia, northamerica, southamerica, middleeast\n});\n<\/code><\/pre>\n\n<p><strong>css_flags_exclude<\/strong>: Exclude some countries from the list. This filter must be used in combination with the <code>css_flags_countries<\/code> or <code>css_flags_regions<\/code> filters<\/p>\n\n<pre><code>add_filter('css_flags_exclude', function() {\n    return array('eu');\n});\n<\/code><\/pre>\n\n<p><strong>css_flags_cachetime<\/strong>: Change the cache time, default it's 7200 (60x60x2 = 2 hours)<\/p>\n\n<pre><code>add_filter('css_flags_cachetime', function() {\n    return 172800; \/\/ 2 days\n});\n<\/code><\/pre>\n\n<p>If you must (but you shouldn't), you can load all the  CSS flags using the following:<\/p>\n\n<pre><code>add_filter('css_flags_countries', function() {\n    return array('all'); \/\/ load all country flags (don't it's 4MB)\n});\n<\/code><\/pre>\n\n<p>More information at <a href=\"https:\/\/github.com\/soderlind\/css-flags\/\">GitHub<\/a><\/p>\n\n<h4>Credits<\/h4>\n\n<p>The original CSS file is from http:\/\/www.phoca.cz\/cssflags\/. If you only need the CSS file, grab it there.<\/p>\n\n<!--section=installation-->\n<h4>Plugin<\/h4>\n\n<ol>\n<li>Download the latest stable release<\/li>\n<li>Add and activate it. This will load the CSS (4 MB) and cache it using the <a href=\"https:\/\/codex.wordpress.org\/Transients_API\">WordPress Transients API<\/a>. The default cache time is 7200. The cache time can be changed using the  <code>css_flags_cachetime<\/code> filter.<\/li>\n<li>Add one of the filters, see <strong>Usage<\/strong> above, to your plugin or (child) themes functions.php<\/li>\n<\/ol>\n\n<h4>Theme<\/h4>\n\n<ol>\n<li>Extract the plugin in your (child) theme folder:<\/li>\n<li><p>Add the following to your (child) theme functions.php<\/p>\n\n<pre><code>require_once(dirname(__FILE__) . '\/css-flags\/css-flags.php');\n<\/code><\/pre><\/li>\n<li><p>Add one of the filters, see <strong>Usage<\/strong> above, to your  (child) themes functions.php<\/p><\/li>\n<\/ol>\n\n<p>To get you started, here'a a <a href=\"https:\/\/github.com\/soderlind\/css-flags\/blob\/master\/sample-theme-functions.php\">sample theme functions.php<\/a><\/p>\n\n<!--section=changelog-->\n<h4>0.3.0<\/h4>\n\n<ul>\n<li><strong>NOTE<\/strong> You need to update your code, all filters have changed (changed dash to underscrore): <code>css_flags_countries<\/code>, <code>css_flags_regions<\/code>, <code>css_flags_exclude<\/code> and <code>css_flags_cachetime<\/code>.<\/li>\n<\/ul>\n\n<h4>0.2.2<\/h4>\n\n<ul>\n<li>Tested &amp; found compatible with WP 4.7.<\/li>\n<\/ul>\n\n<h4>0.2.1<\/h4>\n\n<ul>\n<li>Tested &amp; found compatible with WP 4.6.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>Update plugin to WordPress Coding Standards.<\/li>\n<\/ul>\n\n<h4>0.1.8<\/h4>\n\n<ul>\n<li>Added uninstall.php, which removes transients and options when you uninstall the plugin<\/li>\n<\/ul>\n\n<h4>0.1.4<\/h4>\n\n<ul>\n<li>Added the <a href=\"https:\/\/soderlind.no\/css-flags-plugin-for-wordpress\/#rainbow\">Rainbow (LGBT)<\/a> flag<\/li>\n<\/ul>\n\n<h4>0.1.3<\/h4>\n\n<ul>\n<li>Rewrote the plugin<\/li>\n<\/ul>\n\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Added the <a href=\"https:\/\/soderlind.no\/css-flags-plugin-for-wordpress\/#sami\">Sami<\/a> flag<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Added CSS prefix .css-flag<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"More than 250 vector based flags for WordPress","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/37028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=37028"}],"author":[{"embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/pers"}],"wp:attachment":[{"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=37028"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=37028"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=37028"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=37028"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=37028"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/fa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=37028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}