Version Description
Version 1.0.0+
If upgrading to a version earlier than 1.0.0, your custom styles may need to be adjusted. The HTML markup has changed to a better HTML5 structure.
Download this release
Release Info
Developer | greenshady |
Plugin | Breadcrumb Trail |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- breadcrumb-trail.php +24 -9
- changelog.md +25 -1
- contributing.md +31 -0
- inc/breadcrumbs.php +74 -39
- {languages → lang}/breadcrumb-trail.pot +119 -114
- languages/breadcrumb-trail-fi.mo +0 -0
- languages/breadcrumb-trail-fi.po +0 -138
- languages/breadcrumb-trail-fr_FR.mo +0 -0
- languages/breadcrumb-trail-fr_FR.po +0 -133
- license.txt → license.md +0 -0
- readme.md +62 -52
- readme.txt +34 -37
breadcrumb-trail.php
CHANGED
@@ -1,25 +1,37 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Breadcrumb Trail
|
4 |
-
* Plugin URI:
|
5 |
* Description: A smart breadcrumb menu plugin embedded with <a href="http://schema.org">Schema.org</a> microdata that can handle variations in site structure more accurately than any other breadcrumb plugin for WordPress. Insert into your theme with the <code>breadcrumb_trail()</code> template tag.
|
6 |
-
* Version: 1.
|
7 |
* Author: Justin Tadlock
|
8 |
-
* Author URI:
|
9 |
* Text Domain: breadcrumb-trail
|
10 |
-
* Domain Path: /
|
11 |
*/
|
12 |
|
13 |
# Extra check in case the script is being loaded by a theme.
|
14 |
-
if ( !function_exists( 'breadcrumb_trail' ) )
|
15 |
require_once( 'inc/breadcrumbs.php' );
|
16 |
|
17 |
-
#
|
18 |
-
|
19 |
|
20 |
# Check theme support. */
|
21 |
add_action( 'after_setup_theme', 'breadcrumb_trail_theme_setup', 12 );
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
/**
|
24 |
* Checks if the theme supports the Breadcrumb Trail script. If it doesn't, we'll hook some styles
|
25 |
* into the header.
|
@@ -30,7 +42,7 @@ add_action( 'after_setup_theme', 'breadcrumb_trail_theme_setup', 12 );
|
|
30 |
*/
|
31 |
function breadcrumb_trail_theme_setup() {
|
32 |
|
33 |
-
if ( !current_theme_supports( 'breadcrumb-trail' ) )
|
34 |
add_action( 'wp_head', 'breadcrumb_trail_print_styles' );
|
35 |
}
|
36 |
|
@@ -75,5 +87,8 @@ function breadcrumb_trail_print_styles() {
|
|
75 |
display: none;
|
76 |
}';
|
77 |
|
78 |
-
|
|
|
|
|
|
|
79 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Breadcrumb Trail
|
4 |
+
* Plugin URI: https://themehybrid.com/plugins/breadcrumb-trail
|
5 |
* Description: A smart breadcrumb menu plugin embedded with <a href="http://schema.org">Schema.org</a> microdata that can handle variations in site structure more accurately than any other breadcrumb plugin for WordPress. Insert into your theme with the <code>breadcrumb_trail()</code> template tag.
|
6 |
+
* Version: 1.1.0
|
7 |
* Author: Justin Tadlock
|
8 |
+
* Author URI: https://themehybrid.com
|
9 |
* Text Domain: breadcrumb-trail
|
10 |
+
* Domain Path: /lang
|
11 |
*/
|
12 |
|
13 |
# Extra check in case the script is being loaded by a theme.
|
14 |
+
if ( ! function_exists( 'breadcrumb_trail' ) )
|
15 |
require_once( 'inc/breadcrumbs.php' );
|
16 |
|
17 |
+
# Plugin setup callback.
|
18 |
+
add_action( 'plugins_loaded', 'breadcrumb_trail_setup' );
|
19 |
|
20 |
# Check theme support. */
|
21 |
add_action( 'after_setup_theme', 'breadcrumb_trail_theme_setup', 12 );
|
22 |
|
23 |
+
/**
|
24 |
+
* Plugin setup. For now, it just loads the translation.
|
25 |
+
*
|
26 |
+
* @since 1.1.0
|
27 |
+
* @access public
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
function breadcrumb_trail_setup() {
|
31 |
+
|
32 |
+
load_plugin_textdomain( 'breadcrumb-trail', false, trailingslashit( dirname( plugin_basename( __FILE__ ) ) ) . 'lang' );
|
33 |
+
}
|
34 |
+
|
35 |
/**
|
36 |
* Checks if the theme supports the Breadcrumb Trail script. If it doesn't, we'll hook some styles
|
37 |
* into the header.
|
42 |
*/
|
43 |
function breadcrumb_trail_theme_setup() {
|
44 |
|
45 |
+
if ( ! current_theme_supports( 'breadcrumb-trail' ) )
|
46 |
add_action( 'wp_head', 'breadcrumb_trail_print_styles' );
|
47 |
}
|
48 |
|
87 |
display: none;
|
88 |
}';
|
89 |
|
90 |
+
$style = apply_filters( 'breadcrumb_trail_inline_style', trim( str_replace( array( "\r", "\n", "\t", " " ), '', $style ) ) );
|
91 |
+
|
92 |
+
if ( $style )
|
93 |
+
echo "\n" . '<style type="text/css" id="breadcrumb-trail-css">' . $style . '</style>' . "\n";
|
94 |
}
|
changelog.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1 |
# Change Log
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## [1.0.0] - 2015-07-07
|
4 |
|
5 |
### Added
|
@@ -132,4 +156,4 @@
|
|
132 |
|
133 |
## [0.1.0]
|
134 |
|
135 |
-
* Launch of the new plugin.
|
1 |
# Change Log
|
2 |
|
3 |
+
## [1.1.0] - 2017-09-24
|
4 |
+
|
5 |
+
### Added
|
6 |
+
|
7 |
+
* Handles mapping rewrite tags for any post type now. Any of the standard rewrite tags are mapped. It also handles any custom taxonomy when used as part of the post type rewrite slug (e.g., `%genre%`, `%portfolio_tag%`, etc.).
|
8 |
+
* Adds proper breadcrumbs when viewing post type archives by author.
|
9 |
+
* Support for paged comments. When viewing paged comments, the post title gets linked and `Comment Page %s` becomes the final item.
|
10 |
+
* New `paged_comments` label available.
|
11 |
+
* `browse_tag` argument for controlling the header/browse tag. Defaults to `h2`.
|
12 |
+
* `list_tag` argument for controlling the list tag. Defaults to `ul`.
|
13 |
+
* `item_tag` argument for controlling the item tag. Defaults to `li`.
|
14 |
+
* The `itemprop="item"` microdata for the list item inner element.
|
15 |
+
* The `breadcrumb_trail_inline_style` filter hook for changing or disabling the inline style.
|
16 |
+
|
17 |
+
### Changed
|
18 |
+
|
19 |
+
* Changes default search label to `Search results for: %s` to avoid double quotes (search queries sometimes have quotes in them).
|
20 |
+
|
21 |
+
### Fixed
|
22 |
+
|
23 |
+
* Properly reverse term parents array (in wrong order before).
|
24 |
+
* Uses `wp_list_sort()` for sorting terms, available since WP 4.7.
|
25 |
+
* Wraps `home_url()` in `user_trailingslashit()` to make sure it has a trailing slash when it should.
|
26 |
+
|
27 |
## [1.0.0] - 2015-07-07
|
28 |
|
29 |
### Added
|
156 |
|
157 |
## [0.1.0]
|
158 |
|
159 |
+
* Launch of the new plugin.
|
contributing.md
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Contributing
|
2 |
+
|
3 |
+
The code for the project is handled via its [GitHub Repository](https://github.com/justintadlock/breadcrumb-trail). You can open tickets, create patches, and send pull requests there.
|
4 |
+
|
5 |
+
## Pull requests
|
6 |
+
|
7 |
+
Problem first. Solution second.
|
8 |
+
|
9 |
+
Pull requests should have a ticket open for discussion first. I rarely accept pull requests that aren't for a specific issue for various reasons. It's far better to post an issue and let me or the community provide feedback prior to creating a pull request.
|
10 |
+
|
11 |
+
Please don't make pull requests against the `master` branch. This is the latest, stable code. You can make a pull request against one of the point branches or the `dev` (future release) branch.
|
12 |
+
|
13 |
+
## Coding standards
|
14 |
+
|
15 |
+
In general, the project follows all WordPress [coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards). There are instances where it doesn't, opting for personal choices of my own, but in terms of contributing, following the WordPress standards is best practice.
|
16 |
+
|
17 |
+
## Script and style files
|
18 |
+
|
19 |
+
When making patches or pull requests with changes to script or style files, only do so to the primary file. Don't create patches for the minified (`.min`) versions of the files. Those will be minified after a patch is merged into the code base.
|
20 |
+
|
21 |
+
## Language
|
22 |
+
|
23 |
+
All text strings follow U.S. English by default. While such guides are generally unneeded, in cases where style considerations are necessary, these will typically follow conventions laid out in *Elements of Style* or the *AP Stylebook*.
|
24 |
+
|
25 |
+
## Licensing
|
26 |
+
|
27 |
+
Any code contributed to the project via patches, pull requests, or other means will be licensed under the [GPL version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) or later. By contributing code to the project, you provide consent to use such code under this license. The exception to this rule is when bringing in third-party code with an alternate open source license.
|
28 |
+
|
29 |
+
## Versioning
|
30 |
+
|
31 |
+
The project uses [semantic versioning](http://semver.org). Version numbers will look like `3.2.1` where `3` is the "major" release, `2` is the minor release, and `1` is the patch release.
|
inc/breadcrumbs.php
CHANGED
@@ -15,10 +15,10 @@
|
|
15 |
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
*
|
17 |
* @package BreadcrumbTrail
|
18 |
-
* @version 1.
|
19 |
* @author Justin Tadlock <justin@justintadlock.com>
|
20 |
-
* @copyright Copyright (c) 2008 -
|
21 |
-
* @link
|
22 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
23 |
*/
|
24 |
|
@@ -35,7 +35,7 @@ function breadcrumb_trail( $args = array() ) {
|
|
35 |
|
36 |
$breadcrumb = apply_filters( 'breadcrumb_trail_object', null, $args );
|
37 |
|
38 |
-
if ( !is_object( $breadcrumb ) )
|
39 |
$breadcrumb = new Breadcrumb_Trail( $args );
|
40 |
|
41 |
return $breadcrumb->trail();
|
@@ -109,6 +109,9 @@ class Breadcrumb_Trail {
|
|
109 |
* @type string $container Container HTML element. nav|div
|
110 |
* @type string $before String to output before breadcrumb menu.
|
111 |
* @type string $after String to output after breadcrumb menu.
|
|
|
|
|
|
|
112 |
* @type bool $show_on_front Whether to show when `is_front_page()`.
|
113 |
* @type bool $network Whether to link to the network main site (multisite only).
|
114 |
* @type bool $show_title Whether to show the title (last item) in the trail.
|
@@ -125,6 +128,9 @@ class Breadcrumb_Trail {
|
|
125 |
'container' => 'nav',
|
126 |
'before' => '',
|
127 |
'after' => '',
|
|
|
|
|
|
|
128 |
'show_on_front' => true,
|
129 |
'network' => false,
|
130 |
'show_title' => true,
|
@@ -165,11 +171,20 @@ class Breadcrumb_Trail {
|
|
165 |
if ( 0 < $item_count ) {
|
166 |
|
167 |
// Add 'browse' label if it should be shown.
|
168 |
-
if ( true === $this->args['show_browse'] )
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|
171 |
// Open the unordered list.
|
172 |
-
$breadcrumb .=
|
|
|
|
|
|
|
173 |
|
174 |
// Add the number of items and item list order schema.
|
175 |
$breadcrumb .= sprintf( '<meta name="numberOfItems" content="%d" />', absint( $item_count ) );
|
@@ -185,7 +200,12 @@ class Breadcrumb_Trail {
|
|
185 |
preg_match( '/(<a.*?>)(.*?)(<\/a>)/i', $item, $matches );
|
186 |
|
187 |
// Wrap the item text with appropriate itemprop.
|
188 |
-
$item = !empty( $matches ) ? sprintf( '%s<span itemprop="name">%s</span>%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '<span itemprop="name">%s</span>', $item );
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
// Add list item classes.
|
191 |
$item_class = 'trail-item';
|
@@ -203,11 +223,11 @@ class Breadcrumb_Trail {
|
|
203 |
$meta = sprintf( '<meta itemprop="position" content="%s" />', absint( $item_position ) );
|
204 |
|
205 |
// Build the list item.
|
206 |
-
$breadcrumb .= sprintf( '
|
207 |
}
|
208 |
|
209 |
// Close the unordered list.
|
210 |
-
$breadcrumb .= '
|
211 |
|
212 |
// Wrap the breadcrumb trail.
|
213 |
$breadcrumb = sprintf(
|
@@ -246,10 +266,12 @@ class Breadcrumb_Trail {
|
|
246 |
'home' => esc_html__( 'Home', 'breadcrumb-trail' ),
|
247 |
'error_404' => esc_html__( '404 Not Found', 'breadcrumb-trail' ),
|
248 |
'archives' => esc_html__( 'Archives', 'breadcrumb-trail' ),
|
249 |
-
// Translators: %s is the search query.
|
250 |
-
'search' => esc_html__( 'Search results for
|
251 |
// Translators: %s is the page number.
|
252 |
'paged' => esc_html__( 'Page %s', 'breadcrumb-trail' ),
|
|
|
|
|
253 |
// Translators: Minute archive title. %s is the minute time format.
|
254 |
'archive_minute' => esc_html__( 'Minute %s', 'breadcrumb-trail' ),
|
255 |
// Translators: Weekly archive title. %s is the week date format.
|
@@ -309,7 +331,7 @@ class Breadcrumb_Trail {
|
|
309 |
|
310 |
// If viewing the home/blog page.
|
311 |
if ( is_home() ) {
|
312 |
-
$this->
|
313 |
}
|
314 |
|
315 |
// If viewing a single post.
|
@@ -399,6 +421,10 @@ class Breadcrumb_Trail {
|
|
399 |
if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] )
|
400 |
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) );
|
401 |
|
|
|
|
|
|
|
|
|
402 |
// If viewing a paged archive-type page.
|
403 |
elseif ( is_paged() && true === $this->args['show_title'] )
|
404 |
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) );
|
@@ -413,7 +439,7 @@ class Breadcrumb_Trail {
|
|
413 |
*/
|
414 |
protected function add_network_home_link() {
|
415 |
|
416 |
-
if ( is_multisite() && !is_main_site() && true === $this->args['network'] )
|
417 |
$this->items[] = sprintf( '<a href="%s" rel="home">%s</a>', esc_url( network_home_url() ), $this->labels['home'] );
|
418 |
}
|
419 |
|
@@ -426,11 +452,11 @@ class Breadcrumb_Trail {
|
|
426 |
*/
|
427 |
protected function add_site_home_link() {
|
428 |
|
429 |
-
$network = is_multisite() && !is_main_site() && true === $this->args['network'];
|
430 |
$label = $network ? get_bloginfo( 'name' ) : $this->labels['home'];
|
431 |
$rel = $network ? '' : ' rel="home"';
|
432 |
|
433 |
-
$this->items[] = sprintf( '<a href="%s"%s>%s</a>', esc_url( home_url() ), $rel, $label );
|
434 |
}
|
435 |
|
436 |
/**
|
@@ -465,7 +491,7 @@ class Breadcrumb_Trail {
|
|
465 |
* @access protected
|
466 |
* @return void
|
467 |
*/
|
468 |
-
protected function
|
469 |
|
470 |
// Get the post ID and post.
|
471 |
$post_id = get_queried_object_id();
|
@@ -508,13 +534,13 @@ class Breadcrumb_Trail {
|
|
508 |
$this->add_post_hierarchy( $post_id );
|
509 |
|
510 |
// Display terms for specific post type taxonomy if requested.
|
511 |
-
if ( !empty( $this->post_taxonomy[ $post->post_type ] ) )
|
512 |
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
513 |
|
514 |
// End with the post title.
|
515 |
if ( $post_title = single_post_title( '', false ) ) {
|
516 |
|
517 |
-
if ( 1 < get_query_var( 'page' ) || is_paged() )
|
518 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $post_title );
|
519 |
|
520 |
elseif ( true === $this->args['show_title'] )
|
@@ -573,12 +599,12 @@ class Breadcrumb_Trail {
|
|
573 |
// Get public post types that match the rewrite slug.
|
574 |
$post_types = $this->get_post_types_by_slug( $match );
|
575 |
|
576 |
-
if ( !empty( $post_types ) ) {
|
577 |
|
578 |
$post_type_object = $post_types[0];
|
579 |
|
580 |
// Add support for a non-standard label of 'archive_title' (special use case).
|
581 |
-
$label = !empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
582 |
|
583 |
// Core filter hook.
|
584 |
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
|
@@ -610,7 +636,7 @@ class Breadcrumb_Trail {
|
|
610 |
} else {
|
611 |
$post_type_object = get_post_type_object( $taxonomy->object_type[0] );
|
612 |
|
613 |
-
$label = !empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
614 |
|
615 |
// Core filter hook.
|
616 |
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
|
@@ -650,16 +676,20 @@ class Breadcrumb_Trail {
|
|
650 |
$this->add_rewrite_front_items();
|
651 |
|
652 |
// If there's a rewrite slug, check for parents.
|
653 |
-
if ( !empty( $post_type_object->rewrite['slug'] ) )
|
654 |
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
655 |
}
|
656 |
|
657 |
// Add the post type [plural] name to the trail end.
|
658 |
-
if ( is_paged() )
|
659 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) );
|
660 |
|
661 |
elseif ( true === $this->args['show_title'] )
|
662 |
$this->items[] = post_type_archive_title( '', false );
|
|
|
|
|
|
|
|
|
663 |
}
|
664 |
|
665 |
/**
|
@@ -680,7 +710,7 @@ class Breadcrumb_Trail {
|
|
680 |
$user_id = get_query_var( 'author' );
|
681 |
|
682 |
// If $author_base exists, check for parent pages.
|
683 |
-
if ( !empty( $wp_rewrite->author_base ) )
|
684 |
$this->add_path_parents( $wp_rewrite->author_base );
|
685 |
|
686 |
// Add the author's display name to the trail end.
|
@@ -930,7 +960,7 @@ class Breadcrumb_Trail {
|
|
930 |
$this->add_post_hierarchy( $post_id );
|
931 |
|
932 |
// Display terms for specific post type taxonomy if requested.
|
933 |
-
if ( !empty( $this->post_taxonomy[ $post->post_type ] ) )
|
934 |
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
935 |
|
936 |
// Merge the parent items into the items array.
|
@@ -970,7 +1000,7 @@ class Breadcrumb_Trail {
|
|
970 |
$this->add_rewrite_front_items();
|
971 |
|
972 |
// If there's a path, check for parents.
|
973 |
-
if ( !empty( $post_type_object->rewrite['slug'] ) )
|
974 |
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
975 |
}
|
976 |
|
@@ -978,13 +1008,17 @@ class Breadcrumb_Trail {
|
|
978 |
if ( $post_type_object->has_archive ) {
|
979 |
|
980 |
// Add support for a non-standard label of 'archive_title' (special use case).
|
981 |
-
$label = !empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
982 |
|
983 |
// Core filter hook.
|
984 |
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
|
985 |
|
986 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type ) ), $label );
|
987 |
}
|
|
|
|
|
|
|
|
|
988 |
}
|
989 |
|
990 |
/**
|
@@ -1032,7 +1066,12 @@ class Breadcrumb_Trail {
|
|
1032 |
if ( $terms && ! is_wp_error( $terms ) ) {
|
1033 |
|
1034 |
// Sort the terms by ID and get the first category.
|
1035 |
-
|
|
|
|
|
|
|
|
|
|
|
1036 |
$term = get_term( $terms[0], $taxonomy );
|
1037 |
|
1038 |
// If the category has a parent, add the hierarchy to the trail.
|
@@ -1066,7 +1105,7 @@ class Breadcrumb_Trail {
|
|
1066 |
// Get parent post by the path.
|
1067 |
$post = get_page_by_path( $path );
|
1068 |
|
1069 |
-
if ( !empty( $post ) ) {
|
1070 |
$this->add_post_parents( $post->ID );
|
1071 |
}
|
1072 |
|
@@ -1093,7 +1132,7 @@ class Breadcrumb_Trail {
|
|
1093 |
$post = get_page_by_path( trim( $path, '/' ) );
|
1094 |
|
1095 |
// If a parent post is found, set the $post_id and break out of the loop.
|
1096 |
-
if ( !empty( $post ) && 0 < $post->ID ) {
|
1097 |
$this->add_post_parents( $post->ID );
|
1098 |
break;
|
1099 |
}
|
@@ -1131,8 +1170,8 @@ class Breadcrumb_Trail {
|
|
1131 |
}
|
1132 |
|
1133 |
// If we have parent terms, reverse the array to put them in the proper order for the trail.
|
1134 |
-
if ( !empty( $parents ) )
|
1135 |
-
$this->items = array_merge( $this->items, $parents );
|
1136 |
}
|
1137 |
|
1138 |
/**
|
@@ -1152,10 +1191,6 @@ class Breadcrumb_Trail {
|
|
1152 |
|
1153 |
$post = get_post( $post_id );
|
1154 |
|
1155 |
-
// If the post doesn't have the `post` post type, bail.
|
1156 |
-
if ( 'post' !== $post->post_type )
|
1157 |
-
return;
|
1158 |
-
|
1159 |
// Trim '/' from both sides of the $path.
|
1160 |
$path = trim( $path, '/' );
|
1161 |
|
@@ -1188,13 +1223,13 @@ class Breadcrumb_Trail {
|
|
1188 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) );
|
1189 |
|
1190 |
// If using the %category% tag, add a link to the first category archive to match permalinks.
|
1191 |
-
elseif ( '%
|
1192 |
|
1193 |
// Force override terms in this post type.
|
1194 |
$this->post_taxonomy[ $post->post_type ] = false;
|
1195 |
|
1196 |
// Add the post categories.
|
1197 |
-
$this->add_post_terms( $post_id, '
|
1198 |
}
|
1199 |
}
|
1200 |
}
|
15 |
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
*
|
17 |
* @package BreadcrumbTrail
|
18 |
+
* @version 1.1.0
|
19 |
* @author Justin Tadlock <justin@justintadlock.com>
|
20 |
+
* @copyright Copyright (c) 2008 - 2017, Justin Tadlock
|
21 |
+
* @link https://themehybrid.com/plugins/breadcrumb-trail
|
22 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
23 |
*/
|
24 |
|
35 |
|
36 |
$breadcrumb = apply_filters( 'breadcrumb_trail_object', null, $args );
|
37 |
|
38 |
+
if ( ! is_object( $breadcrumb ) )
|
39 |
$breadcrumb = new Breadcrumb_Trail( $args );
|
40 |
|
41 |
return $breadcrumb->trail();
|
109 |
* @type string $container Container HTML element. nav|div
|
110 |
* @type string $before String to output before breadcrumb menu.
|
111 |
* @type string $after String to output after breadcrumb menu.
|
112 |
+
* @type string $browse_tag The HTML tag to use to wrap the "Browse" header text.
|
113 |
+
* @type string $list_tag The HTML tag to use for the list wrapper.
|
114 |
+
* @type string $item_tag The HTML tag to use for the item wrapper.
|
115 |
* @type bool $show_on_front Whether to show when `is_front_page()`.
|
116 |
* @type bool $network Whether to link to the network main site (multisite only).
|
117 |
* @type bool $show_title Whether to show the title (last item) in the trail.
|
128 |
'container' => 'nav',
|
129 |
'before' => '',
|
130 |
'after' => '',
|
131 |
+
'browse_tag' => 'h2',
|
132 |
+
'list_tag' => 'ul',
|
133 |
+
'item_tag' => 'li',
|
134 |
'show_on_front' => true,
|
135 |
'network' => false,
|
136 |
'show_title' => true,
|
171 |
if ( 0 < $item_count ) {
|
172 |
|
173 |
// Add 'browse' label if it should be shown.
|
174 |
+
if ( true === $this->args['show_browse'] ) {
|
175 |
+
|
176 |
+
$breadcrumb .= sprintf(
|
177 |
+
'<%1$s class="trail-browse">%2$s</%1$s>',
|
178 |
+
tag_escape( $this->args['browse_tag'] ),
|
179 |
+
$this->labels['browse']
|
180 |
+
);
|
181 |
+
}
|
182 |
|
183 |
// Open the unordered list.
|
184 |
+
$breadcrumb .= sprintf(
|
185 |
+
'<%s class="trail-items" itemscope itemtype="http://schema.org/BreadcrumbList">',
|
186 |
+
tag_escape( $this->args['list_tag'] )
|
187 |
+
);
|
188 |
|
189 |
// Add the number of items and item list order schema.
|
190 |
$breadcrumb .= sprintf( '<meta name="numberOfItems" content="%d" />', absint( $item_count ) );
|
200 |
preg_match( '/(<a.*?>)(.*?)(<\/a>)/i', $item, $matches );
|
201 |
|
202 |
// Wrap the item text with appropriate itemprop.
|
203 |
+
$item = ! empty( $matches ) ? sprintf( '%s<span itemprop="name">%s</span>%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '<span itemprop="name">%s</span>', $item );
|
204 |
+
|
205 |
+
// Wrap the item with its itemprop.
|
206 |
+
$item = ! empty( $matches )
|
207 |
+
? preg_replace( '/(<a.*?)([\'"])>/i', '$1$2 itemprop=$2item$2>', $item )
|
208 |
+
: sprintf( '<span itemprop="item">%s</span>', $item );
|
209 |
|
210 |
// Add list item classes.
|
211 |
$item_class = 'trail-item';
|
223 |
$meta = sprintf( '<meta itemprop="position" content="%s" />', absint( $item_position ) );
|
224 |
|
225 |
// Build the list item.
|
226 |
+
$breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s</%1$s>', tag_escape( $this->args['item_tag'] ),$attributes, $item, $meta );
|
227 |
}
|
228 |
|
229 |
// Close the unordered list.
|
230 |
+
$breadcrumb .= sprintf( '</%s>', tag_escape( $this->args['list_tag'] ) );
|
231 |
|
232 |
// Wrap the breadcrumb trail.
|
233 |
$breadcrumb = sprintf(
|
266 |
'home' => esc_html__( 'Home', 'breadcrumb-trail' ),
|
267 |
'error_404' => esc_html__( '404 Not Found', 'breadcrumb-trail' ),
|
268 |
'archives' => esc_html__( 'Archives', 'breadcrumb-trail' ),
|
269 |
+
// Translators: %s is the search query.
|
270 |
+
'search' => esc_html__( 'Search results for: %s', 'breadcrumb-trail' ),
|
271 |
// Translators: %s is the page number.
|
272 |
'paged' => esc_html__( 'Page %s', 'breadcrumb-trail' ),
|
273 |
+
// Translators: %s is the page number.
|
274 |
+
'paged_comments' => esc_html__( 'Comment Page %s', 'breadcrumb-trail' ),
|
275 |
// Translators: Minute archive title. %s is the minute time format.
|
276 |
'archive_minute' => esc_html__( 'Minute %s', 'breadcrumb-trail' ),
|
277 |
// Translators: Weekly archive title. %s is the week date format.
|
331 |
|
332 |
// If viewing the home/blog page.
|
333 |
if ( is_home() ) {
|
334 |
+
$this->add_blog_items();
|
335 |
}
|
336 |
|
337 |
// If viewing a single post.
|
421 |
if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] )
|
422 |
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) );
|
423 |
|
424 |
+
// If viewing a singular post with paged comments.
|
425 |
+
elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) )
|
426 |
+
$this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) );
|
427 |
+
|
428 |
// If viewing a paged archive-type page.
|
429 |
elseif ( is_paged() && true === $this->args['show_title'] )
|
430 |
$this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) );
|
439 |
*/
|
440 |
protected function add_network_home_link() {
|
441 |
|
442 |
+
if ( is_multisite() && ! is_main_site() && true === $this->args['network'] )
|
443 |
$this->items[] = sprintf( '<a href="%s" rel="home">%s</a>', esc_url( network_home_url() ), $this->labels['home'] );
|
444 |
}
|
445 |
|
452 |
*/
|
453 |
protected function add_site_home_link() {
|
454 |
|
455 |
+
$network = is_multisite() && ! is_main_site() && true === $this->args['network'];
|
456 |
$label = $network ? get_bloginfo( 'name' ) : $this->labels['home'];
|
457 |
$rel = $network ? '' : ' rel="home"';
|
458 |
|
459 |
+
$this->items[] = sprintf( '<a href="%s"%s>%s</a>', esc_url( user_trailingslashit( home_url() ) ), $rel, $label );
|
460 |
}
|
461 |
|
462 |
/**
|
491 |
* @access protected
|
492 |
* @return void
|
493 |
*/
|
494 |
+
protected function add_blog_items() {
|
495 |
|
496 |
// Get the post ID and post.
|
497 |
$post_id = get_queried_object_id();
|
534 |
$this->add_post_hierarchy( $post_id );
|
535 |
|
536 |
// Display terms for specific post type taxonomy if requested.
|
537 |
+
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) )
|
538 |
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
539 |
|
540 |
// End with the post title.
|
541 |
if ( $post_title = single_post_title( '', false ) ) {
|
542 |
|
543 |
+
if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) )
|
544 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $post_title );
|
545 |
|
546 |
elseif ( true === $this->args['show_title'] )
|
599 |
// Get public post types that match the rewrite slug.
|
600 |
$post_types = $this->get_post_types_by_slug( $match );
|
601 |
|
602 |
+
if ( ! empty( $post_types ) ) {
|
603 |
|
604 |
$post_type_object = $post_types[0];
|
605 |
|
606 |
// Add support for a non-standard label of 'archive_title' (special use case).
|
607 |
+
$label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
608 |
|
609 |
// Core filter hook.
|
610 |
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
|
636 |
} else {
|
637 |
$post_type_object = get_post_type_object( $taxonomy->object_type[0] );
|
638 |
|
639 |
+
$label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
640 |
|
641 |
// Core filter hook.
|
642 |
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
|
676 |
$this->add_rewrite_front_items();
|
677 |
|
678 |
// If there's a rewrite slug, check for parents.
|
679 |
+
if ( ! empty( $post_type_object->rewrite['slug'] ) )
|
680 |
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
681 |
}
|
682 |
|
683 |
// Add the post type [plural] name to the trail end.
|
684 |
+
if ( is_paged() || is_author() )
|
685 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) );
|
686 |
|
687 |
elseif ( true === $this->args['show_title'] )
|
688 |
$this->items[] = post_type_archive_title( '', false );
|
689 |
+
|
690 |
+
// If viewing a post type archive by author.
|
691 |
+
if ( is_author() )
|
692 |
+
$this->add_user_archive_items();
|
693 |
}
|
694 |
|
695 |
/**
|
710 |
$user_id = get_query_var( 'author' );
|
711 |
|
712 |
// If $author_base exists, check for parent pages.
|
713 |
+
if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() )
|
714 |
$this->add_path_parents( $wp_rewrite->author_base );
|
715 |
|
716 |
// Add the author's display name to the trail end.
|
960 |
$this->add_post_hierarchy( $post_id );
|
961 |
|
962 |
// Display terms for specific post type taxonomy if requested.
|
963 |
+
if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) )
|
964 |
$this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] );
|
965 |
|
966 |
// Merge the parent items into the items array.
|
1000 |
$this->add_rewrite_front_items();
|
1001 |
|
1002 |
// If there's a path, check for parents.
|
1003 |
+
if ( ! empty( $post_type_object->rewrite['slug'] ) )
|
1004 |
$this->add_path_parents( $post_type_object->rewrite['slug'] );
|
1005 |
}
|
1006 |
|
1008 |
if ( $post_type_object->has_archive ) {
|
1009 |
|
1010 |
// Add support for a non-standard label of 'archive_title' (special use case).
|
1011 |
+
$label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
1012 |
|
1013 |
// Core filter hook.
|
1014 |
$label = apply_filters( 'post_type_archive_title', $label, $post_type_object->name );
|
1015 |
|
1016 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type ) ), $label );
|
1017 |
}
|
1018 |
+
|
1019 |
+
// Map the rewrite tags if there's a `%` in the slug.
|
1020 |
+
if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) )
|
1021 |
+
$this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] );
|
1022 |
}
|
1023 |
|
1024 |
/**
|
1066 |
if ( $terms && ! is_wp_error( $terms ) ) {
|
1067 |
|
1068 |
// Sort the terms by ID and get the first category.
|
1069 |
+
if ( function_exists( 'wp_list_sort' ) )
|
1070 |
+
$terms = wp_list_sort( $terms, 'term_id' );
|
1071 |
+
|
1072 |
+
else
|
1073 |
+
usort( $terms, '_usort_terms_by_ID' );
|
1074 |
+
|
1075 |
$term = get_term( $terms[0], $taxonomy );
|
1076 |
|
1077 |
// If the category has a parent, add the hierarchy to the trail.
|
1105 |
// Get parent post by the path.
|
1106 |
$post = get_page_by_path( $path );
|
1107 |
|
1108 |
+
if ( ! empty( $post ) ) {
|
1109 |
$this->add_post_parents( $post->ID );
|
1110 |
}
|
1111 |
|
1132 |
$post = get_page_by_path( trim( $path, '/' ) );
|
1133 |
|
1134 |
// If a parent post is found, set the $post_id and break out of the loop.
|
1135 |
+
if ( ! empty( $post ) && 0 < $post->ID ) {
|
1136 |
$this->add_post_parents( $post->ID );
|
1137 |
break;
|
1138 |
}
|
1170 |
}
|
1171 |
|
1172 |
// If we have parent terms, reverse the array to put them in the proper order for the trail.
|
1173 |
+
if ( ! empty( $parents ) )
|
1174 |
+
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
1175 |
}
|
1176 |
|
1177 |
/**
|
1191 |
|
1192 |
$post = get_post( $post_id );
|
1193 |
|
|
|
|
|
|
|
|
|
1194 |
// Trim '/' from both sides of the $path.
|
1195 |
$path = trim( $path, '/' );
|
1196 |
|
1223 |
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) );
|
1224 |
|
1225 |
// If using the %category% tag, add a link to the first category archive to match permalinks.
|
1226 |
+
elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) {
|
1227 |
|
1228 |
// Force override terms in this post type.
|
1229 |
$this->post_taxonomy[ $post->post_type ] = false;
|
1230 |
|
1231 |
// Add the post categories.
|
1232 |
+
$this->add_post_terms( $post_id, trim( $tag, '%' ) );
|
1233 |
}
|
1234 |
}
|
1235 |
}
|
{languages → lang}/breadcrumb-trail.pot
RENAMED
@@ -1,114 +1,119 @@
|
|
1 |
-
# Copyright (C)
|
2 |
-
# This file is distributed under the same license as the Breadcrumb Trail package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Breadcrumb Trail 1.
|
6 |
-
"Report-Msgid-Bugs-To:
|
7 |
-
"POT-Creation-Date:
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
|
15 |
-
#: inc/breadcrumbs.php:
|
16 |
-
msgid "Browse:"
|
17 |
-
msgstr ""
|
18 |
-
|
19 |
-
#: inc/breadcrumbs.php:
|
20 |
-
msgctxt "breadcrumbs aria label"
|
21 |
-
msgid "Breadcrumbs"
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
#: inc/breadcrumbs.php:
|
25 |
-
msgid "Home"
|
26 |
-
msgstr ""
|
27 |
-
|
28 |
-
#: inc/breadcrumbs.php:
|
29 |
-
msgid "404 Not Found"
|
30 |
-
msgstr ""
|
31 |
-
|
32 |
-
#: inc/breadcrumbs.php:
|
33 |
-
msgid "Archives"
|
34 |
-
msgstr ""
|
35 |
-
|
36 |
-
#. Translators: %s is the search query.
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
msgid "
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: inc/breadcrumbs.php:
|
67 |
-
msgctxt "minute archives time format"
|
68 |
-
msgid "i"
|
69 |
-
msgstr ""
|
70 |
-
|
71 |
-
#: inc/breadcrumbs.php:
|
72 |
-
msgctxt "
|
73 |
-
msgid "
|
74 |
-
msgstr ""
|
75 |
-
|
76 |
-
#: inc/breadcrumbs.php:
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
#: inc/breadcrumbs.php:
|
83 |
-
msgctxt "
|
84 |
-
msgid "
|
85 |
-
msgstr ""
|
86 |
-
|
87 |
-
#: inc/breadcrumbs.php:
|
88 |
-
msgctxt "
|
89 |
-
msgid "
|
90 |
-
msgstr ""
|
91 |
-
|
92 |
-
#: inc/breadcrumbs.php:
|
93 |
-
msgctxt "
|
94 |
-
msgid "
|
95 |
-
msgstr ""
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2017 Breadcrumb Trail
|
2 |
+
# This file is distributed under the same license as the Breadcrumb Trail package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Breadcrumb Trail 1.1.0-dev\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/breadcrumb-trail\n"
|
7 |
+
"POT-Creation-Date: 2017-09-24 16:33:56+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
|
12 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
|
15 |
+
#: inc/breadcrumbs.php:264
|
16 |
+
msgid "Browse:"
|
17 |
+
msgstr ""
|
18 |
+
|
19 |
+
#: inc/breadcrumbs.php:265
|
20 |
+
msgctxt "breadcrumbs aria label"
|
21 |
+
msgid "Breadcrumbs"
|
22 |
+
msgstr ""
|
23 |
+
|
24 |
+
#: inc/breadcrumbs.php:266
|
25 |
+
msgid "Home"
|
26 |
+
msgstr ""
|
27 |
+
|
28 |
+
#: inc/breadcrumbs.php:267
|
29 |
+
msgid "404 Not Found"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: inc/breadcrumbs.php:268
|
33 |
+
msgid "Archives"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#. Translators: %s is the search query.
|
37 |
+
|
38 |
+
#: inc/breadcrumbs.php:270
|
39 |
+
msgid "Search results for: %s"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#. Translators: %s is the page number.
|
43 |
+
|
44 |
+
#: inc/breadcrumbs.php:272
|
45 |
+
msgid "Page %s"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
#. Translators: %s is the page number.
|
49 |
+
|
50 |
+
#: inc/breadcrumbs.php:274
|
51 |
+
msgid "Comment Page %s"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#. Translators: Minute archive title. %s is the minute time format.
|
55 |
+
|
56 |
+
#: inc/breadcrumbs.php:276
|
57 |
+
msgid "Minute %s"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#. Translators: Weekly archive title. %s is the week date format.
|
61 |
+
|
62 |
+
#: inc/breadcrumbs.php:278
|
63 |
+
msgid "Week %s"
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: inc/breadcrumbs.php:738
|
67 |
+
msgctxt "minute and hour archives time format"
|
68 |
+
msgid "g:i a"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: inc/breadcrumbs.php:755
|
72 |
+
msgctxt "minute archives time format"
|
73 |
+
msgid "i"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: inc/breadcrumbs.php:772
|
77 |
+
msgctxt "hour archives time format"
|
78 |
+
msgid "g a"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: inc/breadcrumbs.php:788 inc/breadcrumbs.php:817 inc/breadcrumbs.php:844
|
82 |
+
#: inc/breadcrumbs.php:871 inc/breadcrumbs.php:1211
|
83 |
+
msgctxt "yearly archives date format"
|
84 |
+
msgid "Y"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: inc/breadcrumbs.php:789 inc/breadcrumbs.php:845 inc/breadcrumbs.php:1215
|
88 |
+
msgctxt "monthly archives date format"
|
89 |
+
msgid "F"
|
90 |
+
msgstr ""
|
91 |
+
|
92 |
+
#: inc/breadcrumbs.php:790 inc/breadcrumbs.php:1219
|
93 |
+
msgctxt "daily archives date format"
|
94 |
+
msgid "j"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: inc/breadcrumbs.php:818
|
98 |
+
msgctxt "weekly archives date format"
|
99 |
+
msgid "W"
|
100 |
+
msgstr ""
|
101 |
+
#. Plugin Name of the plugin/theme
|
102 |
+
msgid "Breadcrumb Trail"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#. Plugin URI of the plugin/theme
|
106 |
+
msgid "http://themehybrid.com/plugins/breadcrumb-trail"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#. Description of the plugin/theme
|
110 |
+
msgid "A smart breadcrumb menu plugin embedded with <a href=\"http://schema.org\">Schema.org</a> microdata that can handle variations in site structure more accurately than any other breadcrumb plugin for WordPress. Insert into your theme with the <code>breadcrumb_trail()</code> template tag."
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#. Author of the plugin/theme
|
114 |
+
msgid "Justin Tadlock"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#. Author URI of the plugin/theme
|
118 |
+
msgid "http://justintadlock.com"
|
119 |
+
msgstr ""
|
languages/breadcrumb-trail-fi.mo
DELETED
Binary file
|
languages/breadcrumb-trail-fi.po
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: Breadcrumb Trail WordPress Plugin\n"
|
4 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/breadcrumb-trail\n"
|
5 |
-
"POT-Creation-Date: 2015-07-07 16:55:40+00:00\n"
|
6 |
-
"PO-Revision-Date: 2015-07-07 11:58-0600\n"
|
7 |
-
"Last-Translator: Sami Keijonen <sami.keijonen@foxnet.fi>\n"
|
8 |
-
"Language-Team: Foxnet Themes <sami.keijonen@foxnet.fi>\n"
|
9 |
-
"Language: fi\n"
|
10 |
-
"MIME-Version: 1.0\n"
|
11 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
-
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"X-Generator: Poedit 1.5.7\n"
|
14 |
-
"X-Poedit-KeywordsList: _e;__;esc_attr_e;esc_attr__;esc_html_e;esc_html__;_n;"
|
15 |
-
"_x;_x:1,2c;_n:1,2\n"
|
16 |
-
"X-Poedit-Basepath: ../\n"
|
17 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18 |
-
"X-Poedit-SearchPath-0: .\n"
|
19 |
-
|
20 |
-
#: inc/breadcrumbs.php:244
|
21 |
-
msgid "Browse:"
|
22 |
-
msgstr "Olet täällä:"
|
23 |
-
|
24 |
-
#: inc/breadcrumbs.php:245
|
25 |
-
msgctxt "breadcrumbs aria label"
|
26 |
-
msgid "Breadcrumbs"
|
27 |
-
msgstr ""
|
28 |
-
|
29 |
-
#: inc/breadcrumbs.php:246
|
30 |
-
msgid "Home"
|
31 |
-
msgstr "Etusivu"
|
32 |
-
|
33 |
-
#: inc/breadcrumbs.php:247
|
34 |
-
msgid "404 Not Found"
|
35 |
-
msgstr "404 Sivua ei löytynyt"
|
36 |
-
|
37 |
-
#: inc/breadcrumbs.php:248
|
38 |
-
msgid "Archives"
|
39 |
-
msgstr "Arkistot"
|
40 |
-
|
41 |
-
#. Translators: %s is the search query. The HTML entities are opening and
|
42 |
-
#. closing curly quotes.
|
43 |
-
#: inc/breadcrumbs.php:250
|
44 |
-
msgid "Search results for “%s”"
|
45 |
-
msgstr "Hakutulokset haulle: \"%s\""
|
46 |
-
|
47 |
-
#. Translators: %s is the page number.
|
48 |
-
#: inc/breadcrumbs.php:252
|
49 |
-
msgid "Page %s"
|
50 |
-
msgstr "Sivu %d"
|
51 |
-
|
52 |
-
#. Translators: Minute archive title. %s is the minute time format.
|
53 |
-
#: inc/breadcrumbs.php:254
|
54 |
-
msgid "Minute %s"
|
55 |
-
msgstr "Minuutti %d"
|
56 |
-
|
57 |
-
#. Translators: Weekly archive title. %s is the week date format.
|
58 |
-
#: inc/breadcrumbs.php:256
|
59 |
-
msgid "Week %s"
|
60 |
-
msgstr "Viikko %d"
|
61 |
-
|
62 |
-
#: inc/breadcrumbs.php:708
|
63 |
-
msgctxt "minute and hour archives time format"
|
64 |
-
msgid "g:i a"
|
65 |
-
msgstr "G:i"
|
66 |
-
|
67 |
-
#: inc/breadcrumbs.php:725
|
68 |
-
msgctxt "minute archives time format"
|
69 |
-
msgid "i"
|
70 |
-
msgstr ""
|
71 |
-
|
72 |
-
#: inc/breadcrumbs.php:742
|
73 |
-
msgctxt "hour archives time format"
|
74 |
-
msgid "g a"
|
75 |
-
msgstr "g a"
|
76 |
-
|
77 |
-
#: inc/breadcrumbs.php:758 inc/breadcrumbs.php:787 inc/breadcrumbs.php:814
|
78 |
-
#: inc/breadcrumbs.php:841 inc/breadcrumbs.php:1176
|
79 |
-
msgctxt "yearly archives date format"
|
80 |
-
msgid "Y"
|
81 |
-
msgstr "Y"
|
82 |
-
|
83 |
-
#: inc/breadcrumbs.php:759 inc/breadcrumbs.php:815 inc/breadcrumbs.php:1180
|
84 |
-
msgctxt "monthly archives date format"
|
85 |
-
msgid "F"
|
86 |
-
msgstr "F"
|
87 |
-
|
88 |
-
#: inc/breadcrumbs.php:760 inc/breadcrumbs.php:1184
|
89 |
-
msgctxt "daily archives date format"
|
90 |
-
msgid "j"
|
91 |
-
msgstr ""
|
92 |
-
|
93 |
-
#: inc/breadcrumbs.php:788
|
94 |
-
msgctxt "weekly archives date format"
|
95 |
-
msgid "W"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#. Plugin Name of the plugin/theme
|
99 |
-
msgid "Breadcrumb Trail"
|
100 |
-
msgstr ""
|
101 |
-
|
102 |
-
#. Plugin URI of the plugin/theme
|
103 |
-
msgid "http://themehybrid.com/plugins/breadcrumb-trail"
|
104 |
-
msgstr ""
|
105 |
-
|
106 |
-
#. Description of the plugin/theme
|
107 |
-
msgid ""
|
108 |
-
"A smart breadcrumb menu plugin embedded with <a href=\"http://schema.org"
|
109 |
-
"\">Schema.org</a> microdata that can handle variations in site structure "
|
110 |
-
"more accurately than any other breadcrumb plugin for WordPress. Insert into "
|
111 |
-
"your theme with the <code>breadcrumb_trail()</code> template tag."
|
112 |
-
msgstr ""
|
113 |
-
|
114 |
-
#. Author of the plugin/theme
|
115 |
-
msgid "Justin Tadlock"
|
116 |
-
msgstr ""
|
117 |
-
|
118 |
-
#. Author URI of the plugin/theme
|
119 |
-
msgid "http://justintadlock.com"
|
120 |
-
msgstr ""
|
121 |
-
|
122 |
-
#~ msgid "Edit"
|
123 |
-
#~ msgstr "Muokkaa"
|
124 |
-
|
125 |
-
#~ msgid "Split"
|
126 |
-
#~ msgstr "Jaa"
|
127 |
-
|
128 |
-
#~ msgid "Merge"
|
129 |
-
#~ msgstr "Yhdistä"
|
130 |
-
|
131 |
-
#~ msgid "d"
|
132 |
-
#~ msgstr "d"
|
133 |
-
|
134 |
-
#~ msgid "F Y"
|
135 |
-
#~ msgstr "F Y"
|
136 |
-
|
137 |
-
#~ msgid "F j, Y"
|
138 |
-
#~ msgstr "j.m.Y"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/breadcrumb-trail-fr_FR.mo
DELETED
Binary file
|
languages/breadcrumb-trail-fr_FR.po
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Breadcrumb Trail
|
2 |
-
# This file is distributed under the same license as the Breadcrumb Trail package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Breadcrumb Trail 0.6.1\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/breadcrumb-trail\n"
|
7 |
-
"POT-Creation-Date: 2015-07-07 16:55:40+00:00\n"
|
8 |
-
"PO-Revision-Date: 2015-07-07 11:59-0600\n"
|
9 |
-
"Last-Translator: Sami Keijonen <sami.keijonen@foxnet.fi>\n"
|
10 |
-
"Language-Team: Hexagone <fx@hexagone.io>\n"
|
11 |
-
"Language: fr_FR\n"
|
12 |
-
"MIME-Version: 1.0\n"
|
13 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
-
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Generator: Poedit 1.5.7\n"
|
16 |
-
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
17 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
18 |
-
|
19 |
-
#: inc/breadcrumbs.php:244
|
20 |
-
msgid "Browse:"
|
21 |
-
msgstr "Vous êtes ici :"
|
22 |
-
|
23 |
-
#: inc/breadcrumbs.php:245
|
24 |
-
msgctxt "breadcrumbs aria label"
|
25 |
-
msgid "Breadcrumbs"
|
26 |
-
msgstr ""
|
27 |
-
|
28 |
-
#: inc/breadcrumbs.php:246
|
29 |
-
msgid "Home"
|
30 |
-
msgstr "Accueil"
|
31 |
-
|
32 |
-
#: inc/breadcrumbs.php:247
|
33 |
-
msgid "404 Not Found"
|
34 |
-
msgstr "404 page non trouvée"
|
35 |
-
|
36 |
-
#: inc/breadcrumbs.php:248
|
37 |
-
msgid "Archives"
|
38 |
-
msgstr "Archives"
|
39 |
-
|
40 |
-
#. Translators: %s is the search query. The HTML entities are opening and
|
41 |
-
#. closing curly quotes.
|
42 |
-
#: inc/breadcrumbs.php:250
|
43 |
-
msgid "Search results for “%s”"
|
44 |
-
msgstr "Résultats de recherche pour “%s”"
|
45 |
-
|
46 |
-
#. Translators: %s is the page number.
|
47 |
-
#: inc/breadcrumbs.php:252
|
48 |
-
msgid "Page %s"
|
49 |
-
msgstr "Page %s"
|
50 |
-
|
51 |
-
#. Translators: Minute archive title. %s is the minute time format.
|
52 |
-
#: inc/breadcrumbs.php:254
|
53 |
-
msgid "Minute %s"
|
54 |
-
msgstr "%s minute"
|
55 |
-
|
56 |
-
#. Translators: Weekly archive title. %s is the week date format.
|
57 |
-
#: inc/breadcrumbs.php:256
|
58 |
-
msgid "Week %s"
|
59 |
-
msgstr "Semaine %s"
|
60 |
-
|
61 |
-
#: inc/breadcrumbs.php:708
|
62 |
-
msgctxt "minute and hour archives time format"
|
63 |
-
msgid "g:i a"
|
64 |
-
msgstr "G \\h i \\m\\i\\n"
|
65 |
-
|
66 |
-
#: inc/breadcrumbs.php:725
|
67 |
-
msgctxt "minute archives time format"
|
68 |
-
msgid "i"
|
69 |
-
msgstr "i"
|
70 |
-
|
71 |
-
#: inc/breadcrumbs.php:742
|
72 |
-
msgctxt "hour archives time format"
|
73 |
-
msgid "g a"
|
74 |
-
msgstr "g a"
|
75 |
-
|
76 |
-
#: inc/breadcrumbs.php:758 inc/breadcrumbs.php:787 inc/breadcrumbs.php:814
|
77 |
-
#: inc/breadcrumbs.php:841 inc/breadcrumbs.php:1176
|
78 |
-
msgctxt "yearly archives date format"
|
79 |
-
msgid "Y"
|
80 |
-
msgstr "Y"
|
81 |
-
|
82 |
-
#: inc/breadcrumbs.php:759 inc/breadcrumbs.php:815 inc/breadcrumbs.php:1180
|
83 |
-
msgctxt "monthly archives date format"
|
84 |
-
msgid "F"
|
85 |
-
msgstr "F"
|
86 |
-
|
87 |
-
#: inc/breadcrumbs.php:760 inc/breadcrumbs.php:1184
|
88 |
-
msgctxt "daily archives date format"
|
89 |
-
msgid "j"
|
90 |
-
msgstr "j"
|
91 |
-
|
92 |
-
#: inc/breadcrumbs.php:788
|
93 |
-
msgctxt "weekly archives date format"
|
94 |
-
msgid "W"
|
95 |
-
msgstr "S"
|
96 |
-
|
97 |
-
#. Plugin Name of the plugin/theme
|
98 |
-
msgid "Breadcrumb Trail"
|
99 |
-
msgstr "Breadcrumb Trail"
|
100 |
-
|
101 |
-
#. Plugin URI of the plugin/theme
|
102 |
-
msgid "http://themehybrid.com/plugins/breadcrumb-trail"
|
103 |
-
msgstr "http://themehybrid.com/plugins/breadcrumb-trail"
|
104 |
-
|
105 |
-
#. Description of the plugin/theme
|
106 |
-
msgid ""
|
107 |
-
"A smart breadcrumb menu plugin embedded with <a href=\"http://schema.org"
|
108 |
-
"\">Schema.org</a> microdata that can handle variations in site structure "
|
109 |
-
"more accurately than any other breadcrumb plugin for WordPress. Insert into "
|
110 |
-
"your theme with the <code>breadcrumb_trail()</code> template tag."
|
111 |
-
msgstr ""
|
112 |
-
"Une extension intelligente de fil d'Ariane intégrant les microdonnées de "
|
113 |
-
"<a href=\"http://schema.org\">Schema.org</a> et qui peut gérer les "
|
114 |
-
"variations dans la structure de votre site avec plus de précision que "
|
115 |
-
"n'importe quelle autre extension de Breadcrumb de WordPress. Insérez-la dans "
|
116 |
-
"votre thème avec le modèle <code>breadcrumb_trail()</code>."
|
117 |
-
|
118 |
-
#. Author of the plugin/theme
|
119 |
-
msgid "Justin Tadlock"
|
120 |
-
msgstr "Justin Tadlock"
|
121 |
-
|
122 |
-
#. Author URI of the plugin/theme
|
123 |
-
msgid "http://justintadlock.com"
|
124 |
-
msgstr "http://justintadlock.com"
|
125 |
-
|
126 |
-
#~ msgid "Edit"
|
127 |
-
#~ msgstr "Modifier"
|
128 |
-
|
129 |
-
#~ msgid "Split"
|
130 |
-
#~ msgstr "Diviser"
|
131 |
-
|
132 |
-
#~ msgid "Merge"
|
133 |
-
#~ msgstr "Fusionner"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
license.txt → license.md
RENAMED
File without changes
|
readme.md
CHANGED
@@ -1,67 +1,76 @@
|
|
1 |
-
# Breadcrumb Trail
|
2 |
|
3 |
A powerful script for adding breadcrumbs to your site that supports Schema.org, HTML5-valid microdata.
|
4 |
|
5 |
Breadcrumb Trail is one of the most advanced and robust breadcrumb menu systems available for WordPress. It started out as a small script for basic blogs but has grown into a system that can handle nearly any site's setup to show the most accurate breadcrumbs for each page.
|
6 |
|
7 |
-
## Usage
|
8 |
|
9 |
This script won't work automatically because there's no way for me to know where it should show within your theme. You'll have to add it manually in your template files. You can add it pretty much anywhere you want, but I usually recommend near the bottom of your theme's `header.php` template.
|
10 |
|
11 |
The basic code you need is:
|
12 |
|
13 |
-
|
|
|
|
|
14 |
|
15 |
Actually, you should always wrap it in a `functions_exists()` check too like so:
|
16 |
|
17 |
-
|
|
|
|
|
18 |
|
19 |
That's all you need to do to add breadcrumbs to your site. Of course, you can customize that a bit.
|
20 |
|
21 |
-
### Parameters
|
22 |
|
23 |
The `breadcrumb_trail()` function accepts a single parameter of `$args`, which is an array of arguments for deciding how your breadcrumbs should behave. The default arguments are the following.
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
* `breadcrumb_trail_object` - Filter the `Breadcrumb_Trail` object used for the trail.
|
67 |
* `breadcrumb_trail_args` - Filter hook on the array of arguments passed in.
|
@@ -69,33 +78,34 @@ The `breadcrumb_trail()` function accepts a single parameter of `$args`, which i
|
|
69 |
* `breadcrumb_trail_post_taxonomy` - Filter hook on the taxonomy to use with specific post types.
|
70 |
* `breadcrumb_trail_items` - Filter hook on the array of items before being output.
|
71 |
* `breadcrumb_trail` - Filter hook on the HTML output of the breadcrumb trail.
|
|
|
72 |
|
73 |
-
### Extending `Breadcrumb_Trail`
|
74 |
|
75 |
You can extend the `Breadcrumb_Trail` class with a custom class if needed. When creating a sub-class, you'll need to filter `breadcrumb_trail_object` to tell the plugin to use your class. Always return an object on this filter.
|
76 |
|
77 |
-
#### Available properties
|
78 |
|
79 |
* `$items` - Array of trail items.
|
80 |
* `$args` - The parsed arguments passed in.
|
81 |
* `$labels` - The parsed text labels.
|
82 |
* `$post_taxonomy` - The parsed post taxonomy array.
|
83 |
|
84 |
-
#### Available methods
|
85 |
|
86 |
* `trail()` - Outputs/returns the final HTML.
|
87 |
* `add_items()` - Method for filling the `$items` array.
|
88 |
|
89 |
Others are available, but those are the two you would actually put into real-world use.
|
90 |
|
91 |
-
## Support
|
92 |
|
93 |
-
I run a WordPress community called [Theme Hybrid](
|
94 |
|
95 |
I know. I know. You might not want to pay for support, but just consider it a donation to the project. To continue making cool, GPL-licensed plugins/themes and having the time to support them, I must pay the bills.
|
96 |
|
97 |
-
## Copyright and License
|
98 |
|
99 |
Breadcrumb Trail is licensed under the [GNU GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html), version 2 or later.
|
100 |
|
101 |
-
2008 – 
|
1 |
+
# Breadcrumb Trail
|
2 |
|
3 |
A powerful script for adding breadcrumbs to your site that supports Schema.org, HTML5-valid microdata.
|
4 |
|
5 |
Breadcrumb Trail is one of the most advanced and robust breadcrumb menu systems available for WordPress. It started out as a small script for basic blogs but has grown into a system that can handle nearly any site's setup to show the most accurate breadcrumbs for each page.
|
6 |
|
7 |
+
## Usage
|
8 |
|
9 |
This script won't work automatically because there's no way for me to know where it should show within your theme. You'll have to add it manually in your template files. You can add it pretty much anywhere you want, but I usually recommend near the bottom of your theme's `header.php` template.
|
10 |
|
11 |
The basic code you need is:
|
12 |
|
13 |
+
```
|
14 |
+
<?php breadcrumb_trail(); ?>
|
15 |
+
```
|
16 |
|
17 |
Actually, you should always wrap it in a `functions_exists()` check too like so:
|
18 |
|
19 |
+
```
|
20 |
+
<?php if ( function_exists( 'breadcrumb_trail' ) ) breadcrumb_trail(); ?>
|
21 |
+
```
|
22 |
|
23 |
That's all you need to do to add breadcrumbs to your site. Of course, you can customize that a bit.
|
24 |
|
25 |
+
### Parameters
|
26 |
|
27 |
The `breadcrumb_trail()` function accepts a single parameter of `$args`, which is an array of arguments for deciding how your breadcrumbs should behave. The default arguments are the following.
|
28 |
|
29 |
+
```
|
30 |
+
$defaults = array(
|
31 |
+
'container' => 'nav',
|
32 |
+
'before' => '',
|
33 |
+
'after' => '',
|
34 |
+
'browse_tag' => 'h2',
|
35 |
+
'list_tag' => 'ul',
|
36 |
+
'item_tag' => 'li',
|
37 |
+
'show_on_front' => true,
|
38 |
+
'network' => false,
|
39 |
+
'show_title' => true,
|
40 |
+
'show_browse' => true,
|
41 |
+
'labels' => array(
|
42 |
+
'browse' => esc_html__( 'Browse:', 'breadcrumb-trail' ),
|
43 |
+
'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'breadcrumb-trail' ),
|
44 |
+
'home' => esc_html__( 'Home', 'breadcrumb-trail' ),
|
45 |
+
'error_404' => esc_html__( '404 Not Found', 'breadcrumb-trail' ),
|
46 |
+
'archives' => esc_html__( 'Archives', 'breadcrumb-trail' ),
|
47 |
+
// Translators: %s is the search query.
|
48 |
+
'search' => esc_html__( 'Search results for: %s', 'breadcrumb-trail' ),
|
49 |
+
// Translators: %s is the page number.
|
50 |
+
'paged' => esc_html__( 'Page %s', 'breadcrumb-trail' ),
|
51 |
+
// Translators: %s is the page number.
|
52 |
+
'paged_comments' => esc_html__( 'Comment Page %s', 'breadcrumb-trail' ),
|
53 |
+
// Translators: Minute archive title. %s is the minute time format.
|
54 |
+
'archive_minute' => esc_html__( 'Minute %s', 'breadcrumb-trail' ),
|
55 |
+
// Translators: Weekly archive title. %s is the week date format.
|
56 |
+
'archive_week' => esc_html__( 'Week %s', 'breadcrumb-trail' ),
|
57 |
+
|
58 |
+
// "%s" is replaced with the translated date/time format.
|
59 |
+
'archive_minute_hour' => '%s',
|
60 |
+
'archive_hour' => '%s',
|
61 |
+
'archive_day' => '%s',
|
62 |
+
'archive_month' => '%s',
|
63 |
+
'archive_year' => '%s',
|
64 |
+
),
|
65 |
+
'post_taxonomy' => array(
|
66 |
+
// 'post' => 'post_tag', // 'post' post type and 'post_tag' taxonomy
|
67 |
+
// 'book' => 'genre', // 'book' post type and 'genre' taxonomy
|
68 |
+
),
|
69 |
+
'echo' => true
|
70 |
+
);
|
71 |
+
```
|
72 |
+
|
73 |
+
### Hooks
|
74 |
|
75 |
* `breadcrumb_trail_object` - Filter the `Breadcrumb_Trail` object used for the trail.
|
76 |
* `breadcrumb_trail_args` - Filter hook on the array of arguments passed in.
|
78 |
* `breadcrumb_trail_post_taxonomy` - Filter hook on the taxonomy to use with specific post types.
|
79 |
* `breadcrumb_trail_items` - Filter hook on the array of items before being output.
|
80 |
* `breadcrumb_trail` - Filter hook on the HTML output of the breadcrumb trail.
|
81 |
+
* `breadcrumb_trail_inline_style` - Filter hook on the CSS output in the document head.
|
82 |
|
83 |
+
### Extending `Breadcrumb_Trail`
|
84 |
|
85 |
You can extend the `Breadcrumb_Trail` class with a custom class if needed. When creating a sub-class, you'll need to filter `breadcrumb_trail_object` to tell the plugin to use your class. Always return an object on this filter.
|
86 |
|
87 |
+
#### Available properties
|
88 |
|
89 |
* `$items` - Array of trail items.
|
90 |
* `$args` - The parsed arguments passed in.
|
91 |
* `$labels` - The parsed text labels.
|
92 |
* `$post_taxonomy` - The parsed post taxonomy array.
|
93 |
|
94 |
+
#### Available methods
|
95 |
|
96 |
* `trail()` - Outputs/returns the final HTML.
|
97 |
* `add_items()` - Method for filling the `$items` array.
|
98 |
|
99 |
Others are available, but those are the two you would actually put into real-world use.
|
100 |
|
101 |
+
## Support
|
102 |
|
103 |
+
I run a WordPress community called [Theme Hybrid](https://themehybrid.com), which is where I fully support all of my WordPress plugins, themes, and other projects. You can sign up for an account to get plugin support for a small yearly fee.
|
104 |
|
105 |
I know. I know. You might not want to pay for support, but just consider it a donation to the project. To continue making cool, GPL-licensed plugins/themes and having the time to support them, I must pay the bills.
|
106 |
|
107 |
+
## Copyright and License
|
108 |
|
109 |
Breadcrumb Trail is licensed under the [GNU GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html), version 2 or later.
|
110 |
|
111 |
+
2008 – 2017 © [Justin Tadlock](http://justintadlock.com).
|
readme.txt
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
=== Breadcrumb Trail ===
|
2 |
|
3 |
Contributors: greenshady
|
4 |
-
Donate link:
|
5 |
-
Tags:
|
6 |
-
Requires at least: 4.
|
7 |
-
|
|
|
|
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.htm
|
10 |
|
@@ -14,40 +16,46 @@ A powerful script for adding breadcrumbs to your site that supports Schema.org H
|
|
14 |
|
15 |
Breadcrumb Trail is one of the most advanced and robust breadcrumb menu systems available for WordPress. It started out as a small script for basic blogs but has grown into a system that can handle nearly any site's setup to show the most accurate breadcrumbs for each page.
|
16 |
|
17 |
-
###
|
|
|
|
|
|
|
|
|
18 |
|
19 |
This plugin automatically detects your permalink setup and displays breadcrumbs based off that structure. Nearly all sites have some sort of hierarchy. Breadcrumb Trail recognizes that and builds a set of unique breadcrumbs for each page on your site.
|
20 |
|
21 |
This means that it can also detect custom post types and taxonomies right out of the box. Whatever you throw at it, it's got a solution.
|
22 |
|
23 |
-
### Features
|
24 |
|
25 |
-
* 7+ years of development and user testing.
|
26 |
* Auto-detects the permalink structure of your site for the most accurate breadcrumbs.
|
27 |
* Hooks for plugin/theme developers to overwrite output.
|
28 |
* Coded with object-oriented programming (OOP) methods to allow developers to extend it for those highly-custom setups.
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
33 |
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
38 |
-
3. Add the `breadcrumb_trail()` template tag to your theme.
|
39 |
|
40 |
-
|
|
|
|
|
41 |
|
42 |
== Frequently Asked Questions ==
|
43 |
|
44 |
-
### Why was this plugin created?
|
45 |
|
46 |
Many of my theme users had a real need for a functional breadcrumb menu without having to find and test a lot of other plugins. Therefore, I created a breadcrumbs script for those users. Eventually, I decided to package it as a plugin and share it with others.
|
47 |
|
48 |
The plugin is still mostly packaged with themes and is currently being used on millions of WordPress sites.
|
49 |
|
50 |
-
### What's a breadcrumb menu?
|
51 |
|
52 |
Basically, it's a navigational tool. On many sites, you'll see something that looks like this:
|
53 |
|
@@ -55,7 +63,7 @@ Basically, it's a navigational tool. On many sites, you'll see something that l
|
|
55 |
|
56 |
This plugin allows you to easily add this type of menu your site.
|
57 |
|
58 |
-
### How do I add it to my theme?
|
59 |
|
60 |
There are several methods, but in general, you would add the following line of code to your theme. Generally, this goes somewhere near the bottom of your theme's `header.php` template. However, you can add it anywhere you want in your theme, and it should work.
|
61 |
|
@@ -63,19 +71,15 @@ There are several methods, but in general, you would add the following line of c
|
|
63 |
|
64 |
To see all methods and options, refer to the `readme.md` file included with the plugin download. You can also [view the readme online](https://github.com/justintadlock/breadcrumb-trail/blob/master/readme.md).
|
65 |
|
66 |
-
### How do I disable the plugin styles?
|
67 |
|
68 |
You can disable the plugin styles by adding this to your theme's `functions.php` file:
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
function bct_theme_setup() {
|
73 |
-
add_theme_support( 'breadcrumb-trail' );
|
74 |
-
}
|
75 |
|
76 |
Note that the breadcrumbs will be completely unstyled at this point. You'll need to add style rules to your theme's `style.css` file.
|
77 |
|
78 |
-
### Do breadcrumbs show in Google search results?
|
79 |
|
80 |
Yes, breadcrumbs *can* show in Google search results. The breadcrumbs are coded in a way that all of the major search engines should be able to recognize them. It is marked up with the appropriate Schema.org properties to make it easier for search engines and other systems to understand.
|
81 |
|
@@ -83,21 +87,21 @@ With that said, it's still left up to the search provider to actually show the b
|
|
83 |
|
84 |
Don't expect to see breadcrumbs in your search results on the first day either. It may take a bit, depending on how often your Web site is crawled.
|
85 |
|
86 |
-
### What is Schema.org? Microdata?
|
87 |
|
88 |
[Microdata](http://en.wikipedia.org/wiki/Microdata_(HTML)) is a way to nest metadata into your Web site's pages. It allows things like search engines and browsers to provide a more useful experience for users. Microdata provides a way for you to describe the "meaning" (i.e., semantics) of specific items on your site by using a standardized vocabulary.
|
89 |
|
90 |
[Schema.org](http://schema.org) is a microdata vocabulary. It is a collaboration by Bing, Google, Yahoo!, and Yandex for creating a set of standardized conventions for using microdata on the Web. With these standards in place, we can make our Web sites' data more understandable to search engines and browsers while providing a richer experience for users.
|
91 |
|
92 |
-
### Does this help with SEO?
|
93 |
|
94 |
Well, it doesn't hurt. The way I see it, the more meaningful information you provide to search engines, the more likely you are to rank up. Properly-coded breadcrumbs are just one tool in a gigantic toolbox for building a search-engine optimized site.
|
95 |
|
96 |
-
### The breadcrumbs display the wrong data!
|
97 |
|
98 |
This is rare, especially if you put the code in your header template. However, it can happen on occasion when your theme or another plugin messes with some of WordPress' global variables but doesn't set things back properly after doing whatever it is they're doing.
|
99 |
|
100 |
-
There's not really much I can do to correct that within the Breadcrumb Trail plugin. The only thing I could do is help you fix the theme/plugin causing the issue. If this happens, you'll need to drop by my [support forums](
|
101 |
|
102 |
== Screenshots ==
|
103 |
|
@@ -108,17 +112,10 @@ There's not really much I can do to correct that within the Breadcrumb Trail plu
|
|
108 |
|
109 |
== Upgrade Notice ==
|
110 |
|
111 |
-
### Version 1.0.0+
|
112 |
|
113 |
If upgrading to a version earlier than 1.0.0, your custom styles may need to be adjusted. The HTML markup has changed to a better HTML5 structure.
|
114 |
|
115 |
== Changelog ==
|
116 |
|
117 |
-
Please see the `changelog.md` file included with the plugin file. Or, you can view the [online change log](https://github.com/justintadlock/breadcrumb-trail/blob/master/
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
1 |
=== Breadcrumb Trail ===
|
2 |
|
3 |
Contributors: greenshady
|
4 |
+
Donate link: https://themehybrid.com/donate
|
5 |
+
Tags: breadcrumbs, navigation, menu
|
6 |
+
Requires at least: 4.7
|
7 |
+
Tested up to: 4.8.2
|
8 |
+
Requires PHP: 5.2
|
9 |
+
Stable tag: 1.1.0
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.htm
|
12 |
|
16 |
|
17 |
Breadcrumb Trail is one of the most advanced and robust breadcrumb menu systems available for WordPress. It started out as a small script for basic blogs but has grown into a system that can handle nearly any site's setup to show the most accurate breadcrumbs for each page.
|
18 |
|
19 |
+
### Before using
|
20 |
+
|
21 |
+
Please note that Breadcrumb Trail requires that you understand and know how to edit your theme's PHP code, at least to the extent of copying and pasting one line of code. If you're not comfortable doing this, it's best to ask that your theme author integrate the code necessary to support this plugin.
|
22 |
+
|
23 |
+
### How it works
|
24 |
|
25 |
This plugin automatically detects your permalink setup and displays breadcrumbs based off that structure. Nearly all sites have some sort of hierarchy. Breadcrumb Trail recognizes that and builds a set of unique breadcrumbs for each page on your site.
|
26 |
|
27 |
This means that it can also detect custom post types and taxonomies right out of the box. Whatever you throw at it, it's got a solution.
|
28 |
|
29 |
+
### Features
|
30 |
|
|
|
31 |
* Auto-detects the permalink structure of your site for the most accurate breadcrumbs.
|
32 |
* Hooks for plugin/theme developers to overwrite output.
|
33 |
* Coded with object-oriented programming (OOP) methods to allow developers to extend it for those highly-custom setups.
|
34 |
+
* Properly handles nearly any custom post type or taxonomy.
|
35 |
+
|
36 |
+
### Professional support
|
37 |
|
38 |
+
If you need professional plugin support from me, the plugin author, you can join the club at [Theme Hybrid](https://themehybrid.com/club), which is a professional WordPress help/support site where I handle support for all my plugins and themes for a community of 75,000+ users (and growing).
|
39 |
|
40 |
+
### Plugin Development
|
41 |
|
42 |
+
If you're a theme author, plugin author, or just a code hobbyist, you can follow the development of this plugin on it's [GitHub repository](https://github.com/justintadlock/breadcrumb-trail).
|
43 |
|
44 |
+
### Donations
|
|
|
|
|
45 |
|
46 |
+
Yes, I do accept donations. If you want to donate, you can do so from my [donations page](https://themehybrid.com/donate) or grab me something from my [Amazon Wish List](http://a.co/flUb0ns).
|
47 |
+
|
48 |
+
I appreciate all donations, no matter the size. Further development of this plugin is not contingent on donations, but they are always a nice incentive.
|
49 |
|
50 |
== Frequently Asked Questions ==
|
51 |
|
52 |
+
### Why was this plugin created?
|
53 |
|
54 |
Many of my theme users had a real need for a functional breadcrumb menu without having to find and test a lot of other plugins. Therefore, I created a breadcrumbs script for those users. Eventually, I decided to package it as a plugin and share it with others.
|
55 |
|
56 |
The plugin is still mostly packaged with themes and is currently being used on millions of WordPress sites.
|
57 |
|
58 |
+
### What's a breadcrumb menu?
|
59 |
|
60 |
Basically, it's a navigational tool. On many sites, you'll see something that looks like this:
|
61 |
|
63 |
|
64 |
This plugin allows you to easily add this type of menu your site.
|
65 |
|
66 |
+
### How do I add it to my theme?
|
67 |
|
68 |
There are several methods, but in general, you would add the following line of code to your theme. Generally, this goes somewhere near the bottom of your theme's `header.php` template. However, you can add it anywhere you want in your theme, and it should work.
|
69 |
|
71 |
|
72 |
To see all methods and options, refer to the `readme.md` file included with the plugin download. You can also [view the readme online](https://github.com/justintadlock/breadcrumb-trail/blob/master/readme.md).
|
73 |
|
74 |
+
### How do I disable the plugin styles?
|
75 |
|
76 |
You can disable the plugin styles by adding this to your theme's `functions.php` file:
|
77 |
|
78 |
+
add_filter( 'breadcrumb_trail_inline_style', '__return_false' );
|
|
|
|
|
|
|
|
|
79 |
|
80 |
Note that the breadcrumbs will be completely unstyled at this point. You'll need to add style rules to your theme's `style.css` file.
|
81 |
|
82 |
+
### Do breadcrumbs show in Google search results?
|
83 |
|
84 |
Yes, breadcrumbs *can* show in Google search results. The breadcrumbs are coded in a way that all of the major search engines should be able to recognize them. It is marked up with the appropriate Schema.org properties to make it easier for search engines and other systems to understand.
|
85 |
|
87 |
|
88 |
Don't expect to see breadcrumbs in your search results on the first day either. It may take a bit, depending on how often your Web site is crawled.
|
89 |
|
90 |
+
### What is Schema.org? Microdata?
|
91 |
|
92 |
[Microdata](http://en.wikipedia.org/wiki/Microdata_(HTML)) is a way to nest metadata into your Web site's pages. It allows things like search engines and browsers to provide a more useful experience for users. Microdata provides a way for you to describe the "meaning" (i.e., semantics) of specific items on your site by using a standardized vocabulary.
|
93 |
|
94 |
[Schema.org](http://schema.org) is a microdata vocabulary. It is a collaboration by Bing, Google, Yahoo!, and Yandex for creating a set of standardized conventions for using microdata on the Web. With these standards in place, we can make our Web sites' data more understandable to search engines and browsers while providing a richer experience for users.
|
95 |
|
96 |
+
### Does this help with SEO?
|
97 |
|
98 |
Well, it doesn't hurt. The way I see it, the more meaningful information you provide to search engines, the more likely you are to rank up. Properly-coded breadcrumbs are just one tool in a gigantic toolbox for building a search-engine optimized site.
|
99 |
|
100 |
+
### The breadcrumbs display the wrong data!
|
101 |
|
102 |
This is rare, especially if you put the code in your header template. However, it can happen on occasion when your theme or another plugin messes with some of WordPress' global variables but doesn't set things back properly after doing whatever it is they're doing.
|
103 |
|
104 |
+
There's not really much I can do to correct that within the Breadcrumb Trail plugin. The only thing I could do is help you fix the theme/plugin causing the issue. If this happens, you'll need to drop by my [support forums](https://themehybrid.com/support) to get help.
|
105 |
|
106 |
== Screenshots ==
|
107 |
|
112 |
|
113 |
== Upgrade Notice ==
|
114 |
|
115 |
+
### Version 1.0.0+
|
116 |
|
117 |
If upgrading to a version earlier than 1.0.0, your custom styles may need to be adjusted. The HTML markup has changed to a better HTML5 structure.
|
118 |
|
119 |
== Changelog ==
|
120 |
|
121 |
+
Please see the `changelog.md` file included with the plugin file. Or, you can view the [online change log](https://github.com/justintadlock/breadcrumb-trail/blob/master/changelog.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|