Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jsrobillard

    (@jsrobillard)

    Thanks for the input.
    I’ve added the filter.

    Here’s the code for reference.
    Added in theme’s function.php file.

    /**
     * breadcrumb_NavXT_WPML_duplicate_taxonomies_patch
     *
     * Using WPML, when taxonomies are spelled exactly the same in 2 languages (i.e. "documents"), WPML appends @language to the taxonomy name.
     * This filter strips it from the displayed name.
     *
     * @param string $title The title.
     * @return string The title stripped of @language.
     */
    function breadcrumb_NavXT_WPML_duplicate_taxonomies_patch( $name ){
    	$name = str_replace('@'.ICL_LANGUAGE_CODE, '', $name);
    	return $name;
    }
    add_filter('bcn_breadcrumb_title', 'breadcrumb_NavXT_WPML_duplicate_taxonomies_patch');

    Thanks again.

    Thread Starter jsrobillard

    (@jsrobillard)

    Actually, I’ve switched my patch to the constructor in:

    /breadcrumb_navxt/class.bnc_breadcrumb.php (line: 57)

    //Set the title
    $this->set_title(str_replace('@'.ICL_LANGUAGE_CODE, '', $title));

    Probably a better place… What do you think?

Viewing 2 replies - 1 through 2 (of 2 total)