WordPress plugin intelligence profile

Store Directory

A simple, flexible plugin for keeping a store/location directory and searching for them by radius.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 3.7
Current version0.1
WordPress coverageTested up to WordPress 3.7
Minimum stackWP 3.0 · PHP —
Directory statusactive
Last directory update3 Jan 201412y ago
Active installations10Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 1 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Store Directory version 0.1 as active, updated 12y ago and tested up to WordPress 3.7.

Overview

About this plugin

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 ).

LatLng object and the second is an object with your filtered data. Armed with this data, you can create the marker however you need! 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';
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • google maps
  • directory
  • location
  • store
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 3.7

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 3.7.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to3.7
Minimum requirementsWordPress 3.0 · PHP not listed
Update activity3 Jan 201412y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.