Deprecation Notice: bcn_breadcrumb::title_trim

While the “The Max Breadcrumb Length” setting has been deprecated since Breadcrumb 5.2 (back in 2015), to date, it has not been removed, nor has the underlying code that it controls. The official recommended replacement for this functionality is to use CSS styling to limit the displayed length of the breadcrumbs. This solution is more flexible, and does not have the numerous drawbacks of bcn_breadcrumb::title_trim(), the function behind “The Max Breadcrumb Length” setting.

Beginning with Breadcrumb NavXT 7.0, using CSS is the only supported way to limit the displayed length of the breadcrumbs in the breadcrumb trail. All internal calls to bcn_breadcrumb::title_trim() will be removed, leaving the function itself orphaned and slated for removal in the future. Below is the anticipated timeline of events for the feature’s deprecation through removal.

Timeline

  • v5.2 (2015) through v6.6 (2020) Sunset Period: Upon deprecation, the setting was moved to the Deprecated section at the bottom of the Miscellaneous tab on the Breadcrumb NavXT settings page. Additionally, a warning message has displayed in the Breadcrumb NavXT settings page pointing to the deprecated setting in question, and linking to an article on the recommended alternate. Calls to bcn_breadcrumb::title_trim() throw deprecated function PHP warnings.
  • v7.0 (2021) Lockout Period: The warning on the settings page will now be an error message. The “The Max Breadcrumb Length” setting will be disabled for all users that have not already set it. The value will not be allowed to be changed via the settings interface (except disabling the feature). Additionally, the setting will no longer impact the behavior of bcn_display(). The bcn_breadcrumb::title_trim() function will remain for the time being to remain compatible with any custom code that hasn’t been updated yet.
  • v7.5 (~2024) Removal: The “The Max Breadcrumb Length” setting and bcn_breadcrumb::title_trim() will be removed completely from Breadcrumb NavXT.

This feature was originally scheduled for removal in Breadcrumb NavXT 7.0, and while its skeleton will remain, it effectively will no longer function. If you are still using this feature, please migrate to using CSS to limit the displayed length of breadcrumbs instead of using this feature before upgrading to Breadcrumb NavXT 7.0.

-John Havlik

Breadcrumb NavXT Paths 1.7.0

Announcing the immediate availability of Breadcrumb NavXT Paths 1.7.0. This version introduces changes to how term archives to page mapping works.

Previously, when a term was mapped to a page, that page’s hierarchy would be used for the rest of the breadcrumb trail. In Breadcrumb NavXT Paths 1.7.0, a new behavior was introduced where the term’s hierarchy would be maintained and only individual breadcrumbs would be replaced with pages. Toggling between the old behavior and the new behavior is controlled through the “Term Archive to Page Mapping” setting in the Paths section of the Breadcrumb NavXT settings page.

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).

-John Havlik

Breadcrumb NavXT and bbPress Compatibility Revisited

Since the last time the topic of Breadcrumb NavXT and bbPress Compatibility was investigated, almost 6 years ago, a little has changed in how both plugins operate. In fact, due to a change in how bbPress operates internally, Breadcrumb NavXT now supports post type jumping.

What Works

Out-of-the-box, forums and topics should work well. However, the settings recommendations have changed since the last visit of this topic. The current settings recommendations are:

  • Forum Root Page and Topic Root Page – Set these to be equal and to whatever page you have set as ‘Forum Root’ under Settings > Forums.
  • Forum Archive Display – Unchecked
  • Forum Hierarchy Display – Checked
  • Forum Hierarchy – Post Parent
  • Topic Archive Display – Checked
  • Topic Hierarchy Display – Checked
  • Topic Hierarchy – Post Parent

What Doesn’t Work

Out-of-the-box, topic tag archives still won’t work as expected. Additionally, the search page, search results page, and user pages do not work. These all require custom, bbPress specific code.

The Solution

Recently, Breadcrumb NavXT bbPress Extensions was updated to include support for the search page, search results pages, and user pages (at least the landing page for user pages, the various sub-pages are not supported yet). This is in addition to fixing the how topic tag archives show up in the breadcrumb trail.

-John Havlik

Breadcrumb NavXT 6.6.0

Holy post type jumping Batman! This second feature release of 2020 changes how post type archives are handled when following a post parent hierarchy. Additionally, a bug introduced in 6.5.0 was fixed where an error that would be thrown in the WordPress dashboard if the administrator role does not exist.

Previously, if the post type changed while following the post parent hierarchy, the post type of the current item was used for the post type archive. In 6.6.0, this behavior changed to use the post type of the highest level post in the post parent hierarchy. The old behavior just didn’t make sense and causes problems with plugins that use multiple custom post types in the same hierarchy. A side benefit of the change is improved bbPress and BuddyPress support.

-John Havlik

Mapping Terms to Posts in Breadcrumb Trails

In certain site configurations, it makes sense to replace the WordPress built-in term archives with a post (an instance of some post type). Typically, a page (instance of the page post type) is used in place of the term archive. Since version 1.5, Breadcrumb NavXT Paths supports mapping terms to pages (with regards to where the breadcrumb links to). To facilitate this, Breadcrumb NavXT Paths provides a metabox in the term editor for establish this mapping.

Sometimes, the page post type does not make sense for this mapping. In that case, the bcn_paths_map_term_post_args can be used to change the post type that the term editor metabox added by Breadcrumb NavXT displays. Note that this filter was introduced in Breadcrumb NavXT Paths 1.6.0.

The Code

Placing the following code into a site specific plugin, will allow Breadcrumb NavXT Paths to map terms to the post post type:

add_filter('bcn_paths_map_term_post_args', 'my_bcn_paths_map_term_post_args', 10, 3);
function my_bcn_paths_map_term_post_args($args, $term, $taxonomy)
{
     $args['post_type'] = 'post';
     return $args;
}

Naturally, this can be modified to specify post types other than post. Should multiple post types be desired, just replace the string 'post' with an array of the post type names. Since this filter affects the arguments sent to get_post, other arguments may be set as well.

-John Havlik