This commit is contained in:
KhaiNguyen
2020-02-13 10:39:37 +07:00
commit 59401cb805
12867 changed files with 4646216 additions and 0 deletions

View File

@@ -0,0 +1,125 @@
/**
* A Gutenberg Breadcrumb Block
*/
( function( blocks, components, i18n, element ) {
const { __ } = wp.i18n;
const { registerBlockType, InspectorControls } = wp.blocks;
const { Component } = wp.element;
const { decodeEntities } = wp.htmlEntities;
wp.data.use( wp.data.plugins.controls );
const { data, apiFetch } = wp;
const { registerStore, withSelect, select, dispatch } = data;
const el = wp.element.createElement;
const iconBCN = el('svg', { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
el('path', { d: "M0.6 7.2C0.4 7.2 0.4 7.2 0.4 7.4V16.9C0.4 17.1 0.4 17.1 0.6 17.1H10.9C11.1 17.1 11.1 17.1 11.3 16.9L16 12.1 11.3 7.4C11.1 7.2 11.1 7.2 10.9 7.2ZM15 7.2 19.9 12.1 15 17.1H18.7C18.9 17.1 18.9 17.1 19.1 16.9L23.8 12.1 19.1 7.4C18.9 7.2 18.9 7.2 18.7 7.2Z" } )
);
const DEFAULT_STATE = {
breadcrumbTrails: {}
};
const actions = {
setBreadcrumbTrail( post, breadcrumbTrail) {
return {
type: 'SET_BREADCRUMB_TRAIL',
post,
breadcrumbTrail,
}
},
fetchFromAPI( path ) {
return {
type: 'FETCH_FROM_API',
path,
}
}
};
registerStore('breadcrumb-navxt', {
reducer( state = DEFAULT_STATE, action ) {
switch ( action.type ) {
case 'SET_BREADCRUMB_TRAIL' :
return {
...state,
breadcrumbTrails: {
...state.breadcrumbTrails,
[ action.post ]: action.breadcrumbTrail,
},
};
}
return state;
},
actions,
selectors: {
getBreadcrumbTrail( state, post ) {
const { breadcrumbTrails } = state;
const breadcrumbTrail = breadcrumbTrails[ post ];
return breadcrumbTrail;
},
},
controls: {
FETCH_FROM_API( action ) {
return apiFetch( { path: action.path } );
},
},
resolvers: {
* getBreadcrumbTrail( post ) {
const path = '/bcn/v1/post/' + post;
const breadcrumbTrail = yield actions.fetchFromAPI( path );
return actions.setBreadcrumbTrail( post, breadcrumbTrail );
}
},
} );
function renderBreadcrumbTrail( breadcrumbTrail ) {
var trailString = [];
const length = breadcrumbTrail.itemListElement.length;
breadcrumbTrail.itemListElement.forEach( function( listElement, index ) {
if( index > 0 ) {
trailString.push( decodeEntities( bcnOpts.hseparator ) );
}
if( index < length - 1 || bcnOpts.bcurrent_item_linked) {
trailString.push( el( 'a', { href: listElement.item['@id'] }, decodeEntities( listElement.item.name ) ) );
}
else {
trailString.push( el( 'span', { }, decodeEntities( listElement.item.name ) ) );
}
});
return trailString;
}
function displayBreadcrumbTrail( { breadcrumbTrail } ) {
if( ! breadcrumbTrail ) {
return __( 'Loading...', 'breadcrumb-navxt' );
}
if( breadcrumbTrail.itemListElement === 0 ) {
return __( 'No breadcrumb trail', 'breadcrumb-navxt' );
}
var breadcrumb = breadcrumbTrail.itemListElement[ 0 ];
return renderBreadcrumbTrail(breadcrumbTrail);
}
registerBlockType( 'bcn/breadcrumb-trail', {
title: __( 'Breadcrumb Trail', 'breadcrumb-navxt' ),
description: __( "Display a breadcrumb trail representing this post's location on this website.", 'breadcrumb-navxt'),
icon: iconBCN,
category: 'widgets',
edit: withSelect( ( select, ownProps ) => {
const { getBreadcrumbTrail } = select( 'breadcrumb-navxt' );
return {
breadcrumbTrail: getBreadcrumbTrail( select( 'core/editor' ).getCurrentPostId() ),
};
} )( displayBreadcrumbTrail ),
save: function() {
//Rendering in PHP
return null;
},
} );
} )(
window.wp.blocks,
window.wp.components,
window.wp.i18n,
window.wp.element
);

View File

@@ -0,0 +1,664 @@
<?php
/*
Plugin Name: Breadcrumb NavXT
Plugin URI: http://mtekk.us/code/breadcrumb-navxt/
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>.
Version: 6.4.0
Author: John Havlik
Author URI: http://mtekk.us/
License: GPL2
Text Domain: breadcrumb-navxt
Domain Path: /languages
*/
/*
Copyright 2007-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//Do a PHP version check, require 5.3 or newer
if(version_compare(phpversion(), '5.3.0', '<'))
{
//Only purpose of this function is to echo out the PHP version error
function bcn_phpold()
{
printf('<div class="notice notice-error"><p>' . esc_html__('Your PHP version is too old, please upgrade to a newer version. Your version is %1$s, Breadcrumb NavXT requires %2$s', 'breadcrumb-navxt') . '</p></div>', phpversion(), '5.3.0');
}
//If we are in the admin, let's print a warning then return
if(is_admin())
{
add_action('admin_notices', 'bcn_phpold');
}
return;
}
require_once(dirname(__FILE__) . '/includes/multibyte_supplicant.php');
//Include admin base class
if(!class_exists('mtekk_adminKit'))
{
require_once(dirname(__FILE__) . '/includes/class.mtekk_adminkit.php');
}
//Include the breadcrumb class
require_once(dirname(__FILE__) . '/class.bcn_breadcrumb.php');
//Include the breadcrumb trail class
require_once(dirname(__FILE__) . '/class.bcn_breadcrumb_trail.php');
if(class_exists('WP_Widget'))
{
//Include the WP 2.8+ widget class
require_once(dirname(__FILE__) . '/class.bcn_widget.php');
}
$breadcrumb_navxt = null;
//TODO change to extends mtekk_plugKit
class breadcrumb_navxt
{
const version = '6.4.0';
protected $name = 'Breadcrumb NavXT';
protected $identifier = 'breadcrumb-navxt';
protected $unique_prefix = 'bcn';
protected $plugin_basename = null;
protected $opt = null;
protected $breadcrumb_trail = null;
protected $admin = null;
protected $rest_controller = null;
/**
* Constructor for a new breadcrumb_navxt object
*
* @param bcn_breadcrumb_trail $breadcrumb_trail An instance of a bcn_breadcrumb_trail object to use for everything
*/
public function __construct(bcn_breadcrumb_trail $breadcrumb_trail)
{
//We get our breadcrumb trail object from our constructor
$this->breadcrumb_trail = $breadcrumb_trail;
//Grab defaults from the breadcrumb_trail object
$this->opt = $this->breadcrumb_trail->opt;
//We set the plugin basename here
$this->plugin_basename = plugin_basename(__FILE__);
//We need to add in the defaults for CPTs and custom taxonomies after all other plugins are loaded
add_action('wp_loaded', array($this, 'wp_loaded'), 15);
add_action('rest_api_init', array($this, 'rest_api_init'), 10);
//Run a little later than everyone else
add_action('init', array($this, 'init'), 11);
//Register the WordPress 2.8 Widget
add_action('widgets_init', array($this, 'register_widget'));
//Load our network admin if in the network dashboard (yes is_network_admin() doesn't exist)
if(defined('WP_NETWORK_ADMIN') && WP_NETWORK_ADMIN)
{
require_once(dirname(__FILE__) . '/class.bcn_network_admin.php');
//Instantiate our new admin object
$this->admin = new bcn_network_admin($this->breadcrumb_trail, $this->plugin_basename);
}
//Load our main admin if in the dashboard, but only if we're not in the network dashboard (prevents goofy bugs)
else if(is_admin() || defined('WP_UNINSTALL_PLUGIN'))
{
require_once(dirname(__FILE__) . '/class.bcn_admin.php');
//Instantiate our new admin object
$this->admin = new bcn_admin($this->breadcrumb_trail, $this->plugin_basename);
}
}
public function init()
{
breadcrumb_navxt::setup_options($this->opt);
if(!is_admin() || !isset($_POST[$this->unique_prefix . '_admin_reset']))
{
$this->get_settings(); //This breaks the reset options script, so only do it if we're not trying to reset the settings
}
add_filter('bcn_allowed_html', array($this, 'allowed_html'), 1, 1);
//We want to run late for using our breadcrumbs
add_filter('tha_breadcrumb_navigation', array($this, 'tha_compat'), 99);
//Only include the REST API if enabled
if(!defined('BCN_DISABLE_REST_API') || !BCN_DISABLE_REST_API)
{
require_once(dirname(__FILE__) . '/class.bcn_rest_controller.php');
$this->rest_controller = new bcn_rest_controller($this->breadcrumb_trail, $this->unique_prefix);
}
//Register Guternberg
$this->register_block();
}
public function rest_api_init()
{
add_filter('bcn_register_rest_endpoint', array($this, 'api_enable_for_block'), 10, 4);
}
public function register_widget()
{
return register_widget($this->unique_prefix . '_widget');
}
/**
* Server-side rendering for front-end block display
*
* @param array $attributes Array of attributes set by the Gutenberg sidebar
* @return string The Breadcrumb Trail string
*/
public function render_block($attributes)
{
$extra_classs = '';
if(isset($attributes['className']))
{
$extra_classs = esc_attr($attributes['className']);
}
return sprintf('<div class="breadcrumbs %2$s" typeof="BreadcrumbList" vocab="https://schema.org/">%1$s</div>', bcn_display(true), $extra_classs);
}
/**
* Handles registering the Breadcrumb Trail Gutenberg block
*/
public function register_block()
{
wp_register_script($this->unique_prefix . '-breadcrumb-trail-block-script', plugins_url('bcn_gutenberg_block.js', __FILE__), array('wp-blocks', 'wp-element', 'wp-i18n', 'wp-api'));
if(function_exists('register_block_type'))
{
register_block_type( $this->unique_prefix . '/breadcrumb-trail', array(
'editor_script' => $this->unique_prefix . '-breadcrumb-trail-block-script',
'render_callback' => array($this, 'render_block')
/*'editor_style' => ''/*,
'style' => ''*/
));
if(function_exists('wp_set_script_translations'))
{
//Setup our translation strings
wp_set_script_translations($this->unique_prefix . '-breadcrumb-trail-block-script', 'breadcrumb-navxt');
}
//Setup some bcn settings
//TODO: New settings arch should make this easier
wp_add_inline_script($this->unique_prefix . '-breadcrumb-trail-block-script',
$this->unique_prefix . 'Opts = ' . json_encode(
array(
'bcurrent_item_linked' => $this->opt['bcurrent_item_linked'],
'hseparator' => $this->opt['hseparator']
)) . ';',
'before');
}
}
public function api_enable_for_block($register_rest_endpoint, $endpoint, $version, $methods)
{
//Enable if the current user can edit posts
if(current_user_can('edit_posts') && $endpoint === 'post')
{
return true;
}
return $register_rest_endpoint;
}
public function allowed_html($tags)
{
$allowed_html = array(
'a' => array(
'href' => true,
'title' => true,
'class' => true,
'id' => true,
'media' => true,
'dir' => true,
'relList' => true,
'rel' => true,
'aria-hidden' => true,
'data-icon' => true,
'itemref' => true,
'itemid' => true,
'itemprop' => true,
'itemscope' => true,
'itemtype' => true,
'xmlns:v' => true,
'typeof' => true,
'property' => true,
'vocab' => true,
'translate' => true,
'lang' => true,
'bcn-aria-current' => true
),
'img' => array(
'alt' => true,
'align' => true,
'height' => true,
'width' => true,
'src' => true,
'srcset' => true,
'sizes' => true,
'id' => true,
'class' => true,
'aria-hidden' => true,
'data-icon' => true,
'itemref' => true,
'itemid' => true,
'itemprop' => true,
'itemscope' => true,
'itemtype' => true,
'xmlns:v' => true,
'typeof' => true,
'property' => true,
'vocab' => true,
'lang' => true
),
'span' => 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,
'xmlns:v' => true,
'typeof' => true,
'property' => true,
'vocab' => true,
'translate' => true,
'lang' => true
),
'h1' => 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,
'xmlns:v' => true,
'typeof' => true,
'property' => true,
'vocab' => true,
'translate' => true,
'lang' => true
),
'h2' => 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,
'xmlns:v' => true,
'typeof' => true,
'property' => true,
'vocab' => true,
'translate' => true,
'lang' => true
),
'meta' => array(
'content' => true,
'property' => true,
'vocab' => true,
'itemprop' => true
)
);
return mtekk_adminKit::array_merge_recursive($tags, $allowed_html);
}
public function get_version()
{
return self::version;
}
public function wp_loaded()
{
}
public function uninstall()
{
$this->admin->uninstall();
}
/**
* Sets up the extended options for any CPTs, taxonomies or extensions
*
* @param array $opt The options array, passed by reference
*/
static public function setup_options(&$opt)
{
//Add custom post types
breadcrumb_navxt::find_posttypes($opt);
//Add custom taxonomy types
breadcrumb_navxt::find_taxonomies($opt);
//Let others hook into our settings
$opt = apply_filters('bcn_settings_init', $opt);
}
/**
* Places settings into $opts array, if missing, for the registered post types
*
* @param array $opts
*/
static function find_posttypes(&$opts)
{
global $wp_post_types, $wp_taxonomies;
//Loop through all of the post types in the array
foreach($wp_post_types as $post_type)
{
//We only want custom post types
if(!$post_type->_builtin)
{
if(!isset($opts['bpost_' . $post_type->name . '_taxonomy_referer']))
{
//Default to not letting the refering page influence the referer
$opts['bpost_' . $post_type->name . '_taxonomy_referer'] = false;
}
//If the post type does not have settings in the options array yet, we need to load some defaults
if(!isset($opts['Hpost_' . $post_type->name . '_template']))
{
//Add the necessary option array members
$opts['Hpost_' . $post_type->name . '_template'] = bcn_breadcrumb::get_default_template();
}
if(!isset($opts['Hpost_' . $post_type->name . '_template_no_anchor']))
{
$opts['Hpost_' . $post_type->name . '_template_no_anchor'] = bcn_breadcrumb::default_template_no_anchor;
}
if(!isset($opts['apost_' . $post_type->name . '_root']))
{
//Default to not showing a post_root
$opts['apost_' . $post_type->name . '_root'] = 0;
}
if(!isset($opts['bpost_' . $post_type->name . '_hierarchy_display']))
{
//Default to not displaying a taxonomy
$opts['bpost_' . $post_type->name . '_hierarchy_display'] = false;
}
if(!isset($opts['Spost_' . $post_type->name . '_hierarchy_type']))
{
if($post_type->has_archive == true || is_string($post_type->has_archive))
{
$opts['bpost_' . $post_type->name . '_archive_display'] = true;
}
else
{
$opts['bpost_' . $post_type->name . '_archive_display'] = false;
}
if(!$post_type->hierarchical)
{
//Loop through all of the possible taxonomies
foreach($wp_taxonomies as $taxonomy)
{
//Check for non-public taxonomies
if(!apply_filters('bcn_show_tax_private', $taxonomy->public, $taxonomy->name, $post_type->name))
{
continue;
}
//Activate the first taxonomy valid for this post type and exit the loop
if($taxonomy->object_type == $post_type->name || in_array($post_type->name, $taxonomy->object_type))
{
$opts['bpost_' . $post_type->name . '_hierarchy_display'] = true;
$opts['Spost_' . $post_type->name . '_hierarchy_type'] = $taxonomy->name;
break;
}
}
}
else
{
$opts['bpost_' . $post_type->name . '_hierarchy_display'] = true;
$opts['Spost_' . $post_type->name . '_hierarchy_type'] = 'BCN_PARENT';
}
//If there are no valid taxonomies for this type, setup our defaults
if(!isset($opts['Spost_' . $post_type->name . '_hierarchy_type']))
{
$opts['Spost_' . $post_type->name . '_hierarchy_type'] = 'BCN_DATE';
}
//Run through some filters, allowing extensions to directly influence the default hierarchy selection/display
$opts['Spost_' . $post_type->name . '_hierarchy_type'] = apply_filters('bcn_default_hierarchy_type', $opts['Spost_' . $post_type->name . '_hierarchy_type'], $post_type->name);
$opts['bpost_' . $post_type->name . '_hierarchy_display'] = apply_filters('bcn_default_hierarchy_display', $opts['bpost_' . $post_type->name . '_hierarchy_display'], $post_type->name, $opts['Spost_' . $post_type->name . '_hierarchy_type']);
}
//New for 6.2
if(!isset($opts['bpost_' . $post_type->name . '_hierarchy_parent_first']))
{
$opts['bpost_' . $post_type->name . '_hierarchy_parent_first'] = false;
$opts['bpost_' . $post_type->name . '_hierarchy_parent_first'] = apply_filters('bcn_default_hierarchy_parent_first', $opts['bpost_' . $post_type->name . '_hierarchy_parent_first'], $post_type->name);
}
}
}
}
/**
* Places settings into $opts array, if missing, for the registered taxonomies
*
* @param $opts
*/
static function find_taxonomies(&$opts)
{
global $wp_taxonomies;
//We'll add our custom taxonomy stuff at this time
foreach($wp_taxonomies as $taxonomy)
{
//We only want custom taxonomies
if(!$taxonomy->_builtin)
{
//If the taxonomy does not have settings in the options array yet, we need to load some defaults
if(!isset($opts['Htax_' . $taxonomy->name . '_template']))
{
//Add the necessary option array members
$opts['Htax_' . $taxonomy->name . '_template'] = __(sprintf('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %%title%% %s archives." href="%%link%%" class="%%type%%" bcn-aria-current><span property="name">%%htitle%%</span></a><meta property="position" content="%%position%%"></span>', $taxonomy->labels->singular_name), 'breadcrumb-navxt');
$opts['Htax_' . $taxonomy->name . '_template_no_anchor'] = __(sprintf('<span property="itemListElement" typeof="ListItem"><span property="name">%%htitle%%</span><meta property="position" content="%%position%%"></span>', $taxonomy->labels->singular_name), 'breadcrumb-navxt');
}
}
}
}
/**
* Hooks into the theme hook alliance tha_breadcrumb_navigation filter and replaces the trail
* with one generated by Breadcrumb NavXT
*
* @param string $bradcrumb_trail The string breadcrumb trail that we will replace
* @return string The Breadcrumb NavXT assembled breadcrumb trail
*/
public function tha_compat($breadcrumb_trail)
{
//Return our breadcrumb trail
return $this->display(true);
}
/**
* Function updates the breadcrumb_trail options array from the database in a semi intellegent manner
*
* @since 5.0.0
*/
private function get_settings()
{
//Grab the current settings for the current local site from the db
$this->breadcrumb_trail->opt = wp_parse_args(get_option('bcn_options'), $this->opt);
//If we're in multisite mode, look at the three BCN_SETTINGS globals
if(is_multisite())
{
if(defined('BCN_SETTINGS_USE_NETWORK') && BCN_SETTINGS_USE_NETWORK)
{
//Grab the current network wide settings
$this->breadcrumb_trail->opt = wp_parse_args(get_site_option('bcn_options'), $this->opt);
}
else if(defined('BCN_SETTINGS_FAVOR_LOCAL') && BCN_SETTINGS_FAVOR_LOCAL)
{
//Grab the current settings for the current local site from the db
$this->breadcrumb_trail->opt = wp_parse_args(get_option('bcn_options'), $this->breadcrumb_trail->opt);
}
else if(defined('BCN_SETTINGS_FAVOR_NETWORK') && BCN_SETTINGS_FAVOR_NETWORK)
{
//Grab the current settings from the db
$this->breadcrumb_trail->opt = wp_parse_args(get_site_option('bcn_options'), get_option('bcn_options'));
}
}
//Currently only support using post_parent for the page hierarchy
$this->breadcrumb_trail->opt['bpost_page_hierarchy_display'] = true;
$this->breadcrumb_trail->opt['bpost_page_hierarchy_parent_first'] = true;
$this->breadcrumb_trail->opt['Spost_page_hierarchy_type'] = 'BCN_POST_PARENT';
$this->breadcrumb_trail->opt['apost_page_root'] = get_option('page_on_front');
//This one isn't needed as it is performed in bcn_breadcrumb_trail::fill(), it's here for completeness only
$this->breadcrumb_trail->opt['apost_post_root'] = get_option('page_for_posts');
//Loop through all of the post types in the array, migrate automatically if necessary
foreach($GLOBALS['wp_post_types'] as $post_type)
{
if(isset($this->opt['Spost_' . $post_type->name . '_taxonomy_type']))
{
$this->opt['Spost_' . $post_type->name . '_hierarchy_type'] = $this->opt['Spost_' . $post_type->name . '_taxonomy_type'];
unset($this->opt['Spost_' . $post_type->name . '_taxonomy_type']);
}
if(isset($this->opt['Spost_' . $post_type->name . '_taxonomy_display']))
{
$this->opt['Spost_' . $post_type->name . '_hierarchy_display'] = $this->opt['Spost_' . $post_type->name . '_taxonomy_display'];
unset($this->opt['Spost_' . $post_type->name . '_taxonomy_display']);
}
}
}
/**
* Outputs the breadcrumb trail
*
* @param bool $return Whether to return or echo the trail.
* @param bool $linked Whether to allow hyperlinks in the trail or not.
* @param bool $reverse Whether to reverse the output or not.
* @param bool $force Whether or not to force the fill function to run.
* @param string $template The template to use for the string output.
*
* @return void Void if Option to print out breadcrumb trail was chosen.
* @return string String-Data of breadcrumb trail.
*/
public function display($return = false, $linked = true, $reverse = false, $force = false, $template = '%1$s%2$s')
{
//If we're being forced to fill the trail, clear it before calling fill
if($force)
{
$this->breadcrumb_trail->breadcrumbs = array();
}
//Generate the breadcrumb trail
$this->breadcrumb_trail->fill();
$trail_string = $this->breadcrumb_trail->display($linked, $reverse, $template);
if($return)
{
return $trail_string;
}
else
{
//Helps track issues, please don't remove it
$credits = "<!-- Breadcrumb NavXT " . $this::version . " -->\n";
echo $credits . $trail_string;
}
}
/**
* Outputs the breadcrumb trail with each element encapsulated with li tags
*
* @deprecated 6.0.0 No longer needed, superceeded by $template parameter in display
*
* @param bool $return Whether to return or echo the trail.
* @param bool $linked Whether to allow hyperlinks in the trail or not.
* @param bool $reverse Whether to reverse the output or not.
* @param bool $force Whether or not to force the fill function to run.
*
* @return void Void if Option to print out breadcrumb trail was chosen.
* @return string String-Data of breadcrumb trail.
*/
public function display_list($return = false, $linked = true, $reverse = false, $force = false)
{
_deprecated_function( __FUNCTION__, '6.0', 'breadcrumb_navxt::display');
return $this->display($return, $linked, $reverse, $force, "<li%3\$s>%1\$s</li>\n");
}
/**
* Outputs the breadcrumb trail in Schema.org BreadcrumbList compatible JSON-LD
*
* @param bool $return Whether to return or echo the trail.
* @param bool $reverse Whether to reverse the output or not.
* @param bool $force Whether or not to force the fill function to run.
*
* @return void Void if Option to print out breadcrumb trail was chosen.
* @return string String-Data of breadcrumb trail.
*/
public function display_json_ld($return = false, $reverse = false, $force = false)
{
//If we're being forced to fill the trail, clear it before calling fill
if($force)
{
$this->breadcrumb_trail->breadcrumbs = array();
}
//Generate the breadcrumb trail
$this->breadcrumb_trail->fill();
$trail_string = json_encode($this->breadcrumb_trail->display_json_ld($reverse), JSON_UNESCAPED_SLASHES);
if($return)
{
return $trail_string;
}
else
{
echo $trail_string;
}
}
}
//Have to bootstrap our startup so that other plugins can replace the bcn_breadcrumb_trail object if they need to
add_action('plugins_loaded', 'bcn_init', 15);
function bcn_init()
{
global $breadcrumb_navxt;
//Create an instance of bcn_breadcrumb_trail
$bcn_breadcrumb_trail = new bcn_breadcrumb_trail();
//Let's make an instance of our object that takes care of everything
$breadcrumb_navxt = new breadcrumb_navxt(apply_filters('bcn_breadcrumb_trail_object', $bcn_breadcrumb_trail));
}
/**
* Outputs the breadcrumb trail
*
* @param bool $return Whether to return or echo the trail. (optional)
* @param bool $linked Whether to allow hyperlinks in the trail or not. (optional)
* @param bool $reverse Whether to reverse the output or not. (optional)
* @param bool $force Whether or not to force the fill function to run. (optional)
*
* @return void Void if Option to print out breadcrumb trail was chosen.
* @return string String-Data of breadcrumb trail.
*/
function bcn_display($return = false, $linked = true, $reverse = false, $force = false)
{
global $breadcrumb_navxt;
if($breadcrumb_navxt !== null)
{
return $breadcrumb_navxt->display($return, $linked, $reverse, $force);
}
}
/**
* Outputs the breadcrumb trail with each element encapsulated with li tags
*
* @param bool $return Whether to return or echo the trail. (optional)
* @param bool $linked Whether to allow hyperlinks in the trail or not. (optional)
* @param bool $reverse Whether to reverse the output or not. (optional)
* @param bool $force Whether or not to force the fill function to run. (optional)
*
* @return void Void if Option to print out breadcrumb trail was chosen.
* @return string String-Data of breadcrumb trail.
*/
function bcn_display_list($return = false, $linked = true, $reverse = false, $force = false)
{
global $breadcrumb_navxt;
if($breadcrumb_navxt !== null)
{
return $breadcrumb_navxt->display($return, $linked, $reverse, $force, "<li%3\$s>%1\$s</li>\n");
}
}
/**
* Outputs the breadcrumb trail in Schema.org BreadcrumbList compatible JSON-LD
*
* @param bool $return Whether to return or echo the trail. (optional)
* @param bool $reverse Whether to reverse the output or not. (optional)
* @param bool $force Whether or not to force the fill function to run. (optional)
*
* @return void Void if Option to print out breadcrumb trail was chosen.
* @return string String-Data of breadcrumb trail.
*/
function bcn_display_json_ld($return = false, $reverse = false, $force = false)
{
global $breadcrumb_navxt;
if($breadcrumb_navxt !== null)
{
return $breadcrumb_navxt->display_json_ld($return, $reverse, $force);
}
}

View File

@@ -0,0 +1,779 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
//Do a PHP version check, require 5.3 or newer
if(version_compare(phpversion(), '5.3.0', '<'))
{
//Only purpose of this function is to echo out the PHP version error
function bcn_phpold()
{
printf('<div class="notice notice-error"><p>' . __('Your PHP version is too old, please upgrade to a newer version. Your version is %1$s, Breadcrumb NavXT requires %2$s', 'breadcrumb-navxt') . '</p></div>', phpversion(), '5.3.0');
}
//If we are in the admin, let's print a warning then return
if(is_admin())
{
add_action('admin_notices', 'bcn_phpold');
}
return;
}
//Include admin base class
if(!class_exists('mtekk_adminKit'))
{
require_once(dirname(__FILE__) . '/includes/class.mtekk_adminkit.php');
}
/**
* The administrative interface class
*
*/
class bcn_admin extends mtekk_adminKit
{
const version = '6.4.0';
protected $full_name = 'Breadcrumb NavXT Settings';
protected $short_name = 'Breadcrumb NavXT';
protected $access_level = 'manage_options';
protected $identifier = 'breadcrumb-navxt';
protected $unique_prefix = 'bcn';
protected $plugin_basename = null;
protected $support_url = 'https://wordpress.org/support/plugin/breadcrumb-navxt/';
protected $breadcrumb_trail = null;
/**
* Administrative interface class default constructor
*
* @param bcn_breadcrumb_trail $breadcrumb_trail a breadcrumb trail object
* @param string $basename The basename of the plugin
*/
function __construct(bcn_breadcrumb_trail &$breadcrumb_trail, $basename)
{
$this->breadcrumb_trail =& $breadcrumb_trail;
$this->plugin_basename = $basename;
$this->full_name = esc_html__('Breadcrumb NavXT Settings', 'breadcrumb-navxt');
//Grab defaults from the breadcrumb_trail object
$this->opt =& $this->breadcrumb_trail->opt;
//We're going to make sure we load the parent's constructor
parent::__construct();
}
/**
* admin initialization callback function
*
* is bound to wordpress action 'admin_init' on instantiation
*
* @since 3.2.0
* @return void
*/
function init()
{
//We're going to make sure we run the parent's version of this function as well
parent::init();
}
function wp_loaded()
{
parent::wp_loaded();
breadcrumb_navxt::setup_options($this->opt);
}
/**
* Sets hard constants into the options array
*
* @param &$opts The options array to set hard constants into
*/
function opts_fix(&$opts)
{
$opts['bpost_page_hierarchy_display'] = true;
$opts['Spost_page_hierarchy_type'] = 'BCN_POST_PARENT';
$opts['apost_page_root'] = get_option('page_on_front');
}
/**
* Upgrades input options array, sets to $this->opt
*
* @param array $opts
* @param string $version the version of the passed in options
*/
function opts_upgrade($opts, $version)
{
global $wp_post_types, $wp_taxonomies;
//If our version is not the same as in the db, time to update
if(version_compare($version, $this::version, '<'))
{
//Upgrading to 3.8.1
if(version_compare($version, '3.8.1', '<'))
{
$opts['post_page_root'] = $this->get_option('page_on_front');
$opts['post_post_root'] = $this->get_option('page_for_posts');
}
//Upgrading to 4.0
if(version_compare($version, '4.0.0', '<'))
{
//Only migrate if we haven't migrated yet
if(isset($opts['current_item_linked']))
{
//Loop through the old options, migrate some of them
foreach($opts as $option => $value)
{
//Handle all of our boolean options first, they're real easy, just add a 'b'
if(strpos($option, 'display') > 0 || $option == 'current_item_linked')
{
$this->breadcrumb_trail->opt['b' . $option] = $value;
}
//Handle migration of anchor templates to the templates
else if(strpos($option, 'anchor') > 0)
{
$parts = explode('_', $option);
//Do excess slash removal sanitation
$this->breadcrumb_trail->opt['H' . $parts[0] . '_template'] = $value . '%htitle%</a>';
}
//Handle our abs integers
else if($option == 'max_title_length' || $option == 'post_post_root' || $option == 'post_page_root')
{
$this->breadcrumb_trail->opt['a' . $option] = $value;
}
//Now everything else, minus prefix and suffix
else if(strpos($option, 'prefix') === false && strpos($option, 'suffix') === false)
{
$this->breadcrumb_trail->opt['S' . $option] = $value;
}
}
}
//Add in the new settings for CPTs introduced in 4.0
foreach($wp_post_types as $post_type)
{
//We only want custom post types
if(!$post_type->_builtin)
{
//Add in the archive_display option
$this->breadcrumb_trail->opt['bpost_' . $post_type->name . '_archive_display'] = $post_type->has_archive;
}
}
$opts = $this->breadcrumb_trail->opt;
}
if(version_compare($version, '4.0.1', '<'))
{
if(isset($opts['Hcurrent_item_template_no_anchor']))
{
unset($opts['Hcurrent_item_template_no_anchor']);
}
if(isset($opts['Hcurrent_item_template']))
{
unset($opts['Hcurrent_item_template']);
}
}
//Upgrading to 4.3.0
if(version_compare($version, '4.3.0', '<'))
{
//Removed home_title
if(isset($opts['Shome_title']))
{
unset($opts['Shome_title']);
}
//Removed mainsite_title
if(isset($opts['Smainsite_title']))
{
unset($opts['Smainsite_title']);
}
}
//Upgrading to 5.1.0
if(version_compare($version, '5.1.0', '<'))
{
foreach($wp_taxonomies as $taxonomy)
{
//If we have the old options style for it, update
if($taxonomy->name !== 'post_format' && isset($opts['H' . $taxonomy->name . '_template']))
{
//Migrate to the new setting name
$opts['Htax_' . $taxonomy->name . '_template'] = $opts['H' . $taxonomy->name . '_template'];
$opts['Htax_' . $taxonomy->name . '_template_no_anchor'] = $opts['H' . $taxonomy->name . '_template_no_anchor'];
//Clean up old settings
unset($opts['H' . $taxonomy->name . '_template']);
unset($opts['H' . $taxonomy->name . '_template_no_anchor']);
}
}
}
//Upgrading to 5.4.0
if(version_compare($version, '5.4.0', '<'))
{
//Migrate users to schema.org breadcrumbs for author and search if still on the defaults for posts
if($opts['Hpost_post_template'] === bcn_breadcrumb::get_default_template() && $opts['Hpost_post_template_no_anchor'] === bcn_breadcrumb::default_template_no_anchor)
{
if($opts['Hpaged_template'] === 'Page %htitle%')
{
$opts['Hpaged_template'] = $this->opt['Hpaged_template'];
}
if($opts['Hsearch_template'] === 'Search results for &#39;<a title="Go to the first page of search results for %title%." href="%link%" class="%type%">%htitle%</a>&#39;' || $opts['Hsearch_template'] === 'Search results for &#039;<a title="Go to the first page of search results for %title%." href="%link%" class="%type%">%htitle%</a>&#039;')
{
$opts['Hsearch_template'] = $this->opt['Hsearch_template'];
}
if($opts['Hsearch_template_no_anchor'] === 'Search results for &#39;%htitle%&#39;' || $opts['Hsearch_template_no_anchor'] === 'Search results for &#039;%htitle%&#039;')
{
$opts['Hsearch_template_no_anchor'] = $this->opt['Hsearch_template_no_anchor'];
}
if($opts['Hauthor_template'] === 'Articles by: <a title="Go to the first page of posts by %title%." href="%link%" class="%type%">%htitle%</a>')
{
$opts['Hauthor_template'] = $this->opt['Hauthor_template'];
}
if($opts['Hauthor_template_no_anchor'] === 'Articles by: %htitle%')
{
$opts['Hauthor_template_no_anchor'] = $this->opt['Hauthor_template_no_anchor'];
}
}
}
//Upgrading to 5.5.0
if(version_compare($version, '5.5.0', '<'))
{
//Translate the old 'page' taxonomy type to BCN_POST_PARENT
if($this->opt['Spost_post_taxonomy_type'] === 'page')
{
$this->opt['Spost_post_taxonomy_type'] = 'BCN_POST_PARENT';
}
if(!isset($this->opt['Spost_post_taxonomy_referer']))
{
$this->opt['bpost_post_taxonomy_referer'] = false;
}
//Loop through all of the post types in the array
foreach($wp_post_types as $post_type)
{
//Check for non-public CPTs
if(!apply_filters('bcn_show_cpt_private', $post_type->public, $post_type->name))
{
continue;
}
//We only want custom post types
if(!$post_type->_builtin)
{
//Translate the old 'page' taxonomy type to BCN_POST_PARENT
if($this->opt['Spost_' . $post_type->name . '_taxonomy_type'] === 'page')
{
$this->opt['Spost_' . $post_type->name . '_taxonomy_type'] = 'BCN_POST_PARENT';
}
//Translate the old 'date' taxonomy type to BCN_DATE
if($this->opt['Spost_' . $post_type->name . '_taxonomy_type'] === 'date')
{
$this->opt['Spost_' . $post_type->name . '_taxonomy_type'] = 'BCN_DATE';
}
if(!isset($this->opt['Spost_' . $post_type->name . '_taxonomy_referer']))
{
$this->opt['bpost_' . $post_type->name . '_taxonomy_referer'] = false;
}
}
}
}
//Upgrading to 6.0.0
if(version_compare($version, '6.0.0', '<'))
{
//Loop through all of the post types in the array
foreach($wp_post_types as $post_type)
{
if(isset($this->opt['Spost_' . $post_type->name . '_taxonomy_type']))
{
$this->opt['Spost_' . $post_type->name . '_hierarchy_type'] = $this->opt['Spost_' . $post_type->name . '_taxonomy_type'];
unset($this->opt['Spost_' . $post_type->name . '_taxonomy_type']);
}
if(isset($this->opt['Spost_' . $post_type->name . '_taxonomy_display']))
{
$this->opt['Spost_' . $post_type->name . '_hierarchy_display'] = $this->opt['Spost_' . $post_type->name . '_taxonomy_display'];
unset($this->opt['Spost_' . $post_type->name . '_taxonomy_display']);
}
}
}
//Set the max title length to 20 if we are not limiting the title and the length was 0
if(!$opts['blimit_title'] && $opts['amax_title_length'] == 0)
{
$opts['amax_title_length'] = 20;
}
}
//Save the passed in opts to the object's option array
$this->opt = mtekk_adminKit::parse_args($opts, $this->opt);
//End with resetting up the options
breadcrumb_navxt::setup_options($this->opt);
}
function opts_update_prebk(&$opts)
{
//This may no longer be needed
breadcrumb_navxt::setup_options($opts);
$opts = apply_filters('bcn_opts_update_prebk', $opts);
}
/**
* help action hook function
*
* @return string
*
*/
function help()
{
$screen = get_current_screen();
//Exit early if the add_help_tab function doesn't exist
if(!method_exists($screen, 'add_help_tab'))
{
return;
}
//Add contextual help on current screen
if($screen->id == 'settings_page_' . $this->identifier)
{
$general_tab = '<p>' . esc_html__('Tips for the settings are located below select options.', 'breadcrumb-navxt') .
'</p><h5>' . esc_html__('Resources', 'breadcrumb-navxt') . '</h5><ul><li>' .
sprintf(esc_html__("%sTutorials and How Tos%s: There are several guides, tutorials, and how tos available on the author's website.", 'breadcrumb-navxt'),'<a title="' . esc_attr__('Go to the Breadcrumb NavXT tag archive.', 'breadcrumb-navxt') . '" href="https://mtekk.us/archives/tag/breadcrumb-navxt">', '</a>') . '</li><li>' .
sprintf(esc_html__('%sOnline Documentation%s: Check out the documentation for more indepth technical information.', 'breadcrumb-navxt'), '<a title="' . esc_attr__('Go to the Breadcrumb NavXT online documentation', 'breadcrumb-navxt') . '" href="https://mtekk.us/code/breadcrumb-navxt/breadcrumb-navxt-doc/">', '</a>') . '</li><li>' .
sprintf(esc_html__('%sReport a Bug%s: If you think you have found a bug, please include your WordPress version and details on how to reproduce the bug.', 'breadcrumb-navxt'),'<a title="' . esc_attr__('Go to the Breadcrumb NavXT support post for your version.', 'breadcrumb-navxt') . '" href="https://wordpress.org/support/plugin/breadcrumb-navxt/">', '</a>') . '</li></ul>' .
'<h5>' . esc_html__('Giving Back', 'breadcrumb-navxt') . '</h5><ul><li>' .
sprintf(esc_html__('%sDonate%s: Love Breadcrumb NavXT and want to help development? Consider buying the author a beer.', 'breadcrumb-navxt'),'<a title="' . esc_attr__('Go to PayPal to give a donation to Breadcrumb NavXT.', 'breadcrumb-navxt') . '" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=FD5XEU783BR8U&lc=US&item_name=Breadcrumb%20NavXT%20Donation&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">', '</a>') . '</li><li>' .
sprintf(esc_html__('%sTranslate%s: Is your language not available? Visit the Breadcrumb NavXT translation project on WordPress.org to start translating.', 'breadcrumb-navxt'),'<a title="' . esc_attr__('Go to the Breadcrumb NavXT translation project.', 'breadcrumb-navxt') . '" href="https://translate.wordpress.org/projects/wp-plugins/breadcrumb-navxt">', '</a>') . '</li></ul>';
$screen->add_help_tab(
array(
'id' => $this->identifier . '-base',
'title' => __('General', 'breadcrumb-navxt'),
'content' => $general_tab
));
$quickstart_tab = '<p>' . esc_html__('For the settings on this page to take effect, you must either use the included Breadcrumb NavXT widget, or place either of the code sections below into your theme.', 'breadcrumb-navxt') .
'</p><h5>' . esc_html__('Breadcrumb trail with separators', 'breadcrumb-navxt') . '</h5><pre><code>&lt;div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/"&gt;' . "
&lt;?php if(function_exists('bcn_display'))
{
bcn_display();
}?&gt;
&lt;/div&gt;</code></pre>" .
'<h5>' . esc_html__('Breadcrumb trail in list form', 'breadcrumb-navxt').'</h5><pre><code>&lt;ol class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/"&gt;'."
&lt;?php if(function_exists('bcn_display_list'))
{
bcn_display_list();
}?&gt;
&lt;/ol&gt;</code></pre>";
$screen->add_help_tab(
array(
'id' => $this->identifier . '-quick-start',
'title' => __('Quick Start', 'breadcrumb-navxt'),
'content' => $quickstart_tab
));
$styling_tab = '<p>' . esc_html__('Using the code from the Quick Start section above, the following CSS can be used as base for styling your breadcrumb trail.', 'breadcrumb-navxt') . '</p>' .
'<pre><code>.breadcrumbs
{
font-size: 1.1em;
color: #fff;
margin: 30px 0 0 10px;
position: relative;
float: left;
}</code></pre>';
$screen->add_help_tab(
array(
'id' => $this->identifier . '-styling',
'title' => __('Styling', 'breadcrumb-navxt'),
'content' => $styling_tab
));
$screen->add_help_tab(
array(
'id' => $this->identifier . '-import-export-reset',
'title' => __('Import/Export/Reset', 'breadcrumb-navxt'),
'content' => $this->import_form()
));
}
}
/**
* enqueue's the tab style sheet on the settings page
*/
function admin_styles()
{
wp_enqueue_style('mtekk_adminkit_tabs');
}
/**
* enqueue's the tab js and translation js on the settings page
*/
function admin_scripts()
{
//Enqueue ui-tabs
wp_enqueue_script('jquery-ui-tabs');
//Enqueue the admin tabs javascript
wp_enqueue_script('mtekk_adminkit_tabs');
//Load the translations for the tabs
wp_localize_script('mtekk_adminkit_tabs', 'objectL10n', array(
'mtad_uid' => 'bcn_admin',
'mtad_import' => __('Import', 'breadcrumb-navxt'),
'mtad_export' => __('Export', 'breadcrumb-navxt'),
'mtad_reset' => __('Reset', 'breadcrumb-navxt'),
));
//Enqueue the admin enable/disable groups javascript
wp_enqueue_script('mtekk_adminkit_engroups');
}
/**
* A message function that checks for the BCN_SETTINGS_* define statement
*/
function multisite_settings_warn()
{
if(is_multisite())
{
if(defined('BCN_SETTINGS_USE_LOCAL') && BCN_SETTINGS_USE_LOCAL)
{
}
else if(defined('BCN_SETTINGS_USE_NETWORK') && BCN_SETTINGS_USE_NETWORK)
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Your network settings will override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_is_nsiteoveride');
}
else if(defined('BCN_SETTINGS_FAVOR_LOCAL') && BCN_SETTINGS_FAVOR_LOCAL)
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Your network settings may override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_is_isitemayoveride');
}
else if(defined('BCN_SETTINGS_FAVOR_NETWORK') && BCN_SETTINGS_FAVOR_NETWORK)
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Your network settings may override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_is_nsitemayoveride');
}
//Fall through if no settings mode was set
else
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: No BCN_SETTINGS_* define statement found, defaulting to BCN_SETTINGS_USE_LOCAL.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_is_nosetting');
}
}
}
/**
* A message function that checks for deprecated settings that are set and warns the user
*/
function deprecated_settings_warn()
{
//We're deprecating the limit title length setting, let the user know the new method of accomplishing this
if(isset($this->opt['blimit_title']) && $this->opt['blimit_title'])
{
$this->messages[] = new mtekk_adminKit_message(sprintf(esc_html__('Warning: Your are using a deprecated setting "Title Length" (see Miscellaneous &gt; Deprecated), please %1$suse CSS instead%2$s.', 'breadcrumb-navxt'), '<a title="' . __('Go to the guide on trimming breadcrumb title lengths with CSS', 'breadcrumb-navxt') . '" href="https://mtekk.us/archives/guides/trimming-breadcrumb-title-lengths-with-css/">', '</a>'), 'warning');
}
}
/**
* Function checks the current site to see if the blog options should be disabled
*
* @return boool Whether or not the blog options should be disabled
*/
function maybe_disable_blog_options()
{
return (get_option('show_on_front') !== 'page' || get_option('page_for_posts') < 1);
}
/**
* Function checks the current site to see if the mainsite options should be disabled
*
* @return bool Whether or not the mainsite options should be disabled
*/
function maybe_disable_mainsite_options()
{
return !is_multisite();
}
/**
* The administrative page for Breadcrumb NavXT
*/
function admin_page()
{
global $wp_taxonomies, $wp_post_types;
$this->security();
//Do a check on deprecated settings
$this->deprecated_settings_warn();
//Do a check for multisite settings mode
$this->multisite_settings_warn();
do_action($this->unique_prefix . '_settings_pre_messages', $this->opt);
//Display our messages
$this->messages();
?>
<div class="wrap"><h1><?php echo $this->full_name; ?></h1>
<?php
//We exit after the version check if there is an action the user needs to take before saving settings
if(!$this->version_check($this->get_option($this->unique_prefix . '_version')))
{
return;
}
?>
<form action="<?php echo $this->admin_url(); ?>" method="post" id="bcn_admin-options">
<?php settings_fields('bcn_options');?>
<div id="hasadmintabs">
<fieldset id="general" class="bcn_options">
<legend class="screen-reader-text" data-title="<?php _e( 'A collection of settings most likely to be modified are located under this tab.', 'breadcrumb-navxt' );?>"><?php _e( 'General', 'breadcrumb-navxt' ); ?></legend>
<h2><?php _e('General', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Breadcrumb Separator', 'breadcrumb-navxt'), 'hseparator', '2', false, __('Placed in between each breadcrumb.', 'breadcrumb-navxt'));
do_action($this->unique_prefix . '_settings_general', $this->opt);
?>
</table>
<h2><?php _e('Current Item', 'breadcrumb-navxt'); ?></h2>
<table class="form-table adminkit-enset-top">
<?php
$this->input_check(__('Link Current Item', 'breadcrumb-navxt'), 'bcurrent_item_linked', __('Yes', 'breadcrumb-navxt'));
$this->input_check(_x('Paged Breadcrumb', 'Paged as in when on an archive or post that is split into multiple pages', 'breadcrumb-navxt'), 'bpaged_display', __('Place the page number breadcrumb in the trail.', 'breadcrumb-navxt'), false, __('Indicates that the user is on a page other than the first of a paginated archive or post.', 'breadcrumb-navxt'), 'adminkit-enset-ctrl adminkit-enset');
$this->textbox(_x('Paged Template', 'Paged as in when on an archive or post that is split into multiple pages', 'breadcrumb-navxt'), 'Hpaged_template', '4', false, __('The template for paged breadcrumbs.', 'breadcrumb-navxt'), 'adminkit-enset');
do_action($this->unique_prefix . '_settings_current_item', $this->opt);
?>
</table>
<h2><?php _e('Home Breadcrumb', 'breadcrumb-navxt'); ?></h2>
<table class="form-table adminkit-enset-top">
<?php
$this->input_check(__('Home Breadcrumb', 'breadcrumb-navxt'), 'bhome_display', __('Place the home breadcrumb in the trail.', 'breadcrumb-navxt'), false, '', 'adminkit-enset-ctrl adminkit-enset');
$this->textbox(__('Home Template', 'breadcrumb-navxt'), 'Hhome_template', '6', false, __('The template for the home breadcrumb.', 'breadcrumb-navxt'), 'adminkit-enset');
$this->textbox(__('Home Template (Unlinked)', 'breadcrumb-navxt'), 'Hhome_template_no_anchor', '4', false, __('The template for the home breadcrumb, used when the breadcrumb is not linked.', 'breadcrumb-navxt'), 'adminkit-enset');
do_action($this->unique_prefix . '_settings_home', $this->opt);
?>
</table>
<h2><?php _e('Blog Breadcrumb', 'breadcrumb-navxt'); ?></h2>
<table class="form-table adminkit-enset-top">
<?php
$this->input_check(__('Blog Breadcrumb', 'breadcrumb-navxt'), 'bblog_display', __('Place the blog breadcrumb in the trail.', 'breadcrumb-navxt'), $this->maybe_disable_blog_options(), '', 'adminkit-enset-ctrl adminkit-enset');
do_action($this->unique_prefix . '_settings_blog', $this->opt);
?>
</table>
<h2><?php _e('Mainsite Breadcrumb', 'breadcrumb-navxt'); ?></h2>
<table class="form-table adminkit-enset-top">
<?php
$this->input_check(__('Main Site Breadcrumb', 'breadcrumb-navxt'), 'bmainsite_display', __('Place the main site home breadcrumb in the trail in an multisite setup.', 'breadcrumb-navxt'), $this->maybe_disable_mainsite_options(), '', 'adminkit-enset-ctrl adminkit-enset');
$this->textbox(__('Main Site Home Template', 'breadcrumb-navxt'), 'Hmainsite_template', '6', $this->maybe_disable_mainsite_options(), __('The template for the main site home breadcrumb, used only in multisite environments.', 'breadcrumb-navxt'), 'adminkit-enset');
$this->textbox(__('Main Site Home Template (Unlinked)', 'breadcrumb-navxt'), 'Hmainsite_template_no_anchor', '4', $this->maybe_disable_mainsite_options(), __('The template for the main site home breadcrumb, used only in multisite environments and when the breadcrumb is not linked.', 'breadcrumb-navxt'), 'adminkit-enset');
do_action($this->unique_prefix . '_settings_mainsite', $this->opt);
?>
</table>
<?php do_action($this->unique_prefix . '_after_settings_tab_general', $this->opt); ?>
</fieldset>
<fieldset id="post" class="bcn_options">
<legend class="screen-reader-text" data-title="<?php _e( 'The settings for all post types (Posts, Pages, and Custom Post Types) are located under this tab.', 'breadcrumb-navxt' );?>"><?php _e( 'Post Types', 'breadcrumb-navxt' ); ?></legend>
<h2><?php _e('Posts', 'breadcrumb-navxt'); ?></h2>
<table class="form-table adminkit-enset-top">
<?php
$this->textbox(__('Post Template', 'breadcrumb-navxt'), 'Hpost_post_template', '6', false, __('The template for post breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Post Template (Unlinked)', 'breadcrumb-navxt'), 'Hpost_post_template_no_anchor', '4', false, __('The template for post breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
$this->input_check(__('Post Hierarchy Display', 'breadcrumb-navxt'), 'bpost_post_hierarchy_display', __('Show the hierarchy (specified below) leading to a post in the breadcrumb trail.', 'breadcrumb-navxt'), false, '', 'adminkit-enset-ctrl adminkit-enset');
$this->input_check(__('Post Hierarchy Use Parent First', 'breadcrumb-navxt'), 'bpost_post_hierarchy_parent_first', __('Use the parent of the post as the primary hierarchy, falling back to the hierarchy selected below when the parent hierarchy is exhausted.', 'breadcrumb-navxt'), false, '', 'adminkit-enset');
$this->input_check(__('Post Hierarchy Referer Influence', 'breadcrumb-navxt'), 'bpost_post_taxonomy_referer', __('Allow the referring page to influence the taxonomy selected for the hierarchy.', 'breadcrumb-navxt'), false, '', 'adminkit-enset');
?>
<tr valign="top">
<th scope="row">
<?php _e('Post Hierarchy', 'breadcrumb-navxt'); ?>
</th>
<td>
<?php
$this->input_radio('Spost_post_hierarchy_type', 'category', __('Categories'), false, 'adminkit-enset');
$this->input_radio('Spost_post_hierarchy_type', 'BCN_DATE', __('Dates', 'breadcrumb-navxt'), false, 'adminkit-enset');
$this->input_radio('Spost_post_hierarchy_type', 'post_tag', __('Tags'), false, 'adminkit-enset');
//We use the value 'page' but really, this will follow the parent post hierarchy
$this->input_radio('Spost_post_hierarchy_type', 'BCN_POST_PARENT', __('Post Parent', 'breadcrumb-navxt'), false, 'adminkit-enset');
//Loop through all of the taxonomies in the array
foreach($wp_taxonomies as $taxonomy)
{
//Check for non-public taxonomies
if(!apply_filters('bcn_show_tax_private', $taxonomy->public, $taxonomy->name, 'post'))
{
continue;
}
//We only want custom taxonomies
if(($taxonomy->object_type == 'post' || is_array($taxonomy->object_type) && in_array('post', $taxonomy->object_type)) && !$taxonomy->_builtin)
{
$this->input_radio('Spost_post_hierarchy_type', $taxonomy->name, mb_convert_case($taxonomy->label, MB_CASE_TITLE, 'UTF-8'), false, 'adminkit-enset');
}
}
?>
<p class="description"><?php esc_html_e('The hierarchy which the breadcrumb trail will show. Note that the "Post Parent" option may require an additional plugin to behave as expected since this is a non-hierarchical post type.', 'breadcrumb-navxt'); ?></p>
</td>
</tr>
</table>
<h2><?php _e('Pages', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Page Template', 'breadcrumb-navxt'), 'Hpost_page_template', '6', false, __('The template for page breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Page Template (Unlinked)', 'breadcrumb-navxt'), 'Hpost_page_template_no_anchor', '4', false, __('The template for page breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
$this->input_hidden('bpost_page_hierarchy_display');
$this->input_hidden('bpost_page_hierarchy_parent_first');
$this->input_hidden('Spost_page_hierarchy_type');
?>
</table>
<?php
//Loop through all of the post types in the array
foreach($wp_post_types as $post_type)
{
//Check for non-public CPTs
if(!apply_filters('bcn_show_cpt_private', $post_type->public, $post_type->name))
{
continue;
}
//We only want custom post types
if($post_type->name === 'attachment' || !$post_type->_builtin)
{
$singular_name_lc = mb_strtolower($post_type->labels->singular_name, 'UTF-8');
?>
<h2><?php echo $post_type->labels->singular_name; ?></h2>
<table class="form-table adminkit-enset-top">
<?php
$this->textbox(sprintf(__('%s Template', 'breadcrumb-navxt'), $post_type->labels->singular_name), 'Hpost_' . $post_type->name . '_template', '6', false, sprintf(__('The template for %s breadcrumbs.', 'breadcrumb-navxt'), $singular_name_lc));
$this->textbox(sprintf(__('%s Template (Unlinked)', 'breadcrumb-navxt'), $post_type->labels->singular_name), 'Hpost_' . $post_type->name . '_template_no_anchor', '4', false, sprintf(__('The template for %s breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'), $singular_name_lc));
$optid = mtekk_adminKit::get_valid_id('apost_' . $post_type->name . '_root');
?>
<tr valign="top">
<th scope="row">
<label for="<?php echo $optid;?>"><?php printf(esc_html__('%s Root Page', 'breadcrumb-navxt'), $post_type->labels->singular_name);?></label>
</th>
<td>
<?php wp_dropdown_pages(array('name' => $this->unique_prefix . '_options[apost_' . $post_type->name . '_root]', 'id' => $optid, 'echo' => 1, 'show_option_none' => __( '&mdash; Select &mdash;' ), 'option_none_value' => '0', 'selected' => $this->opt['apost_' . $post_type->name . '_root']));?>
</td>
</tr>
<?php
$this->input_check(sprintf(__('%s Archive Display', 'breadcrumb-navxt'), $post_type->labels->singular_name), 'bpost_' . $post_type->name . '_archive_display', sprintf(__('Show the breadcrumb for the %s post type archives in the breadcrumb trail.', 'breadcrumb-navxt'), $singular_name_lc), !$post_type->has_archive);
$this->input_check(sprintf(__('%s Hierarchy Display', 'breadcrumb-navxt'), $post_type->labels->singular_name), 'bpost_' . $post_type->name . '_hierarchy_display', sprintf(__('Show the hierarchy (specified below) leading to a %s in the breadcrumb trail.', 'breadcrumb-navxt'), $singular_name_lc), false, '', 'adminkit-enset-ctrl adminkit-enset');
$this->input_check(sprintf(__('%s Hierarchy Use Parent First', 'breadcrumb-navxt'), $post_type->labels->singular_name), 'bpost_' . $post_type->name . '_hierarchy_parent_first', sprintf(__('Use the parent of the %s as the primary hierarchy, falling back to the hierarchy selected below when the parent hierarchy is exhausted.', 'breadcrumb-navxt'), $singular_name_lc), false, '', 'adminkit-enset');
$this->input_check(sprintf(__('%s Hierarchy Referer Influence', 'breadcrumb-navxt'), $post_type->labels->singular_name), 'bpost_' . $post_type->name . '_taxonomy_referer', __('Allow the referring page to influence the taxonomy selected for the hierarchy.', 'breadcrumb-navxt'), false, '', 'adminkit-enset');
?>
<tr valign="top">
<th scope="row">
<?php printf(__('%s Hierarchy', 'breadcrumb-navxt'), $post_type->labels->singular_name); ?>
</th>
<td>
<?php
//We use the value 'page' but really, this will follow the parent post hierarchy
$this->input_radio('Spost_' . $post_type->name . '_hierarchy_type', 'BCN_POST_PARENT', __('Post Parent', 'breadcrumb-navxt'), false, 'adminkit-enset');
$this->input_radio('Spost_' . $post_type->name . '_hierarchy_type', 'BCN_DATE', __('Dates', 'breadcrumb-navxt'), false, 'adminkit-enset');
//Loop through all of the taxonomies in the array
foreach($wp_taxonomies as $taxonomy)
{
//Check for non-public taxonomies
if(!apply_filters('bcn_show_tax_private', $taxonomy->public, $taxonomy->name, $post_type->name))
{
continue;
}
//We only want custom taxonomies
if($taxonomy->object_type == $post_type->name || in_array($post_type->name, $taxonomy->object_type))
{
$this->input_radio('Spost_' . $post_type->name . '_hierarchy_type', $taxonomy->name, $taxonomy->labels->singular_name, false, 'adminkit-enset');
}
}
?>
<p class="description">
<?php
if($post_type->hierarchical)
{
esc_html_e('The hierarchy which the breadcrumb trail will show.', 'breadcrumb-navxt');
}
else
{
esc_html_e('The hierarchy which the breadcrumb trail will show. Note that the "Post Parent" option may require an additional plugin to behave as expected since this is a non-hierarchical post type.', 'breadcrumb-navxt');
}
?>
</p>
</td>
</tr>
</table>
<?php
}
}
do_action($this->unique_prefix . '_after_settings_tab_post', $this->opt);
?>
</fieldset>
<fieldset id="tax" class="bcn_options alttab">
<legend class="screen-reader-text" data-title="<?php _e( 'The settings for all taxonomies (including Categories, Tags, and custom taxonomies) are located under this tab.', 'breadcrumb-navxt' );?>"><?php _e( 'Taxonomies', 'breadcrumb-navxt' ); ?></legend>
<h2><?php _e('Categories', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Category Template', 'breadcrumb-navxt'), 'Htax_category_template', '6', false, __('The template for category breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Category Template (Unlinked)', 'breadcrumb-navxt'), 'Htax_category_template_no_anchor', '4', false, __('The template for category breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
?>
</table>
<h2><?php _e('Tags', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Tag Template', 'breadcrumb-navxt'), 'Htax_post_tag_template', '6', false, __('The template for tag breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Tag Template (Unlinked)', 'breadcrumb-navxt'), 'Htax_post_tag_template_no_anchor', '4', false, __('The template for tag breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
?>
</table>
<h2><?php _e('Post Formats', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Post Format Template', 'breadcrumb-navxt'), 'Htax_post_format_template', '6', false, __('The template for post format breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Post Format Template (Unlinked)', 'breadcrumb-navxt'), 'Htax_post_format_template_no_anchor', '4', false, __('The template for post_format breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
?>
</table>
<?php
//Loop through all of the taxonomies in the array
foreach($wp_taxonomies as $taxonomy)
{
//Check for non-public taxonomies
if(!apply_filters('bcn_show_tax_private', $taxonomy->public, $taxonomy->name, null))
{
continue;
}
//We only want custom taxonomies
if(!$taxonomy->_builtin)
{
$label_lc = mb_strtolower($taxonomy->label, 'UTF-8');
?>
<h3><?php echo mb_convert_case($taxonomy->label, MB_CASE_TITLE, 'UTF-8'); ?></h3>
<table class="form-table">
<?php
$this->textbox(sprintf(__('%s Template', 'breadcrumb-navxt'), $taxonomy->labels->singular_name), 'Htax_' . $taxonomy->name . '_template', '6', false, sprintf(__('The template for %s breadcrumbs.', 'breadcrumb-navxt'), $label_lc));
$this->textbox(sprintf(__('%s Template (Unlinked)', 'breadcrumb-navxt'), $taxonomy->labels->singular_name), 'Htax_' . $taxonomy->name . '_template_no_anchor', '4', false, sprintf(__('The template for %s breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'), $label_lc));
?>
</table>
<?php
}
}
do_action($this->unique_prefix . '_after_settings_tab_taxonomy', $this->opt); ?>
</fieldset>
<fieldset id="miscellaneous" class="bcn_options">
<legend class="screen-reader-text" data-title="<?php _e( 'The settings for author and date archives, searches, and 404 pages are located under this tab.', 'breadcrumb-navxt' );?>"><?php _e( 'Miscellaneous', 'breadcrumb-navxt' ); ?></legend>
<h2><?php _e('Author Archives', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Author Template', 'breadcrumb-navxt'), 'Hauthor_template', '6', false, __('The template for author breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Author Template (Unlinked)', 'breadcrumb-navxt'), 'Hauthor_template_no_anchor', '4', false, __('The template for author breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
$this->input_select(__('Author Display Format', 'breadcrumb-navxt'), 'Sauthor_name', array("display_name", "nickname", "first_name", "last_name"), false, __('display_name uses the name specified in "Display name publicly as" under the user profile the others correspond to options in the user profile.', 'breadcrumb-navxt'));
$optid = mtekk_adminKit::get_valid_id('aauthor_root');
?>
<tr valign="top">
<th scope="row">
<label for="<?php echo $optid;?>"><?php esc_html_e('Author Root Page', 'breadcrumb-navxt');?></label>
</th>
<td>
<?php wp_dropdown_pages(array('name' => $this->unique_prefix . '_options[aauthor_root]', 'id' => $optid, 'echo' => 1, 'show_option_none' => __( '&mdash; Select &mdash;' ), 'option_none_value' => '0', 'selected' => $this->opt['aauthor_root']));?>
</td>
</tr>
</table>
<h2><?php _e('Miscellaneous', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<?php
$this->textbox(__('Date Template', 'breadcrumb-navxt'), 'Hdate_template', '6', false, __('The template for date breadcrumbs.', 'breadcrumb-navxt'));
$this->textbox(__('Date Template (Unlinked)', 'breadcrumb-navxt'), 'Hdate_template_no_anchor', '4', false, __('The template for date breadcrumbs, used only when the breadcrumb is not linked.', 'breadcrumb-navxt'));
$this->textbox(__('Search Template', 'breadcrumb-navxt'), 'Hsearch_template', '6', false, __('The anchor template for search breadcrumbs, used only when the search results span several pages.', 'breadcrumb-navxt'));
$this->textbox(__('Search Template (Unlinked)', 'breadcrumb-navxt'), 'Hsearch_template_no_anchor', '4', false, __('The anchor template for search breadcrumbs, used only when the search results span several pages and the breadcrumb is not linked.', 'breadcrumb-navxt'));
$this->input_text(__('404 Title', 'breadcrumb-navxt'), 'S404_title', 'regular-text');
$this->textbox(__('404 Template', 'breadcrumb-navxt'), 'H404_template', '4', false, __('The template for 404 breadcrumbs.', 'breadcrumb-navxt'));
?>
</table>
<h2><?php _e('Deprecated', 'breadcrumb-navxt'); ?></h2>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php esc_html_e('Title Length', 'breadcrumb-navxt'); ?>
</th>
<td>
<label>
<input name="bcn_options[blimit_title]" type="checkbox" id="blimit_title" value="true" <?php checked(true, $this->opt['blimit_title']); ?> />
<?php printf(esc_html__('Limit the length of the breadcrumb title. (Deprecated, %suse CSS instead%s)', 'breadcrumb-navxt'), '<a title="' . esc_attr__('Go to the guide on trimming breadcrumb title lengths with CSS', 'breadcrumb-navxt') . '" href="https://mtekk.us/archives/guides/trimming-breadcrumb-title-lengths-with-css/">', '</a>');?>
</label><br />
<ul>
<li>
<label for="amax_title_length">
<?php esc_html_e('Max Title Length: ','breadcrumb-navxt');?>
<input type="number" name="bcn_options[amax_title_length]" id="amax_title_length" min="1" step="1" value="<?php echo esc_html($this->opt['amax_title_length'], ENT_COMPAT, 'UTF-8'); ?>" class="small-text" />
</label>
</li>
</ul>
</td>
</tr>
</table>
<?php do_action($this->unique_prefix . '_after_settings_tab_miscellaneous', $this->opt); ?>
</fieldset>
<?php do_action($this->unique_prefix . '_after_settings_tabs', $this->opt); ?>
</div>
<p class="submit"><input type="submit" class="button-primary" name="bcn_admin_options" value="<?php esc_attr_e('Save Changes') ?>" /></p>
</form>
</div>
<?php
}
}

View File

@@ -0,0 +1,283 @@
<?php
/*
Copyright 2007-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
//The breadcrumb class
class bcn_breadcrumb
{
//Our member variables
const version = '6.4.0';
//The main text that will be shown
protected $title;
//The breadcrumb's template, used durring assembly
protected $template;
//The breadcrumb's no anchor template, used durring assembly when there won't be an anchor
protected $template_no_anchor;
//Boolean, is this element linked
protected $linked = false;
//The link the breadcrumb leads to, null if $linked == false
protected $url;
//The corresponding resource ID
protected $id = null;
private $_title = null;
//The type of this breadcrumb
protected $type;
protected $allowed_html = array();
const default_template_no_anchor = '<span class="%type%">%htitle%</span>';
/**
* The enhanced default constructor, ends up setting all parameters via the set_ functions
*
* @param string $title (optional) The title of the breadcrumb
* @param string $template (optional) The html template for the breadcrumb
* @param string $type (optional) The breadcrumb type
* @param string $url (optional) The url the breadcrumb links to
* @param bool $linked (optional) Whether or not the breadcrumb uses the linked or unlinked template
*/
public function __construct($title = '', $template = '', array $type = array(), $url = '', $id = null, $linked = false)
{
//Filter allowed_html array to allow others to add acceptable tags
$this->allowed_html = apply_filters('bcn_allowed_html', wp_kses_allowed_html('post'));
//The breadcrumb type
$this->type = $type;
//Set the resource id
$this->set_id($id);
//Set the title
$this->set_title($title);
//Set the default anchorless templates value
$this->template_no_anchor = bcn_breadcrumb::default_template_no_anchor;
//If we didn't get a good template, use a default template
if($template == null)
{
$this->set_template(bcn_breadcrumb::get_default_template());
}
//If something was passed in template wise, update the appropriate internal template
else
{
if($linked)
{
$this->set_template($template);
}
else
{
$this->template_no_anchor = wp_kses(apply_filters('bcn_breadcrumb_template_no_anchor', $template, $this->type, $this->id), $this->allowed_html);
$this->set_template(bcn_breadcrumb::get_default_template());
}
}
//Always null if unlinked
$this->set_url($url);
$this->set_linked($linked);
}
/**
* Function to return the translated default template
*
* @return string The default breadcrumb template
*/
static public function get_default_template()
{
return sprintf('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="%1$s" href="%%link%%" class="%%type%%" bcn-aria-current><span property="name">%%htitle%%</span></a><meta property="position" content="%%position%%"></span>', esc_attr__('Go to %title%.','breadcrumb-navxt'));
}
/**
* Function to set the protected title member
*
* @param string $title The title of the breadcrumb
*/
public function set_title($title)
{
//Set the title
$this->title = apply_filters('bcn_breadcrumb_title', $title, $this->type, $this->id);
$this->_title = $this->title;
}
/**
* Function to get the protected title member
*
* @return $this->title
*/
public function get_title()
{
//Return the title
return $this->title;
}
/**
* Function to set the internal URL variable
*
* @param string $url the url to link to
*/
public function set_url($url)
{
$url = trim($url);
$this->url = apply_filters('bcn_breadcrumb_url', $url, $this->type, $this->id);
}
/**
* Function to se tthe internal breadcrumb linked status
*
* @param bool $linked whether or not the breadcrumb uses the linked or unlinked template
*/
public function set_linked($linked)
{
$this->linked = $linked;
}
/**
* Function to set the internal breadcrumb template
*
* @param string $template the template to use durring assebly
*/
public function set_template($template)
{
//Assign the breadcrumb template
$this->template = wp_kses(apply_filters('bcn_breadcrumb_template', $template, $this->type, $this->id), $this->allowed_html);
}
/**
* Function to set the internal breadcrumb ID
*
* @param int $id the id of the resource this breadcrumb represents
*/
public function set_id($id)
{
$this->id = $id;
}
/**
* Function to get the internal breadcrumb ID
*
* @return int the id of the resource this breadcrumb represents
*/
public function get_id()
{
return $this->id;
}
/**
* Append a type entry to the type array
*
* @param string $type the type to append
*/
public function add_type($type)
{
$this->type[] = $type;
}
/**
* Return the type array
*
* @return array The type array
*/
public function get_types()
{
return $this->type;
}
/**
* This function will intelligently trim the title to the value passed in through $max_length. This function is deprecated, do not call.
*
* @param int $max_length of the title.
* @deprecated since 5.2.0
*/
public function title_trim($max_length)
{
_deprecated_function(__FUNCTION__, '5.2.0');
//To preserve HTML entities, must decode before splitting
$this->title = html_entity_decode($this->title, ENT_COMPAT, 'UTF-8');
$title_length = mb_strlen($this->title);
//Make sure that we are not making it longer with that ellipse
if($title_length > $max_length && ($title_length + 2) > $max_length)
{
//Trim the title
$this->title = mb_substr($this->title, 0, $max_length - 1);
//Make sure we can split, but we want to limmit to cutting at max an additional 25%
if(mb_strpos($this->title, ' ', .75 * $max_length) > 0)
{
//Don't split mid word
while(mb_substr($this->title,-1) != ' ')
{
$this->title = mb_substr($this->title, 0, -1);
}
}
//Remove the whitespace at the end and add the hellip
$this->title = rtrim($this->title) . html_entity_decode('&hellip;', ENT_COMPAT, 'UTF-8');
}
//Return to the encoded version of all HTML entities (keep standards complance)
$this->title = force_balance_tags(htmlentities($this->title, ENT_COMPAT, 'UTF-8'));
}
/**
* Assembles the parts of the breadcrumb into a html string
*
* @param bool $linked Allow the output to contain anchors?
* @param int $position The position of the breadcrumb in the trail (between 1 and n when there are n breadcrumbs in the trail)
* @param bool $is_current_item Whether or not this breadcrumb represents the current item
*
* @return string The compiled breadcrumb string
*/
public function assemble($linked, $position, $is_current_item = false)
{
if($is_current_item)
{
$aria_current_str = 'aria-current="page"';
}
else
{
$aria_current_str = '';
}
//Build our replacements array
$replacements = array(
'%title%' => esc_attr(strip_tags($this->title)),
'%link%' => esc_url($this->url),
'%htitle%' => $this->title,
'%type%' => apply_filters('bcn_breadcrumb_types', $this->type, $this->id),
'%ftitle%' => esc_attr(strip_tags($this->_title)),
'%fhtitle%' => $this->_title,
'%position%' => $position,
'bcn-aria-current' => $aria_current_str
);
//The type may be an array, implode it if that is the case
if(is_array($replacements['%type%']))
{
array_walk($replacements['%type%'], 'sanitize_html_class');
$replacements['%type%'] = esc_attr(implode(' ', $replacements['%type%']));
}
else
{
_doing_it_wrong(__CLASS__ . '::' . __FUNCTION__, __('bcn_breadcrumb::type must be an array', 'breadcrumb-navxt'), '6.0.2');
}
$replacements = apply_filters('bcn_template_tags', $replacements, $this->type, $this->id);
//If we are linked we'll need to use the normal template
if($this->linked && $linked)
{
//Return the assembled breadcrumb string
return str_replace(array_keys($replacements), $replacements, $this->template);
}
//Otherwise we use the no anchor template
else
{
//Return the assembled breadcrumb string
return str_replace(array_keys($replacements), $replacements, $this->template_no_anchor);
}
}
/**
* Assembles the parts of the breadcrumb into a JSON-LD ready object-array
*
* @param int $position The position of the breadcrumb in the trail (between 1 and n when there are n breadcrumbs in the trail)
*
* @return array(object) The prepared array object ready to pass into json_encode
*/
public function assemble_json_ld($position)
{
return (object) apply_filters('bcn_breadcrumb_assembled_json_ld_array', array(
'@type' => 'ListItem',
'position' => $position,
'item' => (object)array(
'@id' => esc_url($this->url),
'name' => esc_attr($this->title))
), $this->type, $this->id);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,193 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
//Include admin base class
if(!class_exists('bcn_admin'))
{
require_once(dirname(__FILE__) . '/class.bcn_admin.php');
}
/**
* The administrative interface class
*
*/
class bcn_network_admin extends bcn_admin
{
const version = '6.4.0';
protected $full_name = 'Breadcrumb NavXT Network Settings';
protected $access_level = 'manage_network_options';
/**
* Administrative interface class default constructor
* @param bcn_breadcrumb_trail $breadcrumb_trail a breadcrumb trail object
* @param string $basename The basename of the plugin
*/
function __construct(bcn_breadcrumb_trail &$breadcrumb_trail, $basename)
{
//We're going to make sure we load the parent's constructor
parent::__construct($breadcrumb_trail, $basename);
//Change to the proper name
$this->full_name = __('Breadcrumb NavXT Network Settings', 'breadcrumb-navxt');
//Remove the hook added by the parent as we don't want this classes settings page everywhere
remove_action('admin_menu', array($this, 'add_page'));
//Replace with the network_admin hook
add_action('network_admin_menu', array($this, 'add_page'));
}
/**
* admin initialization callback function
*
* is bound to wordpress action 'admin_init' on instantiation
*
* @since 3.2.0
* @return void
*/
function init()
{
//We're going to make sure we run the parent's version of this function as well
parent::init();
}
function wp_loaded()
{
parent::wp_loaded();
}
/**
* Return the URL of the settings page for the plugin
*/
function admin_url()
{
return admin_url('network/settings.php?page=' . $this->identifier);
}
/**
* Adds the adminpage the menu and the nice little settings link
*/
function add_page()
{
//Add the submenu page to "settings" menu
$hookname = add_submenu_page('settings.php', $this->full_name, $this->short_name, $this->access_level, $this->identifier, array($this, 'admin_page'));
// check capability of user to manage options (access control)
if(current_user_can($this->access_level))
{
//Register admin_head-$hookname callback
add_action('admin_head-' . $hookname, array($this, 'admin_head'));
//Register admin_print_styles-$hookname callback
add_action('admin_print_styles-' . $hookname, array($this, 'admin_styles'));
//Register admin_print_scripts-$hookname callback
add_action('admin_print_scripts-' . $hookname, array($this, 'admin_scripts'));
//Register Help Output
add_action('load-' . $hookname, array($this, 'help'));
}
}
/**
* Have to hook into get_option and replace with network wide alternate
*
* @param string $option The name of the option to retrieve
* @return mixed The value of the option
*/
function get_option($option)
{
return get_site_option($option);
}
/**
* Have to hook into update_option and replace with network wide alternate
*
* @param string $option The name of the option to update
* @param mixed $newvalue The new value to set the option to
*
*/
function update_option($option, $newvalue)
{
return update_site_option($option, $newvalue);
}
/**
* Have to hook into add_option and replace with network wide alternate
*
* @param string $option The name of the option to update
* @param mixed $value The new value to set the option to
* @param null $deprecated Deprecated parameter
* @param string $autoload Whether or not to autoload the option, it's a string because WP is special
*
*/
function add_option($option, $value = '', $deprecated = '', $autoload = 'yes')
{
return add_site_option($option, $value);
}
/**
* Have to hook into delete_option and replace with network wide alternate
*
* @param string $option The name of the option to delete
*/
function delete_option($option)
{
return delete_site_option($option);
}
/**
* A message function that checks for the BCN_SETTINGS_* define statement
*/
function multisite_settings_warn()
{
if(is_multisite())
{
if(defined('BCN_SETTINGS_USE_LOCAL') && BCN_SETTINGS_USE_LOCAL)
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Individual site settings will override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_ns_isiteoveride');
}
else if(defined('BCN_SETTINGS_USE_NETWORK') && BCN_SETTINGS_USE_NETWORK)
{
}
else if(defined('BCN_SETTINGS_FAVOR_LOCAL') && BCN_SETTINGS_FAVOR_LOCAL)
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Individual site settings may override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_ns_isitemayoveride');
}
else if(defined('BCN_SETTINGS_FAVOR_NETWORK') && BCN_SETTINGS_FAVOR_NETWORK)
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Individual site settings may override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_ns_nsmayoveride');
}
//Fall through if no settings mode was set
else
{
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: No BCN_SETTINGS_* define statement found, defaulting to BCN_SETTINGS_USE_LOCAL.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_ns_nosetting');
$this->messages[] = new mtekk_adminKit_message(esc_html__('Warning: Individual site settings will override any settings set in this page.', 'breadcrumb-navxt'), 'warning', true, $this->unique_prefix . '_msg_ns_isiteoveride');
}
}
}
/**
* A message function that checks for deprecated settings that are set and warns the user
*/
function deprecated_settings_warn()
{
parent::deprecated_settings_warn();
}
/**
* Function checks the current site to see if the blog options should be disabled
*
* @return boool Whether or not the blog options should be disabled
*/
function maybe_disable_blog_options()
{
return false;
}
/**
* Function checks the current site to see if the mainsite options should be disabled
*
* @return bool Whether or not the mainsite options should be disabled
*/
function maybe_disable_mainsite_options()
{
return false;
}
}

View File

@@ -0,0 +1,251 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
//Do a PHP version check, require 5.3 or newer
if(version_compare(phpversion(), '5.3.0', '<'))
{
//Only purpose of this function is to echo out the PHP version error
function bcn_phpold()
{
printf('<div class="notice notice-error"><p>' . __('Your PHP version is too old, please upgrade to a newer version. Your version is %1$s, Breadcrumb NavXT requires %2$s', 'breadcrumb-navxt') . '</p></div>', phpversion(), '5.3.0');
}
//If we are in the admin, let's print a warning then return
if(is_admin())
{
add_action('admin_notices', 'bcn_phpold');
}
return;
}
class bcn_rest_controller
{
const version = '1';
protected $unique_prefix = 'bcn';
protected $breadcrumb_trail = null;
protected $methods = array('GET', 'OPTIONS');
/**
* Default constructor
*
* @param bcn_breadcrumb_trail $breadcrumb_trail An instance of a bcn_breadcrumb_trail object to use for everything
* @param string $unique_prefix The unique prefix to use for the API endpoint
*/
public function __construct(bcn_breadcrumb_trail $breadcrumb_trail, $unique_prefix)
{
$this->breadcrumb_trail = $breadcrumb_trail;
$this->unique_prefix = $unique_prefix;
add_action('rest_api_init', array($this, 'register_routes'));
}
/**
* A quick wrapper for register_rest_route to add our inclusion filter
*
* @param string $namespace The first URL segment after core prefix. Should be unique
* @param string $route The base URL for route being added
* @param array $args Optional. Either an array of options for the endpoint, or an array of arrays for
* multiple methods. Default empty array.
* @param bool $override Optional. If the route already exists, should we override it?
* @param string $endpoint The endpoint name passed into the bcn_register_rest_endpoint filter
* @return boolean True on success, false on error.
*/
protected function register_rest_route($namespace, $route, $args = array(), $override = false, $endpoint)
{
if(apply_filters('bcn_register_rest_endpoint', false, $endpoint, $this::version, $this->methods))
{
return register_rest_route($namespace, $route, $args, $override);
}
return false;
}
public function register_routes()
{
$this->register_rest_route( $this->unique_prefix . '/v' . $this::version, '/post/(?P<id>[\d]+)', array(
'args' => array(
'id' => array(
'description' => __('The ID of the post (any type) to retrieve the breadcrumb trail for.', 'breadcrumb-navxt'),
'type' => 'integer',
'required' => true,
'validate_callback' => array($this, 'validate_id')
)
),
'methods' => $this->methods,
'callback' => array($this, 'display_rest_post'),
'permission_callback' => array($this, 'display_rest_post_permissions_check')
), false, 'post'
);
$this->register_rest_route( $this->unique_prefix . '/v' . $this::version, '/term/(?P<taxonomy>[\w-]+)/(?P<id>[\d]+)', array(
'args' => array(
'id' => array(
'description' => __('The ID of the term to retrieve the breadcrumb trail for.', 'breadcrumb-navxt'),
'type' => 'integer',
'required' => true,
'validate_callback' => array($this, 'validate_id')
),
'taxonomy' => array(
'description' => __('The taxonomy of the term to retrieve the breadcrumb trail for.', 'breadcrumb-navxt'),
'type' => 'string',
'required' => true,
'validate_callback' => array($this, 'validate_taxonomy')
)
),
'methods' => $this->methods,
'callback' => array($this, 'display_rest_term')
), false, 'term'
);
$this->register_rest_route( $this->unique_prefix . '/v' . $this::version, '/author/(?P<id>\d+)', array(
'args' => array(
'id' => array(
'description' => __('The ID of the author to retrieve the breadcrumb trail for.', 'breadcrumb-navxt'),
'type' => 'integer',
'required' => true,
'validate_callback' => array($this, 'validate_id')
)
),
'methods' => $this->methods,
'callback' => array($this, 'display_rest_author')
), false, 'author'
);
}
/**
* Checks to see if the request ID looks like it could be an ID (numeric and greater than 0)
*
* @param mixed $param The parameter to validate
* @param WP_REST_Request $request REST API request data
* @param string $key The paramter key
* @return bool Whether or not the ID is valid (or atleast looks valid)
*/
public function validate_id($param, $request, $key)
{
return is_numeric($param) && absint($param) > 0;
}
/**
* Checks to see if the request taxonomy is a valid taxonomy
*
* @param mixed $param The parameter to validate
* @param WP_REST_Request $request REST API request data
* @param string $key The paramter key
* @return bool Whether or not the ID is valid (or atleast looks valid)
*/
public function validate_taxonomy($param, $request, $key)
{
return taxonomy_exists(esc_attr($param));
}
/**
* Check permissions for the post
*
* @param WP_REST_Request $request The request to check the permissions on
* @return bool | WP_Error Whether or not the user can view the requested post
*/
public function display_rest_post_permissions_check(WP_REST_Request $request)
{
$post = get_post(absint($request->get_param('id')));
if($post === null)
{
return true;
}
return $this->check_post_read_permission($post);
}
/**
* Check to ensure the current user can read the post (and subsequently view its breadcrumb trail)
*
* @param WP_Post $post The post to check if the current user can view the breadcrumb trail for
* @return bool Whether or not the post should be readable
*/
public function check_post_read_permission($post)
{
if(!($post instanceof WP_Post))
{
return false;
}
$post_type = get_post_type_object($post->post_type);
if(empty($post_type) || empty($post_type->show_in_rest))
{
return false;
}
if($post->post_status === 'publish' || current_user_can($post_type->cap->read_post, $post->ID))
{
return true;
}
$post_status_obj = get_post_status_object($post->post_status);
if($post_status_obj && $post_status_obj->public)
{
return true;
}
if($post->post_status === 'inherit' && $post->post_parent > 0)
{
$parent = get_post($post->post_parent);
if($parent)
{
return $this->check_post_read_permission($parent);
}
}
if($post->post_status === 'inherit')
{
return true;
}
return false;
}
/**
* Breadcrumb trail handler for REST requests for post breadcrumb trails
*
* @param WP_REST_Request $request REST API request data
* @return STD_Object Basic object data of the Schema.org Breadcrumb List compatible breadcrumb trail
*/
public function display_rest_post(WP_REST_Request $request)
{
$post = get_post(absint($request->get_param('id')));
if($post instanceof WP_Post)
{
$this->breadcrumb_trail->breadcrumbs = array();
//Generate the breadcrumb trail
$this->breadcrumb_trail->fill_REST($post);
return $this->breadcrumb_trail->display_json_ld(false);
}
}
/**
* Breadcrumb trail handler for REST requests for term breadcrumb trails
*
* @param WP_REST_Request $request REST API request data
* @return STD_Object Basic object data of the Schema.org Breadcrumb List compatible breadcrumb trail
*/
public function display_rest_term(WP_REST_Request $request)
{
$term = get_term(absint($request->get_param('id')), esc_attr($request->get_param('taxonomy')));
if($term instanceof WP_Term)
{
$this->breadcrumb_trail->breadcrumbs = array();
//Generate the breadcrumb trail
$this->breadcrumb_trail->fill_REST($term);
return $this->breadcrumb_trail->display_json_ld(false);
}
}
/**
* Breadcrumb trail handler for REST requests for term breadcrumb trails
*
* @param WP_REST_Request $request REST API request data
* @return STD_Object Basic object data of the Schema.org Breadcrumb List compatible breadcrumb trail
*/
public function display_rest_author(WP_REST_Request $request)
{
$user = get_user_by('ID', absint($request->get_param('id')), esc_attr($request->get_param('taxonomy')));
if($user instanceof WP_User)
{
$this->breadcrumb_trail->breadcrumbs = array();
//Generate the breadcrumb trail
$this->breadcrumb_trail->fill_REST($user);
return $this->breadcrumb_trail->display_json_ld(false);
}
}
}

View File

@@ -0,0 +1,141 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/includes/block_direct_access.php');
class bcn_widget extends WP_Widget
{
const version = '6.4.0';
protected $allowed_html = array();
protected $defaults = array('title' => '', 'pretext' => '', 'type' => 'microdata', 'linked' => true, 'reverse' => false, 'front' => false, 'force' => false);
//Default constructor
function __construct()
{
//Filter allowed_html array to allow others to add acceptable tags
$this->allowed_html = apply_filters('bcn_allowed_html', wp_kses_allowed_html('post'));
//@see https://core.trac.wordpress.org/ticket/10527
if(!is_textdomain_loaded('breadcrumb-navxt'))
{
load_plugin_textdomain('breadcrumb-navxt', false, 'breadcrumb-navxt/languages');
}
$ops = array('classname' => 'widget_breadcrumb_navxt', 'description' => __('Adds a breadcrumb trail to your sidebar', 'breadcrumb-navxt'));
parent::__construct('bcn_widget', 'Breadcrumb NavXT', $ops);
}
function widget($args, $instance)
{
//Make sure we grab defaults in the case of out of date instance settings being sent
$instance = wp_parse_args((array) $instance, $this->defaults);
$instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$instance['pretext'] = apply_filters('widget_text', $instance['pretext'], $instance);
$instance['pretext'] = apply_filters('bcn_widget_pretext', $instance['pretext'], $instance);
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
//A bit of a hack but we need the DB settings to know if we should exit early
$opt = get_option('bcn_options');
//If we are on the front page and don't display on the front, return early
if($instance['front'] && is_front_page() && !(is_paged() && $opt['bpaged_display']))
{
return;
}
//Manditory before widget junk
echo $args['before_widget'];
if(!empty($title))
{
echo $args['before_title'] . $title . $args['after_title'];
}
//We'll want to switch between the two breadcrumb output types
if($instance['type'] === 'list')
{
//Display the list output breadcrumb
echo wp_kses($instance['pretext'], $this->allowed_html) . '<ol class="breadcrumb_trail breadcrumbs">';
bcn_display_list(false, $instance['linked'], $instance['reverse'], $instance['force']);
echo '</ol>';
}
else if($instance['type'] === 'microdata' || $instance['type'] === 'breadcrumblist_rdfa')
{
echo '<div class="breadcrumbs" vocab="https://schema.org/" typeof="BreadcrumbList">' . wp_kses($instance['pretext'], $this->allowed_html);
//Display the regular output breadcrumb
bcn_display(false, $instance['linked'], $instance['reverse'], $instance['force']);
echo '</div>';
}
else if($instance['type'] === 'breadcrumblist_microdata')
{
echo '<div class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">' . wp_kses($instance['pretext'], $this->allowed_html);
//Display the regular output breadcrumb
bcn_display(false, $instance['linked'], $instance['reverse'], $instance['force']);
echo '</div>';
}
else if($instance['type'] === 'plain')
{
//Display the pretext
echo wp_kses($instance['pretext'], $this->allowed_html);
//Display the regular output breadcrumb
bcn_display(false, $instance['linked'], $instance['reverse'], $instance['force']);
}
else
{
//If we recieved a type that is not of the built in displays, it must be relegated to an extension plugin
do_action('bcn_widget_display_trail', $instance);
}
//Manditory after widget junk
echo $args['after_widget'];
}
function update($new_instance, $old_instance)
{
//Filter out anything that could be invalid
$old_instance['title'] = strip_tags($new_instance['title']);
$old_instance['pretext'] = wp_kses($new_instance['pretext'], $this->allowed_html);
$old_instance['type'] = strip_tags($new_instance['type']);
$old_instance['linked'] = isset($new_instance['linked']);
$old_instance['reverse'] = isset($new_instance['reverse']);
$old_instance['front'] = isset($new_instance['front']);
$old_instance['force'] = isset($new_instance['force']);
return $old_instance;
}
function form($instance)
{
$instance = wp_parse_args((array) $instance, $this->defaults);?>
<p>
<label for="<?php echo esc_attr($this->get_field_id('title')); ?>"> <?php _e('Title:', 'breadcrumb-navxt'); ?></label>
<input class="widefat" type="text" name="<?php echo esc_attr($this->get_field_name('title')); ?>" id="<?php echo esc_attr($this->get_field_id('title')); ?>" value="<?php echo esc_attr($instance['title']);?>" />
</p>
<p>
<label for="<?php echo esc_attr($this->get_field_id('pretext')); ?>"> <?php _e('Text to show before the trail:', 'breadcrumb-navxt'); ?></label>
<input class="widefat" type="text" name="<?php echo esc_attr($this->get_field_name('pretext')); ?>" id="<?php echo esc_attr($this->get_field_id('pretext')); ?>" value="<?php echo esc_attr($instance['pretext']);?>" />
</p>
<p>
<label for="<?php echo esc_attr($this->get_field_id('type')); ?>"> <?php _e('Output trail as:', 'breadcrumb-navxt'); ?></label>
<select name="<?php echo esc_attr($this->get_field_name('type')); ?>" id="<?php echo esc_attr($this->get_field_id('type')); ?>">
<option value="list" <?php selected('list', $instance['type']);?>><?php _e('List', 'breadcrumb-navxt'); ?></option>
<option value="microdata" <?php selected('microdata', $instance['type']);?>><?php _e('Schema.org BreadcrumbList (RDFa)', 'breadcrumb-navxt'); ?></option>
<option value="breadcrumblist_microdata" <?php selected('breadcrumblist_microdata', $instance['type']);?>><?php _e('Schema.org BreadcrumbList (microdata)', 'breadcrumb-navxt'); ?></option>
<option value="plain" <?php selected('plain', $instance['type']);?>><?php _e('Plain', 'breadcrumb-navxt'); ?></option>
<?php do_action('bcn_widget_display_types', $instance);?>
</select>
</p>
<p>
<input class="checkbox" type="checkbox" name="<?php echo esc_attr($this->get_field_name('linked')); ?>" id="<?php echo esc_attr($this->get_field_id('linked')); ?>" value="true" <?php checked(true, $instance['linked']);?> />
<label for="<?php echo esc_attr($this->get_field_id('linked')); ?>"> <?php _e('Link the breadcrumbs', 'breadcrumb-navxt'); ?></label><br />
<input class="checkbox" type="checkbox" name="<?php echo esc_attr($this->get_field_name('reverse')); ?>" id="<?php echo esc_attr($this->get_field_id('reverse')); ?>" value="true" <?php checked(true, $instance['reverse']);?> />
<label for="<?php echo esc_attr($this->get_field_id('reverse')); ?>"> <?php _e('Reverse the order of the trail', 'breadcrumb-navxt'); ?></label><br />
<input class="checkbox" type="checkbox" name="<?php echo esc_attr($this->get_field_name('front')); ?>" id="<?php echo esc_attr($this->get_field_id('front')); ?>" value="true" <?php checked(true, $instance['front']);?> />
<label for="<?php echo esc_attr($this->get_field_id('front')); ?>"> <?php _e('Hide the trail on the front page', 'breadcrumb-navxt'); ?></label><br />
<input class="checkbox" type="checkbox" name="<?php echo esc_attr($this->get_field_name('force')); ?>" id="<?php echo esc_attr($this->get_field_id('force')); ?>" value="true" <?php checked(true, $instance['force']);?> />
<label for="<?php echo esc_attr($this->get_field_id('force')); ?>"> <?php _e('Ignore breadcrumb cache', 'breadcrumb-navxt'); ?></label><br />
</p>
<?php
}
}

View File

@@ -0,0 +1,27 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//If this file is included directly (e.g. WordPress isn't running), return 404
if(!defined('ABSPATH'))
{
//First catches the Apache users
header("HTTP/1.0 404 Not Found");
//This should catch FastCGI users
header("Status: 404 Not Found");
die();
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,99 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/block_direct_access.php');
class mtekk_adminKit_message
{
const version = '1.0.0';
protected $type = '';
protected $contents = '';
protected $dismissed = false;
protected $dismissible = false;
protected $uid;
/**
* Default constructor function
*
* @param string $contents The string to display in the message
* @param string $type The message type, 'error', 'warning', 'success', or 'info'
* @param bool $dismissible Whether or not the message is dismissable
* @param string $uid The message unique ID, only necessary if the message is dismissable
*/
public function __construct($contents, $type = 'info', $dismissible = false, $uid = '')
{
$uid = sanitize_html_class($uid);
//If the message is dismissable, the UID better not be null/empty
if($dismissible === true && $uid === '')
{
//Let the user know they're doing it wrong
_doing_it_wrong(__CLASS__ . '::' . __FUNCTION__, __('$uid must not be null if message is dismissible', 'mtekk_adminKit'), '1.0.0');
//Treat the message as non-dismissible
$dismissible = false;
}
$this->contents = $contents;
$this->type = $type;
$this->dismissible = $dismissible;
$this->uid = $uid;
if($this->dismissible)
{
$this->dismissed = $this->was_dismissed();
}
}
/**
* Attempts to retrieve the dismissal transient for this message
*
* @return bool Whether or not the message has been dismissed
*/
public function was_dismissed()
{
$this->dismissed = get_transient($this->uid);
return $this->dismissed;
}
/**
* Dismisses the message, preventing it from being rendered
*/
public function dismiss()
{
if($this->dismissible && isset($_POST['uid']) && esc_attr($_POST['uid']) === $this->uid)
{
check_ajax_referer($this->uid . '_dismiss', 'nonce');
$this->dismissed = true;
//If the message was dismissed, update the transient for 30 days
$result = set_transient($this->uid, $this->dismissed, 2592000);
}
}
/**
* Function that prints out the message if not already dismissed
*/
public function render()
{
if($this->dismissible)
{
//Don't render dismissed messages
if($this->was_dismissed())
{
return;
}
wp_enqueue_script('mtekk_adminkit_messages');
printf('<div class="notice notice-%1$s is-dismissible"><p>%2$s</p><meta property="uid" content="%3$s"><meta property="nonce" content="%4$s"></div>', esc_attr($this->type), $this->contents, esc_attr($this->uid), wp_create_nonce($this->uid . '_dismiss'));
}
else
{
printf('<div class="notice notice-%1$s"><p>%2$s</p></div>', esc_attr($this->type), $this->contents);
}
}
}

View File

@@ -0,0 +1,70 @@
<?php
/*
Copyright 2015-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/block_direct_access.php');
/**
* Breadcrumb NavXT abstract plugin uninstaller class
*
* @author Tom Klingenberg
*/
abstract class mtekk_adminKit_uninstaller
{
protected $unique_prefix = '';
protected $plugin_basename = null;
protected $_uninstall_result = false;
/**
* get plugin path
*
* @return string full path to plugin file
*/
protected function _get_plugin_path()
{
return sprintf('%s/%s', dirname(dirname(__FILE__)), $this->plugin_basename);
}
/**
* constructor
*
* @param array $options class options
* plugin =>
*/
public function __construct()
{
$this->_uninstall_result = $this->uninstall();
}
/**
* Result Getter
*
* @return bool wether or not uninstall did run successfull.
*/
public function get_result()
{
return $this->_uninstall_result;
}
public function is_installed()
{
return ((get_option($this->unique_prefix . '_options') !== false)
&& (get_option($this->unique_prefix . '_options_bk') !== false)
&& (get_option($this->unique_prefix . '_version') !== false)
&& (get_site_option($this->unique_prefix . '_options') !== false)
&& (get_site_option($this->unique_prefix . '_options_bk') !== false)
&& (get_site_option($this->unique_prefix . '_version') !== false));
}
} /// class bcn_uninstaller_abstract

View File

@@ -0,0 +1,37 @@
jQuery(function()
{
jQuery(".adminkit-engroup input:checkbox.adminkit-enset-ctrl").each(mtekk_admin_enable_group);
jQuery("input:checkbox.adminkit-enset-ctrl").each(mtekk_admin_enable_set);
});
function mtekk_admin_enable_group(){
var setting = this;
jQuery(this).parents(".adminkit-engroup").find("input, textarea").each(function(){
if(this != setting){
if(jQuery(setting).prop("checked")){
jQuery(this).prop("disabled", false);
jQuery(this).removeClass("disabled");
}
else{
jQuery(this).prop("disabled", true);
jQuery(this).addClass("disabled");
}
}
});
}
function mtekk_admin_enable_set(){
var setting = this;
jQuery(this).parents(".adminkit-enset-top").find("input.adminkit-enset, textarea.adminkit-enset").each(function(){
if(this != setting){
if(jQuery(setting).prop("checked")){
jQuery(this).prop("disabled", false);
jQuery(this).removeClass("disabled");
}
else{
jQuery(this).prop("disabled", true);
jQuery(this).addClass("disabled");
}
}
});
}
jQuery(".adminkit-engroup input:checkbox.adminkit-enset-ctrl").change(mtekk_admin_enable_group);
jQuery("input:checkbox.adminkit-enset-ctrl").change(mtekk_admin_enable_set);

View File

@@ -0,0 +1 @@
jQuery(function(){jQuery(".adminkit-engroup input:checkbox.adminkit-enset-ctrl").each(mtekk_admin_enable_group);jQuery("input:checkbox.adminkit-enset-ctrl").each(mtekk_admin_enable_set)});function mtekk_admin_enable_group(){var a=this;jQuery(this).parents(".adminkit-engroup").find("input, textarea").each(function(){if(this!=a){if(jQuery(a).prop("checked")){jQuery(this).prop("disabled",false);jQuery(this).removeClass("disabled")}else{jQuery(this).prop("disabled",true);jQuery(this).addClass("disabled")}}})}function mtekk_admin_enable_set(){var a=this;jQuery(this).parents(".adminkit-enset-top").find("input.adminkit-enset, textarea.adminkit-enset").each(function(){if(this!=a){if(jQuery(a).prop("checked")){jQuery(this).prop("disabled",false);jQuery(this).removeClass("disabled")}else{jQuery(this).prop("disabled",true);jQuery(this).addClass("disabled")}}})}jQuery(".adminkit-engroup input:checkbox.adminkit-enset-ctrl").change(mtekk_admin_enable_group);jQuery("input:checkbox.adminkit-enset-ctrl").change(mtekk_admin_enable_set);

View File

@@ -0,0 +1,11 @@
jQuery(function()
{
jQuery("div.notice button.notice-dismiss").click(function (event){
data = {
'action': 'mtekk_admin_message_dismiss',
'uid': jQuery(this).parent().children("meta[property='uid']").attr("content"),
'nonce': jQuery(this).parent().children("meta[property='nonce']").attr("content")
};
jQuery.post(ajaxurl, data);
});
});

View File

@@ -0,0 +1,11 @@
jQuery(function()
{
jQuery("div.notice button.notice-dismiss").click(function (event){
data = {
'action': 'mtekk_admin_message_dismiss',
'uid': jQuery(this).parent().children("meta[property='uid']").attr("content"),
'nonce': jQuery(this).parent().children("meta[property='nonce']").attr("content")
};
jQuery.post(ajaxurl, data);
});
});

View File

@@ -0,0 +1,8 @@
#hasadmintabs ul.ui-tabs-nav{float: left; width: 100%; border-bottom:1px solid #ccc; font-size:12px; height:27px; list-style-image:none; list-style-position:outside; list-style-type:none; margin:14px 0 0; overflow:visible;padding:0 0 0 6px;}
#hasadmintabs ul.ui-tabs-nav li{display:block; float:left; line-height:200%; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0; padding:0; position:relative; text-align:center; white-space:nowrap; width:auto;}
#hasadmintabs ul.ui-tabs-nav li a{border-bottom:1px solid #ccc; display:block; color:#464646; float:left; line-height:25px; padding:1px 13px 0; position:relative; text-decoration:none;margin:0 4px 0 0;}
#hasadmintabs ul.ui-tabs-nav li.ui-tabs-active a{background:none;border:1px solid #ccc; border-bottom-color:#f1f1f1; height: 25px; color:#464646; font-weight:normal; padding:1px 13px 0;color:#000;}
#hasadmintabs ul.ui-tabs-nav li.ui-tabs-active a:hover, #hasadmintabs ul.ui-tabs-nav a:hover{outline-color:-moz-use-text-color; outline-style:none; outline-width:medium;}
#hasadmintabs ul.ui-tabs-nav li a:focus, #hasadmintabs ul.ui-tabs-nav li a:active{outline: none;}
#hasadmintabs ul.ui-tabs-nav span{font-size: 12px; font-weight: bolder;}
#screen-options-wrap p.submit {margin:0; padding:0;}

View File

@@ -0,0 +1,39 @@
jQuery(function()
{
mtekk_admin_tabulator_init();
});
/**
* Tabulator Bootup
*/
function mtekk_admin_tabulator_init(){
if(!jQuery("#hasadmintabs").length) return;
/* init markup for tabs */
jQuery('#hasadmintabs').prepend('<ul class="nav-tab-wrapper"><\/ul>');
jQuery('#hasadmintabs > fieldset').each(function(i){
id = jQuery(this).attr('id');
cssc = jQuery(this).attr('class');
title = jQuery(this).find('legend').data('title');
caption = jQuery(this).find('legend').text();
jQuery('#hasadmintabs > ul').append('<li><a href="#'+id+'" class="nav-tab '+cssc+'" title="'+title+'"><span>'+caption+"<\/span><\/a><\/li>");
});
var form = jQuery('#'+objectL10n.mtad_uid+'-options');
/* init the tabs plugin */
var tabs = jQuery("#hasadmintabs").tabs({
beforeActivate: function(event, ui){
form.find('input').each(function(){
if(!this.checkValidity()){
form.find(':submit').click();
event.preventDefault();
}
});
/* Update form action for reload on tab traversal*/
var action = form.attr("action").split('#', 1) + '#' + ui.newPanel[0].id;
form.get(0).setAttribute("action", action);
},
create: function(event, ui){
/* Update form action for reload of current tab on page load */
var action = form.attr("action").split('#', 1) + '#' + ui.panel[0].id;
form.get(0).setAttribute("action", action);
}
});
}

View File

@@ -0,0 +1 @@
#hasadmintabs ul.ui-tabs-nav{float:left;width:100%;border-bottom:1px solid #ccc;font-size:12px;height:27px;list-style-image:none;list-style-position:outside;list-style-type:none;margin:14px 0 0;overflow:visible;padding:0 0 0 6px}#hasadmintabs ul.ui-tabs-nav li{display:block;float:left;line-height:200%;list-style-image:none;list-style-position:outside;list-style-type:none;margin:0;padding:0;position:relative;text-align:center;white-space:nowrap;width:auto}#hasadmintabs ul.ui-tabs-nav li a{border-bottom:1px solid #ccc;display:block;color:#464646;float:left;line-height:25px;padding:1px 13px 0;position:relative;text-decoration:none;margin:0 4px 0 0}#hasadmintabs ul.ui-tabs-nav li.ui-tabs-active a{background:0;border:1px solid #ccc;border-bottom-color:#f1f1f1;height:25px;color:#464646;font-weight:normal;padding:1px 13px 0;color:#000}#hasadmintabs ul.ui-tabs-nav li.ui-tabs-active a:hover,#hasadmintabs ul.ui-tabs-nav a:hover{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium}#hasadmintabs ul.ui-tabs-nav li a:focus,#hasadmintabs ul.ui-tabs-nav li a:active{outline:0}#hasadmintabs ul.ui-tabs-nav span{font-size:12px;font-weight:bolder}#screen-options-wrap p.submit{margin:0;padding:0}

View File

@@ -0,0 +1 @@
function mtekk_admin_tabulator_init(){if(jQuery("#hasadmintabs").length){jQuery("#hasadmintabs").prepend('<ul class="nav-tab-wrapper"></ul>'),jQuery("#hasadmintabs > fieldset").each(function(t){id=jQuery(this).attr("id"),cssc=jQuery(this).attr("class"),title=jQuery(this).find("legend").data("title"),caption=jQuery(this).find("legend").text(),jQuery("#hasadmintabs > ul").append('<li><a href="#'+id+'" class="nav-tab '+cssc+'" title="'+title+'"><span>'+caption+"</span></a></li>")});var e=jQuery("#"+objectL10n.mtad_uid+"-options");jQuery("#hasadmintabs").tabs({beforeActivate:function(t,a){e.find("input").each(function(){this.checkValidity()||(e.find(":submit").click(),t.preventDefault())});var i=e.attr("action").split("#",1)+"#"+a.newPanel[0].id;e.get(0).setAttribute("action",i)},create:function(t,a){var i=e.attr("action").split("#",1)+"#"+a.panel[0].id;e.get(0).setAttribute("action",i)}})}}jQuery(function(){mtekk_admin_tabulator_init()});

View File

@@ -0,0 +1,111 @@
<?php
/*
A small library that adds in fallbacks for some of the PHP multibyte string
functions. Mainly inteneded to be used with Breadcrumb NavXT
Copyright 2009-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once(dirname(__FILE__) . '/block_direct_access.php');
if(!function_exists('mb_strlen'))
{
/**
* Fallback for mb_strlen for users without multibyte support
*
* @param string $string the string to determine the lenght of
* @return int the number of characters in the string
*/
function mb_strlen($string)
{
return strlen($string);
}
}
if(!function_exists('mb_strpos'))
{
/**
* Fallback for mb_strpos for users without multibyte support
*
* @param string $haystack the string to search within
* @param string $needle the string to search for
* @return mixed position of the first instances of needle, or false if needle not found
*/
function mb_strpos($haystack, $needle, $offset = 0)
{
return strpos($haystack, $needle, $offset);
}
}
if(!function_exists('mb_substr'))
{
/**
* Fallback for mb_substr for users without multibyte support
*
* @param string $string the input string
* @param int $start the start
* @param int length the length of the substring
* @return string the substring of specified length
*/
function mb_substr($string, $start, $length = 'a')
{
//This happens to be the easiest way to preserve the behavior of substr
if($length = 'a')
{
return substr($string, $start);
}
else
{
return substr($string, $start, $length);
}
}
}
if(!function_exists('mb_strtolower'))
{
/**
* Fallback for mb_strtolower for users without multibyte support
*
* @param string $str the string to change to lowercase
* @param string $encoding the encoding of the string
* @return string the lowercase string
*/
function mb_strtolower($str, $encoding = 'UTF-8')
{
return strtolower($str);
}
}
//We need this constant to be defined, otherwise things will break
if(!defined('MB_CASE_TITLE'))
{
define('MB_CASE_TITLE', '1');
}
if(!function_exists('mb_convert_case'))
{
/**
* A very hacky fallback for mb_convert_case for users without multibyte support
*
* @param string $str the string to change the case on
* @param int $mode the mode of case convert to use
* @param string $encoding the encoding of the string
* @return string the case converted string
*/
function mb_convert_case($str, $mode = MB_CASE_TITLE, $encoding = 'UTF-8')
{
//Only implementing MB_CASE_TITLE
if($mode = MB_CASE_TITLE)
{
return ucwords($str);
}
return $str;
}
}

View File

@@ -0,0 +1,988 @@
# Copyright (C) 2016 Breadcrumb NavXT
# This file is distributed under the same license as the Breadcrumb NavXT package.
msgid ""
msgstr ""
"Project-Id-Version: Breadcrumb NavXT 5.5.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/breadcrumb-navxt\n"
"POT-Creation-Date: 2016-08-13 19:01:09+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: breadcrumb-navxt.php:35 class.bcn_admin.php:25
#: class.bcn_network_admin.php:25
msgid ""
"Your PHP version is too old, please upgrade to a newer version. Your version "
"is %1$s, Breadcrumb NavXT requires %2$s"
msgstr ""
#: class.bcn_admin.php:64
msgid "Breadcrumb NavXT Settings"
msgstr ""
#: class.bcn_admin.php:295 class.bcn_network_admin.php:366
msgid "Tips for the settings are located below select options."
msgstr ""
#: class.bcn_admin.php:296 class.bcn_network_admin.php:367
msgid "Resources"
msgstr ""
#: class.bcn_admin.php:297 class.bcn_network_admin.php:368
msgid ""
"%sTutorials and How Tos%s: There are several guides, tutorials, and how tos "
"available on the author's website."
msgstr ""
#: class.bcn_admin.php:297 class.bcn_network_admin.php:368
msgid "Go to the Breadcrumb NavXT tag archive."
msgstr ""
#: class.bcn_admin.php:298 class.bcn_network_admin.php:369
msgid ""
"%sOnline Documentation%s: Check out the documentation for more indepth "
"technical information."
msgstr ""
#: class.bcn_admin.php:298 class.bcn_network_admin.php:369
msgid "Go to the Breadcrumb NavXT online documentation"
msgstr ""
#: class.bcn_admin.php:299 class.bcn_network_admin.php:370
msgid ""
"%sReport a Bug%s: If you think you have found a bug, please include your "
"WordPress version and details on how to reproduce the bug."
msgstr ""
#: class.bcn_admin.php:299 class.bcn_network_admin.php:370
msgid "Go to the Breadcrumb NavXT support post for your version."
msgstr ""
#: class.bcn_admin.php:300 class.bcn_network_admin.php:371
msgid "Giving Back"
msgstr ""
#: class.bcn_admin.php:301 class.bcn_network_admin.php:372
msgid ""
"%sDonate%s: Love Breadcrumb NavXT and want to help development? Consider "
"buying the author a beer."
msgstr ""
#: class.bcn_admin.php:301 class.bcn_network_admin.php:372
msgid "Go to PayPal to give a donation to Breadcrumb NavXT."
msgstr ""
#: class.bcn_admin.php:302 class.bcn_network_admin.php:373
msgid ""
"%sTranslate%s: Is your language not available? Visit the Breadcrumb NavXT "
"translation project on WordPress.org to start translating."
msgstr ""
#: class.bcn_admin.php:302 class.bcn_network_admin.php:373
msgid "Go to the Breadcrumb NavXT translation project."
msgstr ""
#: class.bcn_admin.php:307 class.bcn_admin.php:446 class.bcn_admin.php:447
#: class.bcn_network_admin.php:378 class.bcn_network_admin.php:518
#: class.bcn_network_admin.php:519
msgid "General"
msgstr ""
#: class.bcn_admin.php:310 class.bcn_network_admin.php:381
msgid ""
"For the settings on this page to take effect, you must either use the "
"included Breadcrumb NavXT widget, or place either of the code sections below "
"into your theme."
msgstr ""
#: class.bcn_admin.php:311 class.bcn_network_admin.php:382
msgid "Breadcrumb trail with separators"
msgstr ""
#: class.bcn_admin.php:317 class.bcn_network_admin.php:388
msgid "Breadcrumb trail in list form"
msgstr ""
#: class.bcn_admin.php:326 class.bcn_network_admin.php:397
msgid "Quick Start"
msgstr ""
#: class.bcn_admin.php:329 class.bcn_network_admin.php:400
msgid ""
"Using the code from the Quick Start section above, the following CSS can be "
"used as base for styling your breadcrumb trail."
msgstr ""
#: class.bcn_admin.php:341 class.bcn_network_admin.php:412
msgid "Styling"
msgstr ""
#: class.bcn_admin.php:347 class.bcn_network_admin.php:418
msgid "Import/Export/Reset"
msgstr ""
#: class.bcn_admin.php:371 class.bcn_network_admin.php:442
#: includes/class.mtekk_adminkit.php:841
msgid "Import"
msgstr ""
#: class.bcn_admin.php:372 class.bcn_network_admin.php:443
#: includes/class.mtekk_adminkit.php:842
msgid "Export"
msgstr ""
#: class.bcn_admin.php:373 class.bcn_network_admin.php:444
#: includes/class.mtekk_adminkit.php:843
msgid "Reset"
msgstr ""
#: class.bcn_admin.php:391
msgid ""
"Warning: Your network settings will override any settings set in this page."
msgstr ""
#: class.bcn_admin.php:395 class.bcn_admin.php:399
msgid ""
"Warning: Your network settings may override any settings set in this page."
msgstr ""
#: class.bcn_admin.php:404 class.bcn_network_admin.php:475
msgid ""
"Warning: No BCN_SETTINGS_* define statement found, defaulting to "
"BCN_SETTINGS_USE_LOCAL."
msgstr ""
#: class.bcn_admin.php:416 class.bcn_network_admin.php:488
msgid ""
"Warning: Your are using a deprecated setting \"Title Length\" (see "
"Miscellaneous &gt; Deprecated), please %1$suse CSS instead%2$s."
msgstr ""
#: class.bcn_admin.php:416 class.bcn_admin.php:704
#: class.bcn_network_admin.php:488 class.bcn_network_admin.php:776
msgid "Go to the guide on trimming breadcrumb title lengths with CSS"
msgstr ""
#: class.bcn_admin.php:446 class.bcn_network_admin.php:518
msgid ""
"A collection of settings most likely to be modified are located under this "
"tab."
msgstr ""
#: class.bcn_admin.php:450 class.bcn_network_admin.php:522
msgid "Breadcrumb Separator"
msgstr ""
#: class.bcn_admin.php:450 class.bcn_network_admin.php:522
msgid "Placed in between each breadcrumb."
msgstr ""
#: class.bcn_admin.php:454 class.bcn_network_admin.php:526
msgid "Current Item"
msgstr ""
#: class.bcn_admin.php:457 class.bcn_network_admin.php:529
msgid "Link Current Item"
msgstr ""
#: class.bcn_admin.php:457 class.bcn_network_admin.php:529
msgid "Yes"
msgstr ""
#: class.bcn_admin.php:458 class.bcn_network_admin.php:530
msgctxt ""
"Paged as in when on an archive or post that is split into multiple pages"
msgid "Paged Breadcrumb"
msgstr ""
#: class.bcn_admin.php:458 class.bcn_network_admin.php:530
msgid "Place the page number breadcrumb in the trail."
msgstr ""
#: class.bcn_admin.php:458 class.bcn_network_admin.php:530
msgid ""
"Indicates that the user is on a page other than the first of a paginated "
"archive or post."
msgstr ""
#: class.bcn_admin.php:459 class.bcn_network_admin.php:531
msgctxt ""
"Paged as in when on an archive or post that is split into multiple pages"
msgid "Paged Template"
msgstr ""
#: class.bcn_admin.php:459 class.bcn_network_admin.php:531
msgid "The template for paged breadcrumbs."
msgstr ""
#: class.bcn_admin.php:463 class.bcn_admin.php:466
#: class.bcn_network_admin.php:535 class.bcn_network_admin.php:538
msgid "Home Breadcrumb"
msgstr ""
#: class.bcn_admin.php:466 class.bcn_network_admin.php:538
msgid "Place the home breadcrumb in the trail."
msgstr ""
#: class.bcn_admin.php:467 class.bcn_network_admin.php:539
msgid "Home Template"
msgstr ""
#: class.bcn_admin.php:467 class.bcn_network_admin.php:539
msgid "The template for the home breadcrumb."
msgstr ""
#: class.bcn_admin.php:468 class.bcn_network_admin.php:540
msgid "Home Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:468 class.bcn_network_admin.php:540
msgid ""
"The template for the home breadcrumb, used when the breadcrumb is not linked."
msgstr ""
#: class.bcn_admin.php:472 class.bcn_admin.php:475
#: class.bcn_network_admin.php:544 class.bcn_network_admin.php:547
msgid "Blog Breadcrumb"
msgstr ""
#: class.bcn_admin.php:475 class.bcn_network_admin.php:547
msgid "Place the blog breadcrumb in the trail."
msgstr ""
#: class.bcn_admin.php:476 class.bcn_network_admin.php:548
msgid "Blog Template"
msgstr ""
#: class.bcn_admin.php:476 class.bcn_network_admin.php:548
msgid ""
"The template for the blog breadcrumb, used only in static front page "
"environments."
msgstr ""
#: class.bcn_admin.php:477 class.bcn_network_admin.php:549
msgid "Blog Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:477 class.bcn_network_admin.php:549
msgid ""
"The template for the blog breadcrumb, used only in static front page "
"environments and when the breadcrumb is not linked."
msgstr ""
#: class.bcn_admin.php:481 class.bcn_network_admin.php:553
msgid "Mainsite Breadcrumb"
msgstr ""
#: class.bcn_admin.php:484 class.bcn_network_admin.php:556
msgid "Main Site Breadcrumb"
msgstr ""
#: class.bcn_admin.php:484 class.bcn_network_admin.php:556
msgid "Place the main site home breadcrumb in the trail in an multisite setup."
msgstr ""
#: class.bcn_admin.php:485 class.bcn_network_admin.php:557
msgid "Main Site Home Template"
msgstr ""
#: class.bcn_admin.php:485 class.bcn_network_admin.php:557
msgid ""
"The template for the main site home breadcrumb, used only in multisite "
"environments."
msgstr ""
#: class.bcn_admin.php:486 class.bcn_network_admin.php:558
msgid "Main Site Home Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:486 class.bcn_network_admin.php:558
msgid ""
"The template for the main site home breadcrumb, used only in multisite "
"environments and when the breadcrumb is not linked."
msgstr ""
#: class.bcn_admin.php:493 class.bcn_network_admin.php:565
msgid ""
"The settings for all post types (Posts, Pages, and Custom Post Types) are "
"located under this tab."
msgstr ""
#: class.bcn_admin.php:493 class.bcn_network_admin.php:565
msgid "Post Types"
msgstr ""
#: class.bcn_admin.php:494 class.bcn_network_admin.php:566
msgid "Posts"
msgstr ""
#: class.bcn_admin.php:497 class.bcn_network_admin.php:569
msgid "Post Template"
msgstr ""
#: class.bcn_admin.php:497 class.bcn_network_admin.php:569
msgid "The template for post breadcrumbs."
msgstr ""
#: class.bcn_admin.php:498 class.bcn_network_admin.php:570
msgid "Post Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:498 class.bcn_network_admin.php:570
msgid ""
"The template for post breadcrumbs, used only when the breadcrumb is not "
"linked."
msgstr ""
#: class.bcn_admin.php:499 class.bcn_network_admin.php:571
msgid "Post Hierarchy Display"
msgstr ""
#: class.bcn_admin.php:499 class.bcn_network_admin.php:571
msgid ""
"Show the hierarchy (specified below) leading to a post in the breadcrumb "
"trail."
msgstr ""
#: class.bcn_admin.php:500 class.bcn_network_admin.php:572
msgid "Post Hierarchy Referer Influence"
msgstr ""
#: class.bcn_admin.php:500 class.bcn_admin.php:578
#: class.bcn_network_admin.php:572 class.bcn_network_admin.php:650
msgid ""
"Allow the refereing page to influence the taxonomy selected for the "
"hierarchy."
msgstr ""
#: class.bcn_admin.php:504 class.bcn_network_admin.php:576
msgid "Post Hierarchy"
msgstr ""
#: class.bcn_admin.php:508 class.bcn_admin.php:627
#: class.bcn_network_admin.php:580 class.bcn_network_admin.php:699
msgid "Categories"
msgstr ""
#: class.bcn_admin.php:509 class.bcn_admin.php:588
#: class.bcn_network_admin.php:581 class.bcn_network_admin.php:660
msgid "Dates"
msgstr ""
#: class.bcn_admin.php:510 class.bcn_admin.php:634
#: class.bcn_network_admin.php:582 class.bcn_network_admin.php:706
msgid "Tags"
msgstr ""
#: class.bcn_admin.php:512 class.bcn_admin.php:587
#: class.bcn_network_admin.php:584 class.bcn_network_admin.php:659
msgid "Post Parent"
msgstr ""
#: class.bcn_admin.php:528 class.bcn_admin.php:612
#: class.bcn_network_admin.php:600 class.bcn_network_admin.php:684
msgid ""
"The hierarchy which the breadcrumb trail will show. Note that the \"Post "
"Parent\" option may require an additional plugin to behave as expected since "
"this is a non-hierarchical post type."
msgstr ""
#: class.bcn_admin.php:532 class.bcn_network_admin.php:604
msgid "Pages"
msgstr ""
#: class.bcn_admin.php:535 class.bcn_network_admin.php:607
msgid "Page Template"
msgstr ""
#: class.bcn_admin.php:535 class.bcn_network_admin.php:607
msgid "The template for page breadcrumbs."
msgstr ""
#: class.bcn_admin.php:536 class.bcn_network_admin.php:608
msgid "Page Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:536 class.bcn_network_admin.php:608
msgid ""
"The template for page breadcrumbs, used only when the breadcrumb is not "
"linked."
msgstr ""
#: class.bcn_admin.php:539 class.bcn_network_admin.php:611
msgid "Attachments"
msgstr ""
#: class.bcn_admin.php:542 class.bcn_network_admin.php:614
msgid "Attachment Template"
msgstr ""
#: class.bcn_admin.php:542 class.bcn_network_admin.php:614
msgid "The template for attachment breadcrumbs."
msgstr ""
#: class.bcn_admin.php:543 class.bcn_network_admin.php:615
msgid "Attachment Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:543 class.bcn_network_admin.php:615
msgid ""
"The template for attachment breadcrumbs, used only when the breadcrumb is "
"not linked."
msgstr ""
#: class.bcn_admin.php:563 class.bcn_admin.php:665
#: class.bcn_network_admin.php:635 class.bcn_network_admin.php:737
msgid "%s Template"
msgstr ""
#: class.bcn_admin.php:563 class.bcn_admin.php:665
#: class.bcn_network_admin.php:635 class.bcn_network_admin.php:737
msgid "The template for %s breadcrumbs."
msgstr ""
#: class.bcn_admin.php:564 class.bcn_admin.php:666
#: class.bcn_network_admin.php:636 class.bcn_network_admin.php:738
msgid "%s Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:564 class.bcn_admin.php:666
#: class.bcn_network_admin.php:636 class.bcn_network_admin.php:738
msgid ""
"The template for %s breadcrumbs, used only when the breadcrumb is not linked."
msgstr ""
#: class.bcn_admin.php:569 class.bcn_network_admin.php:641
msgid "%s Root Page"
msgstr ""
#: class.bcn_admin.php:572 class.bcn_network_admin.php:644
msgid "&mdash; Select &mdash;"
msgstr ""
#: class.bcn_admin.php:576 class.bcn_network_admin.php:648
msgid "%s Archive Display"
msgstr ""
#: class.bcn_admin.php:576 class.bcn_network_admin.php:648
msgid ""
"Show the breadcrumb for the %s post type archives in the breadcrumb trail."
msgstr ""
#: class.bcn_admin.php:577 class.bcn_network_admin.php:649
msgid "%s Hierarchy Display"
msgstr ""
#: class.bcn_admin.php:577 class.bcn_network_admin.php:649
msgid ""
"Show the hierarchy (specified below) leading to a %s in the breadcrumb trail."
msgstr ""
#: class.bcn_admin.php:578 class.bcn_network_admin.php:650
msgid "%s Hierarchy Referer Influence"
msgstr ""
#: class.bcn_admin.php:582 class.bcn_network_admin.php:654
msgid "%s Hierarchy"
msgstr ""
#: class.bcn_admin.php:608 class.bcn_network_admin.php:680
msgid "The hierarchy which the breadcrumb trail will show."
msgstr ""
#: class.bcn_admin.php:626 class.bcn_network_admin.php:698
msgid ""
"The settings for all taxonomies (including Categories, Tags, and custom "
"taxonomies) are located under this tab."
msgstr ""
#: class.bcn_admin.php:626 class.bcn_network_admin.php:698
msgid "Taxonomies"
msgstr ""
#: class.bcn_admin.php:630 class.bcn_network_admin.php:702
msgid "Category Template"
msgstr ""
#: class.bcn_admin.php:630 class.bcn_network_admin.php:702
msgid "The template for category breadcrumbs."
msgstr ""
#: class.bcn_admin.php:631 class.bcn_network_admin.php:703
msgid "Category Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:631 class.bcn_network_admin.php:703
msgid ""
"The template for category breadcrumbs, used only when the breadcrumb is not "
"linked."
msgstr ""
#: class.bcn_admin.php:637 class.bcn_network_admin.php:709
msgid "Tag Template"
msgstr ""
#: class.bcn_admin.php:637 class.bcn_network_admin.php:709
msgid "The template for tag breadcrumbs."
msgstr ""
#: class.bcn_admin.php:638 class.bcn_network_admin.php:710
msgid "Tag Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:638 class.bcn_network_admin.php:710
msgid ""
"The template for tag breadcrumbs, used only when the breadcrumb is not "
"linked."
msgstr ""
#: class.bcn_admin.php:641 class.bcn_network_admin.php:713
msgid "Post Formats"
msgstr ""
#: class.bcn_admin.php:644 class.bcn_network_admin.php:716
msgid "Post Format Template"
msgstr ""
#: class.bcn_admin.php:644 class.bcn_network_admin.php:716
msgid "The template for post format breadcrumbs."
msgstr ""
#: class.bcn_admin.php:645 class.bcn_network_admin.php:717
msgid "Post Format Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:645 class.bcn_network_admin.php:717
msgid ""
"The template for post_format breadcrumbs, used only when the breadcrumb is "
"not linked."
msgstr ""
#: class.bcn_admin.php:675 class.bcn_network_admin.php:747
msgid ""
"The settings for author and date archives, searches, and 404 pages are "
"located under this tab."
msgstr ""
#: class.bcn_admin.php:675 class.bcn_admin.php:684
#: class.bcn_network_admin.php:747 class.bcn_network_admin.php:756
msgid "Miscellaneous"
msgstr ""
#: class.bcn_admin.php:676 class.bcn_network_admin.php:748
msgid "Author Archives"
msgstr ""
#: class.bcn_admin.php:679 class.bcn_network_admin.php:751
msgid "Author Template"
msgstr ""
#: class.bcn_admin.php:679 class.bcn_network_admin.php:751
msgid "The template for author breadcrumbs."
msgstr ""
#: class.bcn_admin.php:680 class.bcn_network_admin.php:752
msgid "Author Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:680 class.bcn_network_admin.php:752
msgid ""
"The template for author breadcrumbs, used only when the breadcrumb is not "
"linked."
msgstr ""
#: class.bcn_admin.php:681 class.bcn_network_admin.php:753
msgid "Author Display Format"
msgstr ""
#: class.bcn_admin.php:681 class.bcn_network_admin.php:753
msgid ""
"display_name uses the name specified in \"Display name publicly as\" under "
"the user profile the others correspond to options in the user profile."
msgstr ""
#: class.bcn_admin.php:687 class.bcn_network_admin.php:759
msgid "Date Template"
msgstr ""
#: class.bcn_admin.php:687 class.bcn_network_admin.php:759
msgid "The template for date breadcrumbs."
msgstr ""
#: class.bcn_admin.php:688 class.bcn_network_admin.php:760
msgid "Date Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:688 class.bcn_network_admin.php:760
msgid ""
"The template for date breadcrumbs, used only when the breadcrumb is not "
"linked."
msgstr ""
#: class.bcn_admin.php:689 class.bcn_network_admin.php:761
msgid "Search Template"
msgstr ""
#: class.bcn_admin.php:689 class.bcn_network_admin.php:761
msgid ""
"The anchor template for search breadcrumbs, used only when the search "
"results span several pages."
msgstr ""
#: class.bcn_admin.php:690 class.bcn_network_admin.php:762
msgid "Search Template (Unlinked)"
msgstr ""
#: class.bcn_admin.php:690 class.bcn_network_admin.php:762
msgid ""
"The anchor template for search breadcrumbs, used only when the search "
"results span several pages and the breadcrumb is not linked."
msgstr ""
#: class.bcn_admin.php:691 class.bcn_network_admin.php:763
msgid "404 Title"
msgstr ""
#: class.bcn_admin.php:692 class.bcn_network_admin.php:764
msgid "404 Template"
msgstr ""
#: class.bcn_admin.php:692 class.bcn_network_admin.php:764
msgid "The template for 404 breadcrumbs."
msgstr ""
#: class.bcn_admin.php:695 class.bcn_network_admin.php:767
msgid "Deprecated"
msgstr ""
#: class.bcn_admin.php:699 class.bcn_network_admin.php:771
msgid "Title Length"
msgstr ""
#: class.bcn_admin.php:704 class.bcn_network_admin.php:776
msgid ""
"Limit the length of the breadcrumb title. (Deprecated, %suse CSS instead%s)"
msgstr ""
#: class.bcn_admin.php:709 class.bcn_network_admin.php:781
msgid "Max Title Length: "
msgstr ""
#: class.bcn_admin.php:721 class.bcn_network_admin.php:793
msgid "Save Changes"
msgstr ""
#: class.bcn_breadcrumb.php:91
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><a property=\"item\" "
"typeof=\"WebPage\" title=\"Go to %title%.\" href=\"%link%\" class=\"%type%"
"\"><span property=\"name\">%htitle%</span></a><meta property=\"position\" "
"content=\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:77
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><span property=\"name"
"\">Page %htitle%</span><meta property=\"position\" content=\"%position%\"></"
"span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:102
msgid "404"
msgstr ""
#: class.bcn_breadcrumb_trail.php:105
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><span property=\"name"
"\">Search results for &#39;<a property=\"item\" typeof=\"WebPage\" title="
"\"Go to the first page of search results for %title%.\" href=\"%link%\" "
"class=\"%type%\">%htitle%</a>&#39;</span><meta property=\"position\" content="
"\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:107
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><span property=\"name"
"\">Search results for &#39;%htitle%&#39;</span><meta property=\"position\" "
"content=\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:110
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><a property=\"item\" "
"typeof=\"WebPage\" title=\"Go to the %title% tag archives.\" href=\"%link%\" "
"class=\"%type%\"><span property=\"name\">%htitle%</span></a><meta property="
"\"position\" content=\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:115 class.bcn_breadcrumb_trail.php:131
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><a property=\"item\" "
"typeof=\"WebPage\" title=\"Go to the %title% archives.\" href=\"%link%\" "
"class=\"%type%\"><span property=\"name\">%htitle%</span></a><meta property="
"\"position\" content=\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:120
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><span property=\"name"
"\">Articles by: <a title=\"Go to the first page of posts by %title%.\" href="
"\"%link%\" class=\"%type%\">%htitle%</a>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:122
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><span property=\"name"
"\">Articles by: %htitle%</span><meta property=\"position\" content="
"\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:127
msgid ""
"<span property=\"itemListElement\" typeof=\"ListItem\"><a property=\"item\" "
"typeof=\"WebPage\" title=\"Go to the %title% category archives.\" href="
"\"%link%\" class=\"%type%\"><span property=\"name\">%htitle%</span></a><meta "
"property=\"position\" content=\"%position%\"></span>"
msgstr ""
#: class.bcn_breadcrumb_trail.php:465
msgid "$post global is not of type WP_Post"
msgstr ""
#: class.bcn_breadcrumb_trail.php:563
msgctxt "day archive breadcrumb date format"
msgid "d"
msgstr ""
#: class.bcn_breadcrumb_trail.php:583
msgctxt "month archive breadcrumb date format"
msgid "F"
msgstr ""
#: class.bcn_breadcrumb_trail.php:600
msgctxt "year archive breadcrumb date format"
msgid "Y"
msgstr ""
#: class.bcn_network_admin.php:63
msgid "Breadcrumb NavXT Network Settings"
msgstr ""
#: class.bcn_network_admin.php:458 class.bcn_network_admin.php:476
msgid ""
"Warning: Individual site settings will override any settings set in this "
"page."
msgstr ""
#: class.bcn_network_admin.php:466 class.bcn_network_admin.php:470
msgid ""
"Warning: Individual site settings may override any settings set in this page."
msgstr ""
#: class.bcn_widget.php:32
msgid "Adds a breadcrumb trail to your sidebar"
msgstr ""
#: class.bcn_widget.php:99
msgid "Title:"
msgstr ""
#: class.bcn_widget.php:103
msgid "Text to show before the trail:"
msgstr ""
#: class.bcn_widget.php:107
msgid "Output trail as:"
msgstr ""
#: class.bcn_widget.php:109
msgid "List"
msgstr ""
#: class.bcn_widget.php:110
msgid "Google (RDFa) Breadcrumbs"
msgstr ""
#: class.bcn_widget.php:111
msgid "Plain"
msgstr ""
#: class.bcn_widget.php:117
msgid "Link the breadcrumbs"
msgstr ""
#: class.bcn_widget.php:119
msgid "Reverse the order of the trail"
msgstr ""
#: class.bcn_widget.php:121
msgid "Hide the trail on the front page"
msgstr ""
#: includes/class.mtekk_adminkit.php:113
msgid "Insufficient privileges to proceed."
msgstr ""
#: includes/class.mtekk_adminkit.php:236
msgid "Settings"
msgstr ""
#: includes/class.mtekk_adminkit.php:312
msgid ""
"Your settings are for an older version of this plugin and need to be "
"migrated."
msgstr ""
#: includes/class.mtekk_adminkit.php:312 includes/class.mtekk_adminkit.php:321
msgid "Migrate the settings now."
msgstr ""
#: includes/class.mtekk_adminkit.php:312
msgid "Migrate now."
msgstr ""
#: includes/class.mtekk_adminkit.php:321
msgid "Your settings are for a newer version of this plugin."
msgstr ""
#: includes/class.mtekk_adminkit.php:321
msgid "Attempt back migration now."
msgstr ""
#: includes/class.mtekk_adminkit.php:329
msgid "Your plugin install is incomplete."
msgstr ""
#: includes/class.mtekk_adminkit.php:329
msgid "Load default settings now."
msgstr ""
#: includes/class.mtekk_adminkit.php:329
msgid "Complete now."
msgstr ""
#: includes/class.mtekk_adminkit.php:337
msgid "One or more of your plugin settings are invalid."
msgstr ""
#: includes/class.mtekk_adminkit.php:337
msgid "Attempt to fix settings now."
msgstr ""
#: includes/class.mtekk_adminkit.php:337
msgid "Fix now."
msgstr ""
#: includes/class.mtekk_adminkit.php:536
msgid "Settings successfully saved."
msgstr ""
#: includes/class.mtekk_adminkit.php:536 includes/class.mtekk_adminkit.php:549
msgid "Undo the options save."
msgstr ""
#: includes/class.mtekk_adminkit.php:536 includes/class.mtekk_adminkit.php:549
#: includes/class.mtekk_adminkit.php:654 includes/class.mtekk_adminkit.php:678
#: includes/class.mtekk_adminkit.php:695
msgid "Undo"
msgstr ""
#: includes/class.mtekk_adminkit.php:540
msgid "Settings did not change, nothing to save."
msgstr ""
#: includes/class.mtekk_adminkit.php:544
msgid "Settings were not saved."
msgstr ""
#: includes/class.mtekk_adminkit.php:549
msgid "Some settings were not saved."
msgstr ""
#: includes/class.mtekk_adminkit.php:550
msgid "The following settings were not saved:"
msgstr ""
#: includes/class.mtekk_adminkit.php:555
msgid "Please include this message in your %sbug report%s."
msgstr ""
#: includes/class.mtekk_adminkit.php:555
msgid "Go to the %s support post for your version."
msgstr ""
#: includes/class.mtekk_adminkit.php:654
msgid "Settings successfully imported from the uploaded file."
msgstr ""
#: includes/class.mtekk_adminkit.php:654
msgid "Undo the options import."
msgstr ""
#: includes/class.mtekk_adminkit.php:659
msgid "Importing settings from file failed."
msgstr ""
#: includes/class.mtekk_adminkit.php:678
msgid "Settings successfully reset to the default values."
msgstr ""
#: includes/class.mtekk_adminkit.php:678
msgid "Undo the options reset."
msgstr ""
#: includes/class.mtekk_adminkit.php:695
msgid "Settings successfully undid the last operation."
msgstr ""
#: includes/class.mtekk_adminkit.php:695
msgid "Undo the last undo operation."
msgstr ""
#: includes/class.mtekk_adminkit.php:730
msgid "Settings successfully migrated."
msgstr ""
#: includes/class.mtekk_adminkit.php:737
msgid "Default settings successfully installed."
msgstr ""
#: includes/class.mtekk_adminkit.php:833
msgid ""
"Import settings from a XML file, export the current settings to a XML file, "
"or reset to the default settings."
msgstr ""
#: includes/class.mtekk_adminkit.php:836
msgid "Settings File"
msgstr ""
#: includes/class.mtekk_adminkit.php:839
msgid "Select a XML settings file to upload and import settings from."
msgstr ""
#. Plugin Name of the plugin/theme
msgid "Breadcrumb NavXT"
msgstr ""
#. Plugin URI of the plugin/theme
msgid "http://mtekk.us/code/breadcrumb-navxt/"
msgstr ""
#. Description of the plugin/theme
msgid ""
"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>."
msgstr ""
#. Author of the plugin/theme
msgid "John Havlik"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://mtekk.us/"
msgstr ""

View File

@@ -0,0 +1,153 @@
=== Breadcrumb NavXT ===
Contributors: mtekk, hakre
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=FD5XEU783BR8U&lc=US&item_name=Breadcrumb%20NavXT%20Donation&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
Tags: breadcrumb, breadcrumbs, trail, navigation, menu, widget
Requires at least: 4.8
Tested up to: 5.4.0
Stable tag: 6.4.0
Requires PHP: 5.5
License: GPLv2 or later
Adds breadcrumb navigation showing the visitor's path to their current location.
== Description ==
Breadcrumb NavXT, the successor to the popular WordPress plugin Breadcrumb Navigation XT, was written from the ground up to be better than its ancestor. This plugin generates locational breadcrumb trails for your WordPress powered blog or website. These breadcrumb trails are highly customizable to suit the needs of just about any website running WordPress. The Administrative interface makes setting options easy, while a direct class access is available for theme developers and more adventurous users.
= PHP Requirements =
Breadcrumb NavXT 5.2 and newer require PHP5.3
Breadcrumb NavXT 5.1.1 and older require PHP5.2
= Features (non-exhaustive) =
* RDFa format Schema.org BreadcrumbList compatible breadcrumb generation.
* Extensive breadcrumb customization control via a settings page with appropriate default values for most use cases.
* Network admin settings page for managing breadcrumb settings for all subsites with [configurable global priority](http://mtekk.us/archives/guides/controlling-breadcrumb-navxt-settings-from-the-network-settings-page/ "Go to the article on configuring the network settings priority.").
* Built in WordPress Widget.
* Extensible via OOP and provided [actions](http://mtekk.us/code/breadcrumb-navxt/breadcrumb-navxt-doc/2/#action_reference "Go to the Breadcrumb NavXT Documentation's action reference.") and [filters](http://mtekk.us/code/breadcrumb-navxt/breadcrumb-navxt-doc/2/#filter_reference "Go to the Breadcrumb NavXT Documentation's filter reference.").
* WPML compatible (enhanced compatibility with WPML extensions plugin).
* Polylang compatible (enhanced compatibility with Polylang extensions plugin).
* bbPress compatible (enhanced compatibility with bbPress extensions plugin).
* BuddyPress compatible (enhanced compatibility with BuddyPress extensions plugin).
= Translations =
Breadcrumb NavXT now supports WordPress.org language packs. Want to translate Breadcrumb NavXT? Visit [Breadcrumb NavXT's WordPress.org translation project](https://translate.wordpress.org/projects/wp-plugins/breadcrumb-navxt/).
== Installation ==
Breadcrumb NavXT can be installed from within WordPress administration panel. After installing and activating the plugin, to get breadcrumb trails to display either use the included widget, or call the breadcrumb trail in your theme (or child theme). See the [Calling the Breadcrumb Trail](http://mtekk.us/archives/guides/calling-the-breadcrumb-trail "Read more on calling the breadcrumb trail") article for more information on calling the breadcrumb trail.
To customize the breadcrumb trail you may edit the default values for the options in the administrative interface. This is located in your administration panel under Settings > Breadcrumb NavXT.
Please visit [Breadcrumb NavXT's Documentation](http://mtekk.us/code/breadcrumb-navxt/breadcrumb-navxt-doc/ "Go to Breadcrumb NavXT's Documentation.") page for more information.
== Screenshots ==
1. This screenshot shows 5 different examples of breadcrumbs generated by Breadcrumb NavXT
2. A screenshot of the General tab of the settings page
3. A screenshot of the Post Types tab of the settings page
4. A screenshot of the Taxonomies tab of the settings page
5. A screenshot of the Miscellaneous tab of the settings page
6. A screenshot of the Settings Import/Export/Reset form under the Help menu
== Changelog ==
= 6.4.0 =
Release date: December, 31st 2019
* Behavior change: Attachment post type settings moved to Media, additional post type options made available.
* Behavior change: Privately published parent posts are now, by default, skipped over in breadcrumb trails.
* Behavior change: On single post breadcrumb trails, the hierarchical term code path is now used in cases where only a single term from a non-hierarchical taxonomy is present for the current post.
* New feature: Allow `%link%` tag in unlinked breadcrumb templates.
* New feature: Added `bcn_show_post_private` filter.
* New feature: Added `bcn_show_type_term_archive` filter.
= 6.3.0 =
Release date: May, 3rd 2019
* New feature: Added Gutenberg block for displaying breadcrumb trails.
* New feature: Added `bcn_display_attribute_array` filter.
* New feature: Added `bcn-aria-current` template tag to facilitate WAI-ARIA Breadcrumb support.
* Bug Fix: Updated settings page to follow WP core standards for header structure.
* Bug Fix: Updated checkbox in adminKit to eliminate multiple labels to follow WCAG 2.0.
* Bug Fix: Fixed PHP error in circumstances of `bcn_breadcrumb_trail::fill()` falling back on treating an unknown item as a taxonomy.
= 6.2.1 =
Release date: October, 26th 2018
* Behavior change: Added `span` element wrapping the breadcrumb title in the default unlinked breadcrumb template.
* Bug fix: Fixed issue that caused PHP warnings and “the following settings were not saved” messages for hierarchical CPTs.
= 6.2.0 =
Release date: September, 24th 2018
* Behavior change: Cleaned up translations for default templates, simplifying and clarifying the translatable content.
* Behavior change: Default unlinked breadcrumb templates no longer contain Schema.org BreadcrumbList markup.
* Behavior change: Breadcrumb NavXT REST API endpoints are no longer enabled by default.
* New feature: Added `bcn_register_rest_endpoint` filter.
* New feature: Added `bcn_breadcrumb_assemble_json_ld_array` filter.
* New feature: Added support for following the post parent hierarchy first then falling back to a secondary hierarchy.
* Bug fix: Fixed issue where on loading the settings page immediately after migrating settings causes PHP warnings on CPT and custom taxonomy settings.
* Bug fix: Fixed issue that caused the settings reset option under the help drop down to not work.
= 6.1.0 =
Release date: June, 1st 2018
* Behavior change: Links to generate support requests migrated to the WordPress.org forums.
* New feature: Added support for Schema.org BreadcrumbList (microdata format) in the included widget.
* New feature: Added new Root Page support for author archives.
* New feature: Added REST API endpoint for posts, terms, and author archives.
* Bug fix: Corrected label for the Schema.org BreadcrumbList (RDFa format) option in the included widget.
* Bug fix: Fixed issue where a PHP warning would be thrown due to `get_term()` returning something other than an instance of `WP_Term`.
= 6.0.4 =
Release date: January, 26th 2018
* Behavior change: Added auto migration of post type hierarchy settings to `bcn_display*()` functions.
* Bug fix: Fixed issue where a PHP notice would be generated on the page for posts when the blog breadcrumb display option is set to false.
* Bug fix: Fixed issue where a PHP notice would be generated on archive pages where attachments were included in the `wp_query` results.
= 6.0.3 =
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.
= 6.0.2 =
Release date: December, 30th 2017
* Behavior change: Added warning alerting that `bcn_breadcrumb::type` must be an array.
* Bug fix: Changed Breadcrumb Separator and Paged Template from an input field to a textbox to reduce confusion caused by HTML entities.
* Bug fix: Fixed issue where the parents of a page may not show up in the breadcrumb trail.
* Bug fix: Fixed issue where the `$reverse` parameter for `bcn_display` and `bcn_display_list` did not work properly.
* Bug fix: Fixed issue where the `bcn_display_list` function did not include the `li` elements.
= 6.0.1 =
Release date: December, 28th 2017
* Behavior change: Removed unused Blog Template and Blog Template (Unlinked) from settings page.
* Bug fix: Fixed issue where changes to the hierarchy type for any post type would not save.
* Bug fix: Fixed issue where the blog display setting was ignored.
= 6.0.0 =
Release date: December, 26th 2017
* Behavior change: `bcn_breadcrumb_trail::display_list()` deprecated in favor of using the `$template` parameter in `bcn_breadcrumb_trail::display()`.
* Behavior change: `bcn_breadcrumb_trail::do_attachment()` deprecated in favor of calling `bcn_breadcrumb_trail::do_post()`.
* Behavior change: `bcn_breadcrumb_trail::do_front_page()` deprecated in favor of calling `bcn_breadcrumb_trail::do_home()`.
* Behavior change: `bcn_li_attributes` filter was deprecated in favor of `bcn_display_attributes`.
* Behavior change: `bcn_breadcrumb_trail::do_archive_by_date()` deprecated in favor of calling bcn_breadcrumb_trail::do_day()`, `bcn_breadcrumb_trail::do_month()`, and/or `bcn_breadcrumb_trail::do_year()`.
* Behavior change: `bcn_breadcrumb_trail::find_type()` deprecated and removed from bcn_breadcrumb_trail.
* Behavior change: Breadcrumb for 404 error pages changed to be a child of the front page.
* New feature: Added support for various HTML tags in the widget's pretext field.
* New feature: Added `bcn_default_hierarchy_display` filter.
* New feature: Added `bcn_default_hierarchy_type` filter.
* New feature: Added `$posttype_name` as the third parameter to `bcn_show_tax_private`.
* Bug fix: Fixed UI/UX issue in the settings screen where enabling/disabling settings groups for the Home, Blog, and Mainsite breadcrumb settings did not work.
* Bug fix: Fixed UI/UX issue in the settings screen where not including the paged breadcrumb still allowed the paged breadcrumb template to be edited.
* Bug fix: Removed use of `create_function` in registering the widget as it was deprecated in PHP 7.2.
== Upgrade Notice ==
= 6.3.0 =
This version requires PHP5.5 or newer. This version introduces a Gutenberg Breadcrumb Trail block.
= 6.0.0 =
This version requires PHP5.3 or newer. This version introduces three new filters and deprecates a filter.

View File

@@ -0,0 +1,124 @@
<?php
/**
* Breadcrumb NavXT - uninstall script
*
* uninstall script based on WordPress Uninstall Plugin API
*
*
* Because bcn_admin->uninstall() does not work with WPMU,
* an uninstaller class has been written, that encapsulates
* the uninstall logic and calls bcn_admin->uninstall()
* when applicable.
*
* @see http://codex.wordpress.org/Migrating_Plugins_and_Themes_to_2.7#Uninstall_Plugin_API
* @see http://trac.mu.wordpress.org/ticket/967
*
* this uninstall.php file was executed multiple times because
* breadcrumb navxt (until 3.3) constsisted of two plugins:
*
* 1.) breadcrumb_navxt_class.php / Core
* 2.) breadcrumb_navxt_admin.php / Adminstration Interface
*
* @author Tom Klingenberg
*/
/*
Copyright 2010-2020 John Havlik (email : john.havlik@mtekk.us)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//Ensure the uninstall.php file was only called by WordPress and not directly
if(!defined('WP_UNINSTALL_PLUGIN'))
{
//First catches the Apache users
header("HTTP/1.0 404 Not Found");
//This should catch FastCGI users
header("Status: 404 Not Found");
die();
}
require_once(dirname(__FILE__) . '/includes/class.mtekk_adminkit_uninstaller.php');
/**
* Breadcrumb NavXT uninstaller class
*
* @author Tom Klingenberg
*/
class bcn_uninstaller extends mtekk_adminKit_uninstaller
{
protected $unique_prefix = 'bcn';
protected $plugin_basename = null;
public function __construct()
{
$this->plugin_basename = plugin_basename('/breadcrumb-navxt.php');
parent::__construct();
}
/**
* Options uninstallation function for legacy
*/
private function uninstall_legacy()
{
delete_option($this->unique_prefix . '_options');
delete_option($this->unique_prefix . '_options_bk');
delete_option($this->unique_prefix . '_version');
delete_site_option($this->unique_prefix . '_options');
delete_site_option($this->unique_prefix . '_options_bk');
delete_site_option($this->unique_prefix . '_version');
}
/**
* uninstall breadcrumb navxt admin plugin
*
* @return bool
*/
private function uninstall_options()
{
if(version_compare(phpversion(), '5.3.0', '<'))
{
return $this->uninstall_legacy();
}
//Grab our global breadcrumb_navxt object
global $breadcrumb_navxt;
//Load dependencies if applicable
if(!class_exists('breadcrumb_navxt'))
{
require_once($this->_get_plugin_path());
}
//Initalize $breadcrumb_navxt so we can use it
$bcn_breadcrumb_trail = new bcn_breadcrumb_trail();
//Let's make an instance of our object takes care of everything
$breadcrumb_navxt = new breadcrumb_navxt($bcn_breadcrumb_trail);
//Uninstall
return $breadcrumb_navxt->uninstall();
}
/**
* uninstall method
*
* @return bool wether or not uninstall did run successfull.
*/
public function uninstall()
{
//Only bother to do things if we have something in the database
if($this->is_installed())
{
return $this->uninstall_options();
}
}
} /// class bcn_uninstaller
/*
* main
*/
new bcn_uninstaller();