這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Geolocator

外掛說明

Get website visitor’s location based on IP address and show/hide specific content depending on country.

Meta box

You can hide post for particular country by filling “Hide for” field in custom meta box in post’s edit screen. That way the post will not be included to the loop and other parts of the website.

Shortcodes

Country

The most basic shortcode of the plugin is [geolocator] which displays country of the visitor.

Show

You can show some specific content for particular country by using [geolocator_show] shortcode. See example below.

[geolocator_show for="US"]This information is being shown to visitors from United States only.[/geolocator_show]

The shortcode accepts “for” attribute. It should be a 2-letter ISO code of the country you want to show the content for.

Hide

You can hide some specific content for particular country by using [geolocator_hide] shortcode. See example below.

[geolocator_hide for="US"]This information is NOT being shown to visitors from United States.[/geolocator_hide]

The shortcode accepts “for” attribute. It should be a 2-letter ISO code of the country you want to hide the content for.

Widget

You can display country of the visitor by using Geolocator’s widget. It allows you to choose a custom text.

Credits

This plugin includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.

螢幕擷圖

  • Shortcodes of the plugin in post’s edit screen.
  • Shortcodes displayed in the listing of theme.
  • Custom meta box that allows to hide post for country.
  • Simple widget that displays country of the visitor.
  • Plugin settings, it allows to set fallback IP.

使用者評論

2019 年 11 月 8 日 1 則留言
This plugin relies on data from a third party. That third party says they discontinued the data on 2 January 2019. A pity: it looked quite good.
2018 年 3 月 2 日
Nice plugin, simple to use and get’s the job done.
閱讀全部 4 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Geolocator〉的開發相關工作。

參與者

將〈Geolocator〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1

  • Refactored framework of the plugin, it’s now more future-proof;
  • Changed data source to GeoLite-Country database by MaxMind;
  • Created shortcodes, widget and custom post meta box.

1.0.1

  • Depreciated Telize API provider since it does not work anymore;
  • Improved the code style to match more the one defined in Codex.