Customizing the Separator Based on Position Within Breadcrumb Trail

With Breadcrumb NavXT 7.0, updates to the internals of the plugin added support for more than a single dimension for the breadcrumb trail, allowing portions of the plugin to be cleaned up. As a consequence, non-hierarchical terms now are separated by an actual separator that is controllable. While this separator was not exposed in the settings page, Breadcrumb NavXT 7.2 introduced the bcn_display_separator filter which allows us to control the breadcrumb separator.

The combination of these two features allows new breadcrumb trails that were only possible with lists and CSS in the past. Which, while a valid method, can be a little clunky.

An Example

Suppose the site design requires changing the last separator for non-hierarchical terms (e.g. tags) from the default , to & resulting in a breadcrumb trail for an example post to look like:

Home > Blog > Tag 1, Tag 2 & Tag 3 > Awesome Post

To accomplish this, the bcn_display_separator filter can be used to dynamically replace the separator. Below is an example implementation that does just that:

add_filter('bcn_display_separator', my_bcn_separator, 10, 4);
function my_bcn_separator($separator, $position, $last_position, $depth)
{
    //On the 2nd level and lower, change the last separator to an ampersand
    if($depth > 1 && $position == $last_position - 1)
    {
        return ' & ';
    }
    return $separator;
}

This code will, for any breadcrumb that is beyond the first dimension/level (indicated by $depth) set the separator to & before the final breadcrumb in that dimension/level. Using this code is straightforward, just place it in a site specific plugin (and activate the site specific plugin if it isn’t already active). Naturally, the example code can be modified to use a different separator and to target different positions within the breadcrumb trail, should that be required.

-John Havlik

Breadcrumb NavXT Premium Extensions 2023Q1 Update Sweep

Announcing a minor update to all of the Breadcrumb NavXT premium extensions. This update features a couple of changes to the admin licensing manger. Previously, several of the response messages were incorrect and have been fixed (in many cases several, incorrect messages were displayed). Additionally, a “force key deactivation” method for situations where the site has been migrated to a new URL and key deactivation fails was added.

Users with valid and activated license keys should receive an update notification within the WordPress dashboard and be able to use the update mechanism to update (just like with any plugin in the WordPress.org repository). If you run into any issues, please open a support ticket.

-John Havlik

Breadcrumb NavXT Menu Magic 2.3

Introducing Breadcrumb NavXT Menu Magic 2.3. This release changes the way the menu used for the breadcrumb trail is selected. Since this plugin’s inception, there has been a “Use Menu” setting under the Menu Magic section of the Breadcrumb NavXT settings page. Starting with version 2.3, this setting has been deprecated. In its place, a new menu location is now registered by Menu Magic, the Breadcrumb NavXT Menu Magic Menu location.

Now, to select the menu for Breadcrumb NavXT to use for generating the breadcrumb trail, visit the WordPress Menu editor. Select the menu you wish to use, and near the bottom of the page in the Menu Settings, make sure for the Display location “Breadcrumb NavXT Menu Magic Menu” is checked.

Lastly, some changes were made to the admin licensing manger. Several of the response messages were previously incorrect and have been fixed. Additionally, a “force key deactivation” method for situations where the site has been migrated to a new URL and key deactivation fails was added.

Users with valid and activated license keys should receive an update notification within the WordPress dashboard and be able to use the update mechanism to update (just like with any plugin in the WordPress.org repository). If you run into any issues, please open a support ticket.

-John Havlik

Breadcrumb NavXT Premium Extensions 2022 Update Sweep

Announcing a minor update to all of the Breadcrumb NavXT premium extensions. This update fixes a bug introduced when support for Breadcrumb NavXT 7.0 was added. An error was introduced which caused an empty menu entry to be added to the WordPress dashboard menu (when using Breadcrumb NavXT 7.0 or newer). This has been fixed in the update released today for each of the premium extensions.

Users with valid and activated license keys should receive an update notification within the WordPress dashboard and be able to use the update mechanism to update (just like with any plugin in the WordPress.org repository). If you run into any issues, please open a support ticket.

-John Havlik

Updates to the BCN_SETTINGS_FAVOR_* Constants Behavior

Beginning with Breadcrumb NavXT 7.1, the behavior of the BCN_SETTINGS_FAVOR_NETWORK and BCN_SETTINGS_FAVOR_LOCAL constants are changing. Previously, while both would try to favor their respective settings (local vs network), the resulting settings did not differ significantly from the BCN_SETTINGS_USE_* counterparts. Since Breadcrumb NavXT 7.0 changed to storing only non-default settings to the database, it made sense to update the logic behind the two BCN_SETTINGS_FAVOR_* constants.

In Breadcrumb NavXT 7.1, BCN_SETTINGS_FAVOR_LOCAL merges the local site settings (stored in the database) into the network settings, which, in turn, are merged into the default setting values. This results in a behavior where non-default values for local site settings will override the corresponding network settings.

Similarly, in Breadcrumb NavXT 7.1, BCN_SETTINGS_FAVOR_NETWORK merges the network settings (stored in the database) into the local settings, which, in turn, are merged into the default setting values. This results in a behavior where non-default values for network settings will override the corresponding local site settings.

In summary, Breadcrumb NavXT 7.1 implements changes to the BCN_SETTINGS_FAVOR_* constants that make them behave in a more logical and useful manner.

-John Havlik