• Resolved Menumaster1

    (@menumaster1)


    Hi, this is my first post.

    I am making my site multilingual. I have read and followed the excellent Polylang – Getting started documentation. Everything is very well explained there – thank you!

    I then searched the support forum, for my issues listed below, but did not find anything relevant. The search term I used was:

    “custom taxonomies” “Plugin: polylang”.

    Please see this page on my test site .

    I created a utility plugin that adds two custom taxonomies to the Map List Pro plugin. Using my utility plugin approach eliminates the need to edit the functions.php file of the theme.

    My 3 issues are:

    1) An extra, spurious, “blank titled” dropdown between “Languages” and “Markers:” below the map has been added by Polylang. If you click to open the dropdown, you will see a “pll_5712aecdbca9f” item. The “Languages” and “blank titled” dropdowns disappear when I deactivate Polylang.

    2) You can switch between English and French at the top of the page, and the “Markers” and “Facilities For:” lists below the map change languages, but the titles “Markers” and “Facilities For:” remain the same.

    3) The languages selection below the map was added by Polylang, does nothing, and is redundant, because of the functioning language switcher in the header, so I would like to remove it.

    I would appreciate some guidance on how to fix these issues, as I get on fine with Polylang, and wish to continue using it. Cheers, David

    https://www.ads-software.com/plugins/polylang/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Menumaster1

    (@menumaster1)

    Whoops – something went wrong with the link tags: My site is

    Thread Starter Menumaster1

    (@menumaster1)

    3rd try:

    Thread Starter Menumaster1

    (@menumaster1)

    4th try. remove spaces from: “test dronietours .com”

    Thread Starter Menumaster1

    (@menumaster1)

    P.S. The issues are identical with all the many themes I have tried…

    Thread Starter Menumaster1

    (@menumaster1)

    5th try – sorry – “test dot dronietours dot com”

    Thread Starter Menumaster1

    (@menumaster1)

    P.P.S Polylang version is latest: 1.8.5

    Thread Starter Menumaster1

    (@menumaster1)

    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' );
    
    ?>
    Thread Starter Menumaster1

    (@menumaster1)

    Ignore the code of my plugin above.

    I have updated the https://test.dronietours.com/ site to have just 2 plugins, Polylang and Map List Pro https://codecanyon.net/item/map-list-pro-google-maps-location-directories/2620196.

    The spurious “blank” taxonomy is only present when Polylang is activated.

    Thread Starter Menumaster1

    (@menumaster1)

    Problem workaround

    The two unwanted taxonomies introduced by Polylang were ‘language’ and ‘post_translations’. I filtered these out and the problem was resolved.

    Thread Starter Menumaster1

    (@menumaster1)

    This was the code I used to suppress the unwanted taxonomies:

    if('language' == $taxonomytouse->name){ continue ;}
       if('post_translations' == $taxonomytouse->name){ continue ;}

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Spurious taxonomy added by Polylang?’ is closed to new replies.