前言介紹
- 這款 WordPress 外掛「Store Directory」是 2014-01-01 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2014-01-03,距離現在已有 4139 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
mboynes |
外掛標籤
maps | store | location | directory | Google Maps |
內容簡介
這個外掛會在你的 WordPress 網站上添加商店/地點目錄。一旦加入商店,你可以在部件區域添加「商店搜尋」部件,或者手動在主題中添加表單。
這個外掛被特意保持輕量和簡單。它非常靈活,旨在成為你可以構建的東西。
過濾器
wpsd_radius_options
參數:array( 5, 10, 25, 50, 100 )
這個過濾器允許你修改商店搜尋表單中半徑下拉列表中的選項。默認按英里計算距離。
wpsd_register_post_type
參數:true
這個過濾器允許你完全禁用「store」文章類型。要這樣做,只需在主題或外掛中添加 add_filter( 'wpsd_register_post_type', '__return_false' )。
wpsd_post_type_args
這個過濾器讓你有能力修改傳遞給「store」文章類型的 register_post_type() 參數。在 Codex 中查看 register_post_type 的有效參數和值。
參數:
array(
'public' => true,
'has_archive' => true,
'supports' => array( 'title' ),
'labels' => array(
'name' => __( 'Stores', 'store-directory' ),
'singular_name' => __( 'Store', 'store-directory' ),
'all_items' => __( 'Stores', 'store-directory' ),
'new_item' => __( 'New store', 'store-directory' ),
'add_new' => __( 'Add New', 'store-directory' ),
'add_new_item' => __( 'Add New store', 'store-directory' ),
'edit_item' => __( 'Edit store', 'store-directory' ),
'view_item' => __( 'View store', 'store-directory' ),
'search_items' => __( 'Search stores', 'store-directory' ),
'not_found' => __( 'No stores found', 'store-directory' ),
'not_found_in_trash' => __( 'No stores found in trash', 'store-directory' ),
'parent_item_colon' => __( 'Parent store', 'store-directory' ),
'menu_name' => __( 'Stores', 'store-directory' ),
)
)
wpsd_automap
參數:true
默認情況下,使用 'loop_start' 操作在商店存檔視圖和商店單一視圖中添加 Google 地圖。如果你多次循環遍歷文章,這可能不是所有情況下都理想的。要禁用它,只需在主題或外掛中添加 add_filter( 'wpsd_automap', '__return_false' )。如果你選擇禁用它,請參閱 wpsd_the_map() 模板標籤以手動顯示地圖。
wpsd_mappable_data
參數:
array(
'name' => $post->post_title,
'address' => get_post_meta( $post->ID, 'address', true ),
'latitude' => $post->latitude,
'longitude' => $post->longitude,
'distance' => $post->distance
)
參數:$post
這個過濾器允許你自定義地圖中使用的數據。還有一個與此過濾器配合使用的 JavaScript「掛勾」,wpsd_custom_create_marker。要使用透過 wpsd_mappable_data 過濾器傳遞的數據,你需要定義一個 JavaScript 函數:wpsd_custom_create_marker( latlng, data )。這個函數應該帶有兩個參數,其中第一個是一個 google.maps.LatLng 對象,第二個是帶有過濾後數據的對象。
原文外掛簡介
This plugin adds a store/location directory to your WordPress site. Once you add stores, you can add the Store Search widget to your widget area or you can add the form to your theme manually.
This plugin is intentionally light and simple. It’s very flexible and is intended to be something on which you can build.
Filters
wpsd_radius_options
Param: array( 5, 10, 25, 50, 100 )
This filter allows you to modify the options in the radius dropdown in the store search form. Values are in miles by default.
wpsd_register_post_type
Param: true
This filter allows you to disable the store post type altogether. To do so, simply add add_filter( 'wpsd_register_post_type', '__return_false' ) to your theme or plugin.
wpsd_post_type_args
This filter gives you the ability to modify the arguments passed to register_post_type() for the ‘store’ post type. See register_post_type in the Codex for valid arguments and values.
Param:
array(
'public' => true,
'has_archive' => true,
'supports' => array( 'title' ),
'labels' => array(
'name' => __( 'Stores', 'store-directory' ),
'singular_name' => __( 'Store', 'store-directory' ),
'all_items' => __( 'Stores', 'store-directory' ),
'new_item' => __( 'New store', 'store-directory' ),
'add_new' => __( 'Add New', 'store-directory' ),
'add_new_item' => __( 'Add New store', 'store-directory' ),
'edit_item' => __( 'Edit store', 'store-directory' ),
'view_item' => __( 'View store', 'store-directory' ),
'search_items' => __( 'Search stores', 'store-directory' ),
'not_found' => __( 'No stores found', 'store-directory' ),
'not_found_in_trash' => __( 'No stores found in trash', 'store-directory' ),
'parent_item_colon' => __( 'Parent store', 'store-directory' ),
'menu_name' => __( 'Stores', 'store-directory' ),
)
)
wpsd_automap
Param: true
By default, a Google Map is added to the store archive views and store singular views using the 'loop_start' action. This may not be desirable in all circumstances, especially if you loop through your posts multiple times. To disable this, add add_filter( 'wpsd_automap', '__return_false' ) to your theme or plugin. If you choose to disable this, see the wpsd_the_map() tempalte tag to manually display the map.
wpsd_mappable_data
Param:
array(
'name' => $post->post_title,
'address' => get_post_meta( $post->ID, 'address', true ),
'latitude' => $post->latitude,
'longitude' => $post->longitude,
'distance' => $post->distance
)
Param: $post
This filter allows you to customize the data used in the map. There is also a javascript “hook” that works in tandem with this, wpsd_custom_create_marker. To use the data you pass through the wpsd_mappable_data filter, you need to define a javascript function, wpsd_custom_create_marker( latlng, data ). This function should take two params, where the first is a google.maps.LatLng object and the second is an object with your filtered data. Armed with this data, you can create the marker however you need! See js/maps.js:wpsd_create_marker() for an example of how to create a marker.
Template Tags
wpsd_the_store_search_form()
Output the store search form. If you choose not to use the provided widget, this lets you add the form wherever you’d like.
wpsd_the_map()
Param: $posts array An array of posts to map. Each entry in the array should contain the following keys:
'name' => The marker title.
'address' => The marker address.
'latitude' => The latitude of the point.
'longitude' => The longitude of the point.
'distance' => The distance of the point from the center (optional, not presently used).
See WPSD_Search::get_mappable_data() for an example.
Param: $lat float The latitude of the center point for the map.
Param: $long float The longitude of the center point for the map.
Output a Google Map with the given points (posts) centered around the given latitude and longitude.
Other Notes for Developers
Beyond the above, pretty much everything in this plugin is modifiable by editing the properties of the singleton classes. Here are some examples:
To change the post type, e.g. to be 'location' instead of store, you can set it by calling WPSD_Post_Type()->post_type = 'location'; from your theme or plugin (ideally during after_setup_theme at a priority higher than 10).
To change the units from miles to kilometers, WPSD_Post_Type()->units = 'km';
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Store Directory」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
WP Go Maps (formerly WP Google Maps) 》這是一款易於使用的 Google 地圖和 Open Layers 地圖外掛程式(包括地圖區塊)!, 使用提供的短代碼,快速輕鬆地向 WordPress 文章和/或頁面添加自定義 Googl...。
Snazzy Maps 》Snazzy Maps可以輕鬆地為您現有的 Google 地圖添加風格。, 功能特色, , 瀏覽數百種免費風格。, 快速應用風格到您的 WordPress 網站上所有的 Google 地圖。, ...。
MapPress Maps for WordPress 》MapPress 是將互動式 Google 和 Leaflet 地圖添加到 WordPress 網站的最簡單方法。, 使用 Gutenberg 區塊或傳統編輯器創建無限的地圖和標記。彈出式地圖編輯...。
Image Hotspot by DevVN 》Image Hotspot by DevVN 可以幫助您在圖片上添加熱點。, 使用方法, 複製您的短代碼以查看,例如:[devvn_ihotspot id=”YOUR_ID”], , jQuery 插件...。
YaMaps for WordPress Plugin 》YaMaps外掛是在你的網站上插入Yandex地圖的最簡單方式。該外掛具有用戶友好的界面。您可以在Yandex地圖上視覺化地放置標記,用鼠標移動它們,更改圖標等等。,...。
Maps Plugin using Google Maps for WordPress – WP Google Map 》WordPress 的谷歌地圖外掛, , WordPress 的谷歌地圖使用手冊, 如何在 WordPress 網站中使用谷歌地圖, , WP Google Map 是一個很棒的外掛,可以在你的網站新增...。
Flexible Map 》Flexible Map 允許您通過簡單的短代碼將 Google 地圖添加到 WordPress 網站中。, 功能, , 三種加載地圖的方式:, , 通過中心座標, 通過街道地址, 通過指向 Go...。
10Web Map Builder for Google Maps 》10Web Google Maps 建立者, 示範, 使用者指南, 10Web Google Maps 建立者為你提供了質量和簡單性的結合,輕鬆地為你的網站添加無限的地圖。它是一個開箱即用...。
Mihdan: Elementor Yandex Maps 》這款 Elementor Yandex Maps 外掛可以協助您建立符合 SEO 標準的地圖。這款外掛支援不同的地圖類型(路線圖/衛星圖/混合圖/地形圖)和自訂地圖樣式,輕鬆地在...。
Map Multi Marker 》這個外掛是最簡單、有用和強大的 Google 地圖外掛!可輕鬆建立無數數量的 Google 地圖和標記點。有很多選項可供選擇,讓您完全自由地自訂地圖和標記點。, , ...。
HTML5 Maps 》在您的 WordPress 網站上放置一個互動性高的 HTML5 地圖吧!選擇預定義的地圖,包括世界、美國、英國、法國、德國、意大利等多個國家和地區。持續添加新版圖...。
WP GPX Maps 》這個外掛的輸入是包含使用者運動軌跡的 GPX 檔案,輸出則顯示軌跡地圖和互動式高度圖表((若有))。, 完全可配置:, , 自訂顏色, 自訂圖示, 多種語言支援, ...。
Very Simple Google Maps 》大多數網站都必須添加嵌入式Google地圖。我已經創建了一個簡單的方法,只需使用簡單的短代碼即可添加您的地圖。儘管名稱上有些功能,但這款外掛具有簡單而強...。
Simple Shortcode for Google Maps 》簡單易用卻功能強大的 Google 地圖外掛程式!評價中說這是「最佳 Google 地圖短代外掛程式」。, 這款外掛程式可讓您透過簡易的短代,在 WordPress 文章和頁面...。
Oi Yandex.Maps for WordPress 》注意!, 當您升級外掛到版本3.1.6時,它將被停用並顯示“找不到檔案”的錯誤 - 別擔心,只需重新啟用該外掛程式,...。