WP Lynx 1.3

Presenting WP Lynx 1.3.0: PHP8 support, and a few under-the-hood improvements.

This release is mainly under-the-hood updates and fixes. The largest is fixing several PHP warnings and errors that appeared when using PHP8. Additionally, WP Lynx 1.3 moves to the latest adminKit, enabling WP Lynx to run on sites with Breadcrumb NavXT 7.0 or newer installed. As part of this move, the code base has been cleaned up a bit, removing vestigial code and settings that were present in 1.2.0.

You can grab the latest WP Lynx on the WP Lynx WordPress.org plugin page.

-John Havlik

Breadcrumb NavXT 7.1.0

Holy new settings export format Batman! This release features several improvements relating to settings, including a new JSON format for settings export and import, updated BCN_SETTINGS_FAVOR_* behavior, improved handling of CPTs that are added too late in the settings page, and fixing a bug in the old XML settings export and import features.

On the filter front, a new filter, bcn_before_loop, was added. Similar to the existing bcn_after_fill, this filter allows unique handling of the breadcrumb trail when multiple renderings are called on the same page. Unlike the bcn_after_fill and bcn_before_fill actions which are bypassed when bcn_display() is called without $forced = true, bcn_before_loop filter will run on every call to bcn_display().

In addition to fixing a bug caused by the introduction of namespacing in 7.0 in the old XML settings export and import routines, several other bugs were fixed. The options updating and adding routines were updated to explicitly set the autoload value, to prevent loading the backup settings option unless absolutely needed (during an ‘undo’ operation). Lastly, a bug resulting in a PHP error on term archives that don’t have an active term was fixed.

-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

Using the bcn_manage_options Capability

Since version 6.5.0, Breadcrumb NavXT uses the custom capability bcn_manage_options to grant access to, and allow updating settings on the Breadcrumb NavXT settings page. By default, Breadcrumb NavXT tries to add this capability to the administrator role. However, some setups do not have an administrator role, and require the bcn_manage_options capability to be assigned to the appropriate role on that site.

The following code, when placed in a site specific plugin, adds the bcn_manage_options to the role ROLE:

function my_bcn_manage_options_cap_adder()
{
    $role = get_role('ROLE');
    if($role instanceof \WP_Role && !role->has_cap('bcn_manage_options')
    {
        $role->add_cap('bcn_manage_options');
    }
}
add_action('admin_init', 'my_bcn_manage_options_cap_adder');

Simply swap ROLE for the name of the role that needs access to the Breadcrumb NavXT Settings page.

-John Havlik