Skip to content

Google Maps field type for Custom Metaboxes and Fields for WordPress

Notifications You must be signed in to change notification settings

mustardBees/cmb_field_map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMB Field Type: Google Maps

Description

Google Maps field type for CMB2.

Running an older version of CMB? Check the previous releases.

The pw_map field stores the latitude/longitude values which you can then use to display a map in your theme.

Installation

You can install this field type as you would a WordPress plugin:

  1. Download the plugin
  2. Place the plugin folder in your /wp-content/plugins/ directory
  3. Activate the plugin in the Plugin dashboard

Alternatively, you can place the plugin folder in with your theme/plugin. After you call CMB:

require_once 'init.php';

Add another line to include the cmb-field-map.php file. Something like:

require_once 'cmb_field_map/cmb-field-map.php';

Usage

pw_map - Save a location on a map. Example:

array(
	'name' => 'Location',
	'desc' => 'Drag the marker to set the exact location',
	'id' => $prefix . 'location',
	'type' => 'pw_map',
	'sanitization_cb' => 'pw_map_sanitise',
),

Screenshot

Image

About

Google Maps field type for Custom Metaboxes and Fields for WordPress

Resources

Stars

Watchers

Forks

Packages

No packages published