Changes to Note Before Upgrading to Breadcrumb NavXT 5.0

Breadcrumb NavXT 5.0 is very close to being ready for release. Unlike a typical release, quite a bit has changed under the hood this time, hence the bump up from 4.4 to 5.0. Development for 5.0 focused heavily on making Breadcrumb NavXT easier to extend. In doing so, it had to part ways with how some things were done in the past. The following changes are the most likely to affect current Breadcrumb NavXT installs.

Move to PHP5 Object Model

This release features a move to PHP5’s Object Model, including changing the default constructor from the class name (C++ style) to __construct(). All member functions and variables are now explicitly scoped as either private, protected or public. Additionally, some member functions have been explicitly made static (to allow static calling without causing strict warnings in PHP5.4).

Organizational Changes

Several internal changes were made to reorganize the plugin. One change that will affect third party code is the move from bcn_breadcrumb_trail::trail to bcn_breadcrumb_trail::breadcrumbs. For 5.0, bcn_breadcrumb_trail::trail will exist as pointer to the same data held in bcn_breadcrumb_trail::breadcrumbs. In the future bcn_breadcrumb_trail::trail will be removed and it is recommended that existing extension plugins to Breadcrumb NavXT be updated to reflect this internal change.

WordPress Multisite Changes

Support for multisite WordPress installs has changed quite a bit in 5.0. To support the new Network Admin settings page introduced in this version, the way settings are handled in multisite installs has changed. By default the settings set in the ‘Network Admin’ settings page will take priority over individual site preferences. This is different from the pre-5.0 behavior. If you have a multisite install, please read Controlling Breadcrumb NavXT Settings From the Network Settings Page.

-John Havlik

[end of transmission, stay tuned]

Controlling Breadcrumb NavXT Settings From the Network Settings Page

Update 2015-10-30: Updated to reflect the default behavior change in Breadcrumb NavXT 5.3.

Starting with Breadcrumb NavXT 5.0, the oft-requested feature for a Network Settings Page for controlling the setting on all subsites in a WordPress multisite setup is now available. Since now there will be a combination of Network Settings and sub site settings, some extra intelligence is needed to pick settings appropriately. Given that the desired behavior will vary depending on use case, a few new globals have been added to switch between settings behavior modes.

Force Network Settings on All Sites (default behavior for 5.0-5.2)

Versions 5.0 through 5.2 used this mode as the default behavior for settings. In this mode, rather than default to the individual site settings (as they were the only ones that existed in WordPress multisite setups prior to Breadcrumb NavXT 5.0). Note, for 5.0 through 5.2, that all other BCN_* defines must be either not set or set to false to select this mode. Note that in 5.0.1 and later you should manually specify this mode:

define('BCN_SETTINGS_USE_NETWORK', true);

Force Individual Site Settings Only (pre-5.0 behavior, default behavior for 5.3+)

In 5.3 the default behavior was reverted to the pre-5.0 behavior of using only the individual sub site settings for Breadcrumb NavXT in a WordPress Multisite setup. Note, for 5.3 and later, that all other BCN_* defines must be either not set or set to false to select this mode. The following must be placed in your wp-config.php (or site specific plugin):

define('BCN_SETTINGS_USE_LOCAL', true);

Favor Individual Site Settings Over Network Settings

In Breadcrumb NavXT 5.0 this settings will merge the local (individual site’s) settings into the network settings (network settings are the ‘defaults’ for the wp_parse_args function). Use the following to enable this mode:

define('BCN_SETTINGS_FAVOR_LOCAL', true);

Note that the behavior of this mode is subtle and likely will look more like the local (individual site’s) settings than the network settings. In the future this mode may change slightly.

Favor Network Settings Over Individual Site Settings

In Breadcrumb NavXT 5.0 this settings will merge the network settings into the local (individual site’s) settings (local site settings are the ‘defaults’ for the wp_parse_args function). Use the following to enable this mode:

define('BCN_SETTINGS_FAVOR_NETWORK', true);

Note that the behavior of this mode is subtle and likely will look more like the network settings than the local (individual site’s) settings. In the future this mode may change slightly.

-John Havlik

[end of transmission, stay tuned]

Breadcrumb NavXT Title Trixx and Menu Magic

As promised earlier this week, I am announcing the first two Breadcrumb NavXT premium extensions today. They are Breadcrumb NavXT Title Trixx and Breadcrumb NavXT Menu Magic. Both plugins will require Breadcrumb NavXT 5.0, which will be released around the end of September/early October. Purchases will come with 1 year of free updates. Support and pricing has yet to be determined.

Breadcrumb NavXT Title Trixx

Breadcrumb NavXT Title Trixx allows users to specify a custom title for any post’s (as in any post type) breadcrumb. It features integration with All in One SEO Pack, taking the SEO title if it exists. If All in One SEO Pack is not activated on the current WordPress install, an “Alternate Title” meta box will be available on all post edit screens. The initial version of this plugin complete and will be released upon the launch of the Breadcrumb NavXT Extensions Store.

Breadcrumb NavXT Menu Magic

Breadcrumb NavXT Menu Magic allows users to specify a WordPress Menu for Breadcrumb NavXT to follow for both titles and hierarchy for resources (posts, taxonomy terms, archives, etc). If the current item is not found in the menu, Breadcrumb NavXT will fall back to its default behavior. This extension is currently in development, an initial proof of concept is functional, however a bit of work is still required. As with Breadcrumb NavXT Title Trixx, Breadcrumb NavXT Menu Magic will be available upon the launch of the Breadcrumb NavXT Extensions Store.

-John Havlik

[end of transmission, stay tuned]

Breadcrumb NavXT Hits One Million Downloads

Back on Thursday evening, Breadcrumb NavXT hit one million downloads on the WordPress.org plugin repository. This is the total number of downloads since it was first introduced in the plugin repository almost six years ago. Not many plugins have hit this milestone, and it is exciting to have written something that has been downloaded a million times. At this juncture, it seems appropriate to reveal my vision for the future of Breadcrumb NavXT.

The Future

Breadcrumb NavXT 5.0, is functionally ready for testing. Only some polishing and documentation is left before it is ready for release. The reason for skipping versions 4.5 through 4.9 is the fact that a substantial reorganization of the plugin has occurred for this version. The changes should make Breadcrumb NavXT more flexible, and were necessary to implement an Network Admin settings page. Expect to see 5.0 near the beginning of October.

Currently, the plans for 5.1 are a little open, though it is likely it will contain several tweaks that fix issues that have been punted for some time. See the issue list on GitHub for Breadcrumb NavXT milestone 5.1. Additionally, for 5.1 the introduction of a more formal regression/unit test suite is likely to happen. As for a release date, sometime between the end of December 2013 and mid January 2014 is the target release time-frame.

Something New

There are several features that groups of users have wanted Breadcrumb NavXT to have for quite some time. While introduction of these features into the main plugin has been resisted—and will continue to be resisted—going forward many of these features will make their way into premium add-on plugins.

These features have enough demand to warrant an add-on plugin, but are not applicable to the majority of use cases for Breadcrumb NavXT. To service this demand, beginning in September, a handful of premium add-on plugins will be released for Breadcrumb NavXT to add functionality. Take a look at how Easy Digital Downloads is run, that is the model that will be used here. More information on this will be made available later this week.

-John Havlik

[end of transmission, stay tuned]

How to Add li and Other Tags to Breadcrumb Templates

Since Breadcrumb NavXT 4.3.0, all settings that can contain HTML are passed through wp_kses(). With this change, only a basic set of acceptable tags and properties within tags were allowed. Naturally, this restricted users more than they were used to. The restriction wasn’t the biggest problem, the lack of a filter to allow users to add their own tags in to the allowed HTML tag list. However, with Breadcrumb NavXT 4.4, a new filter bcn_allowed_html has been introduced to fix this issue.

The default set of allowed HTML tags in Breadcrumb NavXT 4.4 consists of: <a>, <img>, <span>, <h1>, and <h2>. For the purposes of this guide, let’s assume you don’t want to use the built in bcn_display_list() function to output breadcrumbs wrapped in <li> tags. The reason you would want to do this is if you need additional properties within the tag (Breadcrumb NavXT will by default add a class but that’s it).

In Breadcrumb NavXT 4.4, adding a tag to the allowed HTML list for Breadcrumb NavXT is really easy. Just create a function with one input argument ($allowed_html in this example). Within that function append, using the HTML tag name as the array entry key, assign an array of properties that tag is allowed to have, using the property name as the array entry key and a value of true. Then add your filter function to the ‘bcn_allowed_html’ filter hook. Below is an example of this for the <li> tag with a selection of properties.

function my_bcn_allowed_html($allowed_html)
{
	$allowed_html['li'] = array(
		'title' => true,
		'class' => true,
		'id' => true,
		'dir' => true,
		'align' => true,
		'lang' => true,
		'xml:lang' => true,
		'aria-hidden' => true,
		'data-icon' => true,
		'itemref' => true,
		'itemid' => true,
		'itemprop' => true,
		'itemscope' => true,
		'itemtype' => true
	);
	return $allowed_html;
}
add_filter('bcn_allowed_html', 'my_bcn_allowed_html');

To get started quickly, just copy and paste the above code into a site specific plugin and start playing.

-John Havlik

[end of transmission, stay tuned]