Theme: Twenty Sixteen
Wordpress: 4.5.1
Polylang: 1.8.5
Only 3 plugins active: Polylang, Map List Pro (https://codecanyon.net/item/map-list-pro-google-maps-location-directories/2620196)
and my utility “Map List Pro Utility” which adds 2 custom taxonomies, “Markers:” and “Facilities For:” See my code below.
1) Permalinks settings: Plain: https://test.dronietours.com/?p=123
2) I use a static front page
3) Polylang settings:
URL modifications: The language is set from the code in the URL.
Detect browser language: Active.
Media: Active
Custom post types and Taxonomies:
Custom post types: Map locations: Yes
Custom taxonomies:
Location Categories: Yes
Markers: Yes
Facilities for: Yes
Synchronization: None checked
WPML Compatibility: shows grayed out ‘Activated’
Tools: Remove all Polylang data when using the “Delete” link on the plugins screen. Unchecked
Code of my utility “Map List Pro Utility” which adds 2 custom taxonomies, “Markers:” and “Facilities For:”
<?php
/*
Plugin Name: Map List Pro Utility
Description: Adds 2 extra taxonomies, "Markers:" and "Facilities for:", and utilities, to Map List Pro for DronieTours.
Version: 0.32 of 26 April 2016
Author: David Nathan
Text Domain: maplistpro-utility
Domain Path:
Filename: /wp-content/plugins/MapListProUtility/MapListProUtility.php
Language pot file: "/wp-content/plugins/MapListProUtility/maplistpro-utility.pot"
Author: David Nathan
Author URI: DavidNathanCreations.com
License: Same as Map List Pro
*/
/*
"Map List Pro Utility" chosen for Plugin Name as it will then appear directly beneath "Map List Pro" in the plugins page.
PLUGIN DIRECTORY NAME need not match the PLUGIN NAME but MUST match THIS php Filename.
ie. "/wp-content/plugins/MapListProUtility/MapListProUtility.php" note directory and plugin names match
*/
// == Installation ==
// 1) Upload MapListProUtility.php and readme.txt file to the plugins directory "/wp-content/plugins/MapListProUtility/"
// 2) Activate "Map List Pro Utility" via the WP dashboard.
// Hook into the init action and call create_maplist_taxonomies when it fires
add_action( 'init', 'create_maplist_taxonomies', 10 );
// Create 2 extra taxonomies, "Markers:" and "Facilities for:" for the 'maplist' MapListPro category object type
function create_maplist_taxonomies() {
// -------------------- Add new hierarchical taxonomy 'Markers:', like MapListPro categories.
$labels = array(
'name' => _x( 'Markers:', 'taxonomy general name', 'maplistpro-utility' ),
'singular_name' => _x( 'Marker:', 'taxonomy singular name', 'maplistpro-utility' ),
'search_items' => __( 'Search Markers:', 'maplistpro-utility' ),
'all_items' => __( 'All Markers:', 'maplistpro-utility' ),
'parent_item' => __( 'Parent Marker:', 'maplistpro-utility' ),
'parent_item_colon' => __( 'Parent Marker:', 'maplistpro-utility' ),
'edit_item' => __( 'Edit Marker:', 'maplistpro-utility' ),
'update_item' => __( 'Update Marker:', 'maplistpro-utility' ),
'add_new_item' => __( 'Add New Marker:', 'maplistpro-utility' ),
'new_item_name' => __( 'New Marker: Name', 'maplistpro-utility' ),
'menu_name' => __( 'Markers:', 'maplistpro-utility' ),
);
$categoryargsMarkers = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'markers' ),
);
// Max 32 chars for $taxonomy name
register_taxonomy( 'maplist_Markers', array( 'maplist' ), $categoryargsMarkers );
// -------------------- Add new hierarchical taxonomy 'Facilities for:', like MapListPro categories.
$labels = array(
'name' => _x( 'Facilities for:', 'taxonomy general name', 'maplistpro-utility' ),
'singular_name' => _x( 'Facilities for:', 'taxonomy singular name', 'maplistpro-utility' ),
'search_items' => __( 'Search Facilities for:', 'maplistpro-utility' ),
'all_items' => __( 'All Facilities for:', 'maplistpro-utility' ),
'parent_item' => __( 'Parent Facilities for:', 'maplistpro-utility' ),
'parent_item_colon' => __( 'Parent Facilities for:', 'maplistpro-utility' ),
'edit_item' => __( 'Edit Facilities for:', 'maplistpro-utility' ),
'update_item' => __( 'Update Facilities for:', 'maplistpro-utility' ),
'add_new_item' => __( 'Add New Facilities for:', 'maplistpro-utility' ),
'new_item_name' => __( 'New Facilities for: Name', 'maplistpro-utility' ),
'menu_name' => __( 'Facilities for:', 'maplistpro-utility' ),
);
$categoryargsFacilitiesFor = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'facilities-for' ),
);
// Max 32 chars for $taxonomy name
register_taxonomy( 'maplist_FacilitiesFor', array( 'maplist' ), $categoryargsFacilitiesFor );
} // close function create_maplist_taxonomies()
// Create the "maplistpro-utility" Text Domain, and specify that the po and mo language files are in plugin root directory
function my_plugin_load_plugin_textdomain() {
load_plugin_textdomain( 'maplistpro-utility', false, false );
}
add_action( 'plugins_loaded', 'my_plugin_load_plugin_textdomain' );
?>