Breadcrumb NavXT - Version 6.0.3

Version Description

Release date: January, 1st 2018

  • Bug fix: Fixed issue where an improper breadcrumb would be generated in the trail for pages under some circumstances.
  • Bug fix: Fixed issue where the post and page roots were not updating to track user changes in Settings > Reading.
Download this release

Release Info

Developer mtekk
Plugin Icon 128x128 Breadcrumb NavXT
Version 6.0.3
Comparing to
See all releases

Code changes from version 6.0.2 to 6.0.3

breadcrumb-navxt.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Breadcrumb NavXT
4
  Plugin URI: http://mtekk.us/code/breadcrumb-navxt/
5
  Description: Adds a breadcrumb navigation showing the visitor&#39;s path to their current location. For details on how to use this plugin visit <a href="http://mtekk.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
6
- Version: 6.0.2
7
  Author: John Havlik
8
  Author URI: http://mtekk.us/
9
  License: GPL2
@@ -11,7 +11,7 @@ Text Domain: breadcrumb-navxt
11
  Domain Path: /languages
12
  */
13
  /*
14
- Copyright 2007-2017 John Havlik (email : john.havlik@mtekk.us)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
@@ -61,7 +61,7 @@ $breadcrumb_navxt = null;
61
  //TODO change to extends mtekk_plugKit
62
  class breadcrumb_navxt
63
  {
64
- const version = '6.0.2';
65
  protected $name = 'Breadcrumb NavXT';
66
  protected $identifier = 'breadcrumb-navxt';
67
  protected $unique_prefix = 'bcn';
@@ -394,6 +394,9 @@ class breadcrumb_navxt
394
  //Currently only support using post_parent for the page hierarchy
395
  $this->breadcrumb_trail->opt['bpost_page_hierarchy_display'] = true;
396
  $this->breadcrumb_trail->opt['Spost_page_hierarchy_type'] = 'BCN_POST_PARENT';
 
 
 
397
  }
398
  /**
399
  * Outputs the breadcrumb trail
3
  Plugin Name: Breadcrumb NavXT
4
  Plugin URI: http://mtekk.us/code/breadcrumb-navxt/
5
  Description: Adds a breadcrumb navigation showing the visitor&#39;s path to their current location. For details on how to use this plugin visit <a href="http://mtekk.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
6
+ Version: 6.0.3
7
  Author: John Havlik
8
  Author URI: http://mtekk.us/
9
  License: GPL2
11
  Domain Path: /languages
12
  */
13
  /*
14
+ Copyright 2007-2018 John Havlik (email : john.havlik@mtekk.us)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
61
  //TODO change to extends mtekk_plugKit
62
  class breadcrumb_navxt
63
  {
64
+ const version = '6.0.3';
65
  protected $name = 'Breadcrumb NavXT';
66
  protected $identifier = 'breadcrumb-navxt';
67
  protected $unique_prefix = 'bcn';
394
  //Currently only support using post_parent for the page hierarchy
395
  $this->breadcrumb_trail->opt['bpost_page_hierarchy_display'] = true;
396
  $this->breadcrumb_trail->opt['Spost_page_hierarchy_type'] = 'BCN_POST_PARENT';
397
+ $this->breadcrumb_trail->opt['apost_page_root'] = get_option('page_on_front');
398
+ //This one isn't needed as it is performed in bcn_breadcrumb_trail::fill(), it's here for completeness only
399
+ $this->breadcrumb_trail->opt['apost_post_root'] = get_option('page_for_posts');
400
  }
401
  /**
402
  * Outputs the breadcrumb trail
class.bcn_admin.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ if(!class_exists('mtekk_adminKit'))
43
  */
44
  class bcn_admin extends mtekk_adminKit
45
  {
46
- const version = '6.0.2';
47
  protected $full_name = 'Breadcrumb NavXT Settings';
48
  protected $short_name = 'Breadcrumb NavXT';
49
  protected $access_level = 'manage_options';
@@ -95,6 +95,7 @@ class bcn_admin extends mtekk_adminKit
95
  {
96
  $opts['bpost_page_hierarchy_display'] = true;
97
  $opts['Spost_page_hierarchy_type'] = 'BCN_POST_PARENT';
 
98
  }
99
  /**
100
  * Upgrades input options array, sets to $this->opt
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
43
  */
44
  class bcn_admin extends mtekk_adminKit
45
  {
46
+ const version = '6.0.3';
47
  protected $full_name = 'Breadcrumb NavXT Settings';
48
  protected $short_name = 'Breadcrumb NavXT';
49
  protected $access_level = 'manage_options';
95
  {
96
  $opts['bpost_page_hierarchy_display'] = true;
97
  $opts['Spost_page_hierarchy_type'] = 'BCN_POST_PARENT';
98
+ $opts['apost_page_root'] = get_option('page_on_front');
99
  }
100
  /**
101
  * Upgrades input options array, sets to $this->opt
class.bcn_breadcrumb.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2007-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
21
  class bcn_breadcrumb
22
  {
23
  //Our member variables
24
- const version = '6.0.2';
25
  //The main text that will be shown
26
  protected $title;
27
  //The breadcrumb's template, used durring assembly
1
  <?php
2
  /*
3
+ Copyright 2007-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
21
  class bcn_breadcrumb
22
  {
23
  //Our member variables
24
+ const version = '6.0.3';
25
  //The main text that will be shown
26
  protected $title;
27
  //The breadcrumb's template, used durring assembly
class.bcn_breadcrumb_trail.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
21
  class bcn_breadcrumb_trail
22
  {
23
  //Our member variables
24
- const version = '6.0.2';
25
  //An array of breadcrumbs
26
  public $breadcrumbs = array();
27
  public $trail = array();
@@ -894,35 +894,36 @@ class bcn_breadcrumb_trail
894
  */
895
  protected function do_root($type_str, $root_id, $is_paged = false, $is_current_item = true)
896
  {
897
- //Continue only if we have a valid root_id
898
- if(is_numeric($root_id))
899
  {
900
- $frontpage_id = get_option('page_on_front');
901
- //We'll have to check if this ID is valid, e.g. user has specified a posts page
902
- if($root_id && $root_id != $frontpage_id)
 
 
 
 
 
 
 
 
 
903
  {
904
- //Place the breadcrumb in the trail, uses the constructor to set the title, template, and type, we get a pointer to it in return
905
- $breadcrumb = $this->add(new bcn_breadcrumb(get_the_title($root_id), $this->opt['Hpost_' . $type_str . '_template_no_anchor'], array($type_str . '-root', 'post', 'post-' . $type_str), null, $root_id));
906
- //If we are at home, or any root page archive then we need to add the current item type
907
- if($is_current_item)
908
- {
909
- $breadcrumb->add_type('current-item');
910
- }
911
- //If we're not on the current item we need to setup the anchor
912
- if(!$is_current_item || ($is_current_item && $this->opt['bcurrent_item_linked']) || ($is_paged && $this->opt['bpaged_display']))
913
- {
914
- $breadcrumb->set_template($this->opt['Hpost_' . $type_str . '_template']);
915
- //Figure out the anchor for home page
916
- $breadcrumb->set_url(get_permalink($root_id));
917
- }
918
- //Done with the "root", now on to the parents
919
- //Get the blog page
920
- $bcn_post = get_post($root_id);
921
- //If there is a parent post let's find it
922
- if($bcn_post->post_parent > 0 && $bcn_post->ID != $bcn_post->post_parent && $frontpage_id != $bcn_post->post_parent)
923
- {
924
- $this->post_parents($bcn_post->post_parent, $frontpage_id);
925
- }
926
  }
927
  }
928
  }
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
21
  class bcn_breadcrumb_trail
22
  {
23
  //Our member variables
24
+ const version = '6.0.3';
25
  //An array of breadcrumbs
26
  public $breadcrumbs = array();
27
  public $trail = array();
894
  */
895
  protected function do_root($type_str, $root_id, $is_paged = false, $is_current_item = true)
896
  {
897
+ //Nothing to do for the page post type, exit early
898
+ if($type_str === 'page')
899
  {
900
+ return;
901
+ }
902
+ $frontpage_id = get_option('page_on_front');
903
+ //Retrieve the post for the root_id as we will need it eventually
904
+ $bcn_post = get_post($root_id);
905
+ //We'll have to check if this ID is valid, e.g. user has specified a posts page
906
+ if($bcn_post instanceof WP_Post && $root_id > 0 && $root_id != $frontpage_id)
907
+ {
908
+ //Place the breadcrumb in the trail, uses the constructor to set the title, template, and type, we get a pointer to it in return
909
+ $breadcrumb = $this->add(new bcn_breadcrumb(get_the_title($root_id), $this->opt['Hpost_' . $type_str . '_template_no_anchor'], array($type_str . '-root', 'post', 'post-' . $type_str), null, $root_id));
910
+ //If we are at home, or any root page archive then we need to add the current item type
911
+ if($is_current_item)
912
  {
913
+ $breadcrumb->add_type('current-item');
914
+ }
915
+ //If we're not on the current item we need to setup the anchor
916
+ if(!$is_current_item || ($is_current_item && $this->opt['bcurrent_item_linked']) || ($is_paged && $this->opt['bpaged_display']))
917
+ {
918
+ $breadcrumb->set_template($this->opt['Hpost_' . $type_str . '_template']);
919
+ //Figure out the anchor for home page
920
+ $breadcrumb->set_url(get_permalink($root_id));
921
+ }
922
+ //Done with the "root", now on to the parents
923
+ //If there is a parent post let's find it
924
+ if($bcn_post->post_parent > 0 && $bcn_post->ID != $bcn_post->post_parent && $frontpage_id != $bcn_post->post_parent)
925
+ {
926
+ $this->post_parents($bcn_post->post_parent, $frontpage_id);
 
 
 
 
 
 
 
 
927
  }
928
  }
929
  }
class.bcn_network_admin.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ if(!class_exists('bcn_admin'))
28
  */
29
  class bcn_network_admin extends bcn_admin
30
  {
31
- const version = '6.0.2';
32
  protected $full_name = 'Breadcrumb NavXT Network Settings';
33
  protected $access_level = 'manage_network_options';
34
  /**
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
28
  */
29
  class bcn_network_admin extends bcn_admin
30
  {
31
+ const version = '6.0.3';
32
  protected $full_name = 'Breadcrumb NavXT Network Settings';
33
  protected $access_level = 'manage_network_options';
34
  /**
class.bcn_widget.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
19
  require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
20
  class bcn_widget extends WP_Widget
21
  {
22
- const version = '6.0.2';
23
  protected $allowed_html = array();
24
  protected $defaults = array('title' => '', 'pretext' => '', 'type' => 'microdata', 'linked' => true, 'reverse' => false, 'front' => false, 'force' => false);
25
  //Default constructor
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
19
  require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
20
  class bcn_widget extends WP_Widget
21
  {
22
+ const version = '6.0.3';
23
  protected $allowed_html = array();
24
  protected $defaults = array('title' => '', 'pretext' => '', 'type' => 'microdata', 'linked' => true, 'reverse' => false, 'front' => false, 'force' => false);
25
  //Default constructor
includes/block_direct_access.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
includes/class.mtekk_adminkit.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
includes/class.mtekk_adminkit_message.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
includes/class.mtekk_adminkit_uninstaller.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2015-2017 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
1
  <?php
2
  /*
3
+ Copyright 2015-2018 John Havlik (email : john.havlik@mtekk.us)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
includes/multibyte_supplicant.php CHANGED
@@ -3,7 +3,7 @@
3
  A small library that adds in fallbacks for some of the PHP multibyte string
4
  functions. Mainly inteneded to be used with Breadcrumb NavXT
5
 
6
- Copyright 2009-2017 John Havlik (email : john.havlik@mtekk.us)
7
 
8
  This program is free software; you can redistribute it and/or modify
9
  it under the terms of the GNU General Public License as published by
3
  A small library that adds in fallbacks for some of the PHP multibyte string
4
  functions. Mainly inteneded to be used with Breadcrumb NavXT
5
 
6
+ Copyright 2009-2018 John Havlik (email : john.havlik@mtekk.us)
7
 
8
  This program is free software; you can redistribute it and/or modify
9
  it under the terms of the GNU General Public License as published by
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=FD5XE
4
  Tags: breadcrumb, breadcrumbs, trail, navigation, menu, widget
5
  Requires at least: 4.7
6
  Tested up to: 4.9
7
- Stable tag: 6.0.2
8
  Requires PHP: 5.3
9
  License: GPLv2 or later
10
  Adds breadcrumb navigation showing the visitor's path to their current location.
@@ -52,6 +52,12 @@ Please visit [Breadcrumb NavXT's Documentation](http://mtekk.us/code/breadcrumb-
52
 
53
  == Changelog ==
54
 
 
 
 
 
 
 
55
  = 6.0.2 =
56
  Release date: December, 30th 2017
57
 
4
  Tags: breadcrumb, breadcrumbs, trail, navigation, menu, widget
5
  Requires at least: 4.7
6
  Tested up to: 4.9
7
+ Stable tag: 6.0.3
8
  Requires PHP: 5.3
9
  License: GPLv2 or later
10
  Adds breadcrumb navigation showing the visitor's path to their current location.
52
 
53
  == Changelog ==
54
 
55
+ = 6.0.3 =
56
+ Release date: January, 1st 2018
57
+
58
+ * Bug fix: Fixed issue where an improper breadcrumb would be generated in the trail for pages under some circumstances.
59
+ * Bug fix: Fixed issue where the post and page roots were not updating to track user changes in Settings > Reading.
60
+
61
  = 6.0.2 =
62
  Release date: December, 30th 2017
63
 
uninstall.php CHANGED
@@ -22,7 +22,7 @@
22
  * @author Tom Klingenberg
23
  */
24
  /*
25
- Copyright 2010-2017 John Havlik (email : john.havlik@mtekk.us)
26
 
27
  This program is free software; you can redistribute it and/or modify
28
  it under the terms of the GNU General Public License as published by
22
  * @author Tom Klingenberg
23
  */
24
  /*
25
+ Copyright 2010-2018 John Havlik (email : john.havlik@mtekk.us)
26
 
27
  This program is free software; you can redistribute it and/or modify
28
  it under the terms of the GNU General Public License as published by