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.0.0 |
Comparing to | |
See all releases |
Code changes from version 0.6.1 to 1.0.0
- breadcrumb-trail.php +64 -3
- changelog.md +135 -0
- inc/breadcrumbs.php +628 -656
- languages/breadcrumb-trail-fi.mo +0 -0
- languages/breadcrumb-trail-fi.po +138 -137
- languages/breadcrumb-trail-fr_FR.mo +0 -0
- languages/breadcrumb-trail-fr_FR.po +133 -0
- languages/breadcrumb-trail.pot +114 -122
- readme.md +31 -131
- readme.txt +20 -99
breadcrumb-trail.php
CHANGED
@@ -3,16 +3,77 @@
|
|
3 |
* Plugin Name: Breadcrumb Trail
|
4 |
* Plugin URI: http://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: 0.
|
7 |
* Author: Justin Tadlock
|
8 |
* Author URI: http://justintadlock.com
|
9 |
* Text Domain: breadcrumb-trail
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
-
|
14 |
if ( !function_exists( 'breadcrumb_trail' ) )
|
15 |
require_once( 'inc/breadcrumbs.php' );
|
16 |
|
17 |
-
|
18 |
load_plugin_textdomain( 'breadcrumb-trail', false, 'breadcrumb-trail/languages' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Plugin Name: Breadcrumb Trail
|
4 |
* Plugin URI: http://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.0.0
|
7 |
* Author: Justin Tadlock
|
8 |
* Author URI: http://justintadlock.com
|
9 |
* Text Domain: breadcrumb-trail
|
10 |
* Domain Path: /languages
|
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 |
+
# Load translation files. Note: Remove this line if packaging with a theme.
|
18 |
load_plugin_textdomain( 'breadcrumb-trail', false, 'breadcrumb-trail/languages' );
|
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.
|
26 |
+
*
|
27 |
+
* @since 1.0.0
|
28 |
+
* @access public
|
29 |
+
* @return void
|
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 |
+
|
37 |
+
/**
|
38 |
+
* Prints CSS styles in the header for themes that don't support Breadcrumb Trail.
|
39 |
+
*
|
40 |
+
* @since 1.0.0
|
41 |
+
* @access public
|
42 |
+
* @return void
|
43 |
+
*/
|
44 |
+
function breadcrumb_trail_print_styles() {
|
45 |
+
|
46 |
+
$style = '
|
47 |
+
.breadcrumbs .trail-browse,
|
48 |
+
.breadcrumbs .trail-items,
|
49 |
+
.breadcrumbs .trail-items li {
|
50 |
+
display: inline-block;
|
51 |
+
margin: 0;
|
52 |
+
padding: 0;
|
53 |
+
border: none;
|
54 |
+
background: transparent;
|
55 |
+
text-indent: 0;
|
56 |
+
}
|
57 |
+
|
58 |
+
.breadcrumbs .trail-browse {
|
59 |
+
font-size: inherit;
|
60 |
+
font-style: inherit;
|
61 |
+
font-weight: inherit;
|
62 |
+
color: inherit;
|
63 |
+
}
|
64 |
+
|
65 |
+
.breadcrumbs .trail-items {
|
66 |
+
list-style: none;
|
67 |
+
}
|
68 |
+
|
69 |
+
.trail-items li::after {
|
70 |
+
content: "\002F";
|
71 |
+
padding: 0 0.5em;
|
72 |
+
}
|
73 |
+
|
74 |
+
.trail-items li:last-of-type::after {
|
75 |
+
display: none;
|
76 |
+
}';
|
77 |
+
|
78 |
+
echo "\n" . '<style type="text/css" id="breadcrumb-trail-css">' . trim( str_replace( array( "\r", "\n", "\t", " " ), '', $style ) ) . '</style>' . "\n";
|
79 |
+
}
|
changelog.md
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Change Log
|
2 |
+
|
3 |
+
## [1.0.0] - 2015-07-07
|
4 |
+
|
5 |
+
### Added
|
6 |
+
|
7 |
+
* Plugins and themes can now filter the `breadcrumb_trail_object` to use their own sub-classes of `Breadcrumb_Trail`.
|
8 |
+
* Adds the `role` and `aria-label` attributes to improve accessibility.
|
9 |
+
* Changed from a flat HTML structure to a proper HTML5 `<nav>` > header > list structure.
|
10 |
+
* Added basic CSS output for themes that don't support the plugin. This was needed for backwards compatibility with the new HTML structure.
|
11 |
+
* Added additional classes for styling in themes such as `.trail-items` (items wrapper) and `.trail-item` (single item).
|
12 |
+
* Improved [Schema.org](http://schema.org) support for the newer [BreadcrumbList](http://schema.org/BreadcrumbList) type.
|
13 |
+
* The category will now be shown by default on sites with a `%postname%` permalink structure for single post views.
|
14 |
+
* Better support for finding related custom post types and taxonomies.
|
15 |
+
* Added French translation files.
|
16 |
+
|
17 |
+
### Fixed
|
18 |
+
|
19 |
+
* Accounts for `is_paged()` on single post views, which is needed for custom post types like forums that are paged.
|
20 |
+
* Always makes sure taxonomy terms exist before adding them as breadcrumb items.
|
21 |
+
* Uses `get_post()` instead of the deprecated `get_page()` function.
|
22 |
+
* Don't show parent page item if it's set as the front page and we're viewing a child page.
|
23 |
+
|
24 |
+
### Changed
|
25 |
+
|
26 |
+
* Removed the `title` attribute for links. This is far better for accessibility.
|
27 |
+
|
28 |
+
### Security
|
29 |
+
|
30 |
+
* Hardening security by making sure all URLs are passed through `esc_url()`.
|
31 |
+
* Hardening security by running translations through `esc_html_e()` and `esc_html__()`.
|
32 |
+
|
33 |
+
### Removed
|
34 |
+
|
35 |
+
* bbPress support was dropped. If needed, developers should sub-class `Breadcrumb_Trail`.
|
36 |
+
|
37 |
+
## [0.6.1]
|
38 |
+
|
39 |
+
* Make sure `breadcrumb_trail()` can return the HTML.
|
40 |
+
* Add `rel="home"` to the home page link. This got removed at some point.
|
41 |
+
* Do network and site home links in bbPress.
|
42 |
+
* Slight fix to stop bbPress from putting double "Forums" in the breadcrumb trail.
|
43 |
+
* The `show_on_front` argument should only work if the front page is not paginated.
|
44 |
+
* Better handling of the text strings, particularly when displaying date/time.
|
45 |
+
* Updated `breadcrumb-trail.pot` file for better translating.
|
46 |
+
|
47 |
+
## [0.6.0]
|
48 |
+
|
49 |
+
* [Schema.org](http://schema.org) support.
|
50 |
+
* Completely overhauled the entire plugin, rewriting large swathes of code from the ground up. This version takes an object-oriented approach.
|
51 |
+
* Blew every other breadcrumb menu script out of the water.
|
52 |
+
|
53 |
+
## [0.5.3]
|
54 |
+
|
55 |
+
### Added
|
56 |
+
|
57 |
+
* Use `post_type_archive_title()` on post type archives in the trail.
|
58 |
+
* Add support for taxonomies that have a `$rewrite->slug` that matches a string value for a custom post type's `has_archive` argument.
|
59 |
+
* Added support for an `archive_title` label for custom post types because we can't use the `post_type_archive_title()` function on single posts views for the post type.
|
60 |
+
* Loads of pagination support on both archive-type pages and paged single posts.
|
61 |
+
* Added support for hierarchical custom post types (get parent posts).
|
62 |
+
* Added the `network` argument to allow multisite owners to run the trail all the way back to the main site.
|
63 |
+
|
64 |
+
### Fixed
|
65 |
+
|
66 |
+
* Only check attachment trail if the attachment has a parent.
|
67 |
+
* Fixed the issue where the wrong post type archive link matches with a term archive page.
|
68 |
+
|
69 |
+
## [0.5.2]
|
70 |
+
|
71 |
+
* No friggin' clue. I think I actually skipped version numbers somehow. :)
|
72 |
+
|
73 |
+
## [0.5.1]
|
74 |
+
|
75 |
+
* Changed license from GPL 2-only to GPL 2+.
|
76 |
+
* Smarter handling of the `trail-begin` and `trail-end` classes.
|
77 |
+
* Added `container` argument for wrapping breadcrumbs in a custom HTML element.
|
78 |
+
* Changed `bbp_get_forum_parent()` to `bbp_get_forum_parent_id()`.
|
79 |
+
|
80 |
+
## [0.5.0]
|
81 |
+
|
82 |
+
* Use hardcoded strings for the textdomain, not a variable.
|
83 |
+
* Inline doc updates.
|
84 |
+
* Added bbPress support.
|
85 |
+
* Use `single_post_title()` instead of `get_the_title()` for post titles.
|
86 |
+
|
87 |
+
## [0.4.1]
|
88 |
+
|
89 |
+
* Use `get_queried_object()` and `get_queried_object_id()` instead of accessing `$wp_query` directly.
|
90 |
+
* Pass `$args` as second parameter in `breadcrumb_trail` hook.
|
91 |
+
|
92 |
+
## [0.4.0]
|
93 |
+
|
94 |
+
* New function: `breadcrumb_trail_get_items()`, which grabs a list of all the trail items. This separates the items from the main `breadcrumb_trail()` function.
|
95 |
+
* New filter hook: `breadcrumb_trail_items`, which allows devs to filter just the items.
|
96 |
+
* New function: `breadcrumb_trail_map_rewrite_tags()`, which maps the permalink structure tags set under Permalink Settings in the admin to make for a much more accurate breadcrumb trail.
|
97 |
+
* New function: `breadcrumb_trail_textdomain()`, which can be filtered when integrating the plugin into a theme to match the theme's textdomain.
|
98 |
+
* Added functionality to handle WP 3.1 post type enhancements.
|
99 |
+
|
100 |
+
## [0.3.2]
|
101 |
+
|
102 |
+
* Smarter logic in certain areas.
|
103 |
+
* Removed localization for things that shouldn't be localized with time formats.
|
104 |
+
* `single_tax` set to `null` instead of `false`.
|
105 |
+
* Better escaping of element attributes.
|
106 |
+
* Use `$wp_query->get_queried_object()` and `$wp_query->get_queried_object_id()`.
|
107 |
+
* Add in initial support of WordPress 3.1's post type archives.
|
108 |
+
* Better formatting and organization of the output late in the function.
|
109 |
+
* Added `trail-before` and `trail-after` CSS classes if `$before` or `$after` is set.
|
110 |
+
|
111 |
+
## [0.3.1]
|
112 |
+
|
113 |
+
* Undefined index error fixes.
|
114 |
+
* Fixes for trying to get a property of a non-object.
|
115 |
+
|
116 |
+
## [0.3.0]
|
117 |
+
|
118 |
+
* Added more support for custom post types and taxonomies.
|
119 |
+
* Added more support for more complex hierarchies.
|
120 |
+
* The breadcrumb trail now recognizes more patterns with pages as part of the permalink structure of other objects.
|
121 |
+
* All post types can have any taxonomy as the leading part of the trail.
|
122 |
+
* Cleaned up the code.
|
123 |
+
|
124 |
+
## [0.2.1]
|
125 |
+
|
126 |
+
* Removed and/or added (depending on the case) the extra separator item on sub-categories and date-/time-based breadcrumbs.
|
127 |
+
|
128 |
+
## [0.2.0]
|
129 |
+
|
130 |
+
* The title of the "home" page (i.e. posts page) when not the front page is now properly recognized.
|
131 |
+
* Cleaned up the code and logic behind the plugin.
|
132 |
+
|
133 |
+
## [0.1.0]
|
134 |
+
|
135 |
+
* Launch of the new plugin.
|
inc/breadcrumbs.php
CHANGED
@@ -2,28 +2,28 @@
|
|
2 |
/**
|
3 |
* Breadcrumb Trail - A breadcrumb menu script for WordPress.
|
4 |
*
|
5 |
-
* Breadcrumb Trail is a script for showing a breadcrumb trail for any type of page. It tries to
|
6 |
-
* anticipate any type of structure and display the best possible trail that matches your site's
|
7 |
-
* permalink structure. While not perfect, it attempts to fill in the gaps left by many other
|
8 |
* breadcrumb scripts.
|
9 |
*
|
10 |
-
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
11 |
-
* General Public License as published by the Free Software Foundation; either version 2 of the License,
|
12 |
* or (at your option) any later version.
|
13 |
*
|
14 |
-
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
15 |
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
*
|
17 |
* @package BreadcrumbTrail
|
18 |
-
* @version 0.
|
19 |
* @author Justin Tadlock <justin@justintadlock.com>
|
20 |
-
* @copyright Copyright (c) 2008 -
|
21 |
* @link http://themehybrid.com/plugins/breadcrumb-trail
|
22 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
23 |
*/
|
24 |
|
25 |
/**
|
26 |
-
* Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class,
|
27 |
* which should be used in theme templates.
|
28 |
*
|
29 |
* @since 0.1.0
|
@@ -33,9 +33,9 @@
|
|
33 |
*/
|
34 |
function breadcrumb_trail( $args = array() ) {
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
$breadcrumb = new Breadcrumb_Trail( $args );
|
40 |
|
41 |
return $breadcrumb->trail();
|
@@ -44,7 +44,8 @@ function breadcrumb_trail( $args = array() ) {
|
|
44 |
/**
|
45 |
* Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user.
|
46 |
*
|
47 |
-
* @since
|
|
|
48 |
*/
|
49 |
class Breadcrumb_Trail {
|
50 |
|
@@ -67,50 +68,87 @@ class Breadcrumb_Trail {
|
|
67 |
public $args = array();
|
68 |
|
69 |
/**
|
70 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
*
|
72 |
* @since 0.6.0
|
73 |
* @access public
|
74 |
-
* @param array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
* @return void
|
76 |
*/
|
77 |
public function __construct( $args = array() ) {
|
78 |
|
79 |
-
/* Remove the bbPress breadcrumbs. */
|
80 |
-
add_filter( 'bbp_get_breadcrumb', '__return_false' );
|
81 |
-
|
82 |
$defaults = array(
|
83 |
-
'container' => '
|
84 |
-
'separator' => '/',
|
85 |
'before' => '',
|
86 |
'after' => '',
|
87 |
'show_on_front' => true,
|
88 |
'network' => false,
|
89 |
-
//'show_edit_link' => false,
|
90 |
'show_title' => true,
|
91 |
'show_browse' => true,
|
92 |
-
'
|
93 |
-
|
94 |
-
|
95 |
-
'post_taxonomy' => array(
|
96 |
-
// 'post' => 'post_tag',
|
97 |
-
// 'book' => 'genre',
|
98 |
-
),
|
99 |
-
|
100 |
-
/* Labels for text used (see Breadcrumb_Trail::default_labels). */
|
101 |
-
'labels' => array()
|
102 |
);
|
103 |
|
|
|
104 |
$this->args = apply_filters( 'breadcrumb_trail_args', wp_parse_args( $args, $defaults ) );
|
105 |
|
106 |
-
|
107 |
-
$this->
|
|
|
108 |
|
109 |
-
|
|
|
110 |
}
|
111 |
|
|
|
|
|
112 |
/**
|
113 |
-
* Formats
|
114 |
*
|
115 |
* @since 0.6.0
|
116 |
* @access public
|
@@ -118,77 +156,106 @@ class Breadcrumb_Trail {
|
|
118 |
*/
|
119 |
public function trail() {
|
120 |
|
121 |
-
|
|
|
|
|
|
|
122 |
|
123 |
-
|
124 |
-
if (
|
125 |
|
126 |
-
|
127 |
-
|
|
|
128 |
|
129 |
-
|
130 |
-
$breadcrumb
|
131 |
|
132 |
-
|
133 |
-
$breadcrumb .= (
|
|
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
$breadcrumb .= "\n\t\t\t" . '<span class="trail-browse">' . $this->args['labels']['browse'] . '</span> ';
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
array_unshift( $this->items, '<span class="trail-begin">' . array_shift( $this->items ) . '</span>' );
|
142 |
|
143 |
-
|
144 |
-
|
145 |
|
146 |
-
|
147 |
-
|
148 |
|
149 |
-
|
150 |
-
|
151 |
|
152 |
-
|
153 |
-
|
154 |
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
|
159 |
-
|
160 |
$breadcrumb = apply_filters( 'breadcrumb_trail', $breadcrumb, $this->args );
|
161 |
|
162 |
-
if (
|
163 |
-
echo $breadcrumb;
|
164 |
-
else
|
165 |
return $breadcrumb;
|
|
|
|
|
166 |
}
|
167 |
|
|
|
|
|
168 |
/**
|
169 |
-
*
|
170 |
*
|
171 |
-
* @since 0.
|
172 |
-
* @access
|
173 |
-
* @return
|
174 |
*/
|
175 |
-
|
176 |
-
|
177 |
-
$
|
178 |
-
'browse' =>
|
179 |
-
'
|
180 |
-
'
|
181 |
-
'
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
192 |
'archive_minute_hour' => '%s',
|
193 |
'archive_hour' => '%s',
|
194 |
'archive_day' => '%s',
|
@@ -196,205 +263,224 @@ class Breadcrumb_Trail {
|
|
196 |
'archive_year' => '%s',
|
197 |
);
|
198 |
|
199 |
-
|
200 |
}
|
201 |
|
202 |
/**
|
203 |
-
*
|
204 |
-
*
|
205 |
*
|
206 |
-
* @since 0.
|
207 |
-
* @access
|
208 |
* @return void
|
209 |
*/
|
210 |
-
|
|
|
|
|
211 |
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
if ( is_front_page() ) {
|
214 |
-
$this->
|
215 |
}
|
216 |
|
217 |
-
|
218 |
else {
|
219 |
|
220 |
-
|
221 |
-
$this->
|
222 |
-
$this->
|
223 |
|
224 |
-
|
225 |
if ( is_home() ) {
|
226 |
-
$this->
|
227 |
}
|
228 |
|
229 |
-
|
230 |
elseif ( is_singular() ) {
|
231 |
-
$this->
|
232 |
}
|
233 |
|
234 |
-
|
235 |
elseif ( is_archive() ) {
|
236 |
|
237 |
if ( is_post_type_archive() )
|
238 |
-
$this->
|
239 |
|
240 |
elseif ( is_category() || is_tag() || is_tax() )
|
241 |
-
$this->
|
242 |
|
243 |
elseif ( is_author() )
|
244 |
-
$this->
|
245 |
|
246 |
elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
|
247 |
-
$this->
|
248 |
|
249 |
elseif ( get_query_var( 'minute' ) )
|
250 |
-
$this->
|
251 |
|
252 |
elseif ( get_query_var( 'hour' ) )
|
253 |
-
$this->
|
254 |
|
255 |
elseif ( is_day() )
|
256 |
-
$this->
|
257 |
|
258 |
elseif ( get_query_var( 'w' ) )
|
259 |
-
$this->
|
260 |
|
261 |
elseif ( is_month() )
|
262 |
-
$this->
|
263 |
|
264 |
elseif ( is_year() )
|
265 |
-
$this->
|
266 |
|
267 |
else
|
268 |
-
$this->
|
269 |
}
|
270 |
|
271 |
-
|
272 |
elseif ( is_search() ) {
|
273 |
-
$this->
|
274 |
}
|
275 |
|
276 |
-
|
277 |
elseif ( is_404() ) {
|
278 |
-
$this->
|
279 |
}
|
280 |
}
|
281 |
|
282 |
-
|
283 |
-
$this->
|
284 |
|
285 |
-
|
286 |
-
$this->items = apply_filters( 'breadcrumb_trail_items', $this->items, $this->args );
|
287 |
}
|
288 |
|
289 |
/**
|
290 |
* Gets front items based on $wp_rewrite->front.
|
291 |
*
|
292 |
-
* @since 0.
|
293 |
-
* @access
|
294 |
* @return void
|
295 |
*/
|
296 |
-
|
297 |
global $wp_rewrite;
|
298 |
|
299 |
if ( $wp_rewrite->front )
|
300 |
-
$this->
|
301 |
}
|
302 |
|
303 |
/**
|
304 |
* Adds the page/paged number to the items array.
|
305 |
*
|
306 |
-
* @since 0.
|
307 |
-
* @access
|
308 |
* @return void
|
309 |
*/
|
310 |
-
|
311 |
|
312 |
-
|
313 |
if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] )
|
314 |
-
$this->items[] = sprintf( $this->
|
315 |
|
316 |
-
|
317 |
elseif ( is_paged() && true === $this->args['show_title'] )
|
318 |
-
$this->items[] = sprintf( $this->
|
319 |
-
|
320 |
}
|
321 |
|
322 |
/**
|
323 |
* Adds the network (all sites) home page link to the items array.
|
324 |
*
|
325 |
-
* @since 0.
|
326 |
-
* @access
|
327 |
* @return void
|
328 |
*/
|
329 |
-
|
|
|
330 |
if ( is_multisite() && !is_main_site() && true === $this->args['network'] )
|
331 |
-
$this->items[] = '<a href="
|
332 |
}
|
333 |
|
334 |
/**
|
335 |
* Adds the current site's home page link to the items array.
|
336 |
*
|
337 |
-
* @since 0.
|
338 |
-
* @access
|
339 |
* @return void
|
340 |
*/
|
341 |
-
|
342 |
-
|
343 |
-
$
|
344 |
-
$
|
|
|
|
|
|
|
345 |
}
|
346 |
|
347 |
/**
|
348 |
* Adds items for the front page to the items array.
|
349 |
*
|
350 |
-
* @since 0.
|
351 |
-
* @access
|
352 |
* @return void
|
353 |
*/
|
354 |
-
|
355 |
|
356 |
-
|
357 |
if ( true === $this->args['show_on_front'] || is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) {
|
358 |
|
359 |
-
|
360 |
-
|
361 |
-
$this->do_network_home_link();
|
362 |
-
$this->do_site_home_link();
|
363 |
-
}
|
364 |
|
365 |
-
|
366 |
-
|
367 |
-
$this->
|
368 |
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
}
|
373 |
}
|
374 |
|
375 |
/**
|
376 |
* Adds items for the posts page (i.e., is_home()) to the items array.
|
377 |
*
|
378 |
-
* @since 0.
|
379 |
-
* @access
|
380 |
* @return void
|
381 |
*/
|
382 |
-
|
383 |
|
384 |
-
|
385 |
$post_id = get_queried_object_id();
|
386 |
-
$post =
|
387 |
|
388 |
-
|
389 |
if ( 0 < $post->post_parent )
|
390 |
-
$this->
|
391 |
|
392 |
-
|
393 |
$title = get_the_title( $post_id );
|
394 |
|
395 |
-
|
396 |
if ( is_paged() )
|
397 |
-
$this->items[]
|
398 |
|
399 |
elseif ( $title && true === $this->args['show_title'] )
|
400 |
$this->items[] = $title;
|
@@ -403,223 +489,106 @@ class Breadcrumb_Trail {
|
|
403 |
/**
|
404 |
* Adds singular post items to the items array.
|
405 |
*
|
406 |
-
* @since 0.
|
407 |
-
* @access
|
408 |
* @return void
|
409 |
*/
|
410 |
-
|
411 |
|
412 |
-
|
413 |
$post = get_queried_object();
|
414 |
$post_id = get_queried_object_id();
|
415 |
|
416 |
-
|
417 |
if ( 0 < $post->post_parent )
|
418 |
-
$this->
|
419 |
|
420 |
-
|
421 |
else
|
422 |
-
$this->
|
423 |
|
424 |
-
|
425 |
-
$this->
|
|
|
426 |
|
427 |
-
|
428 |
if ( $post_title = single_post_title( '', false ) ) {
|
429 |
|
430 |
-
if ( 1 < get_query_var( 'page' ) )
|
431 |
-
$this->items[] = '<a href="'
|
432 |
|
433 |
elseif ( true === $this->args['show_title'] )
|
434 |
$this->items[] = $post_title;
|
435 |
}
|
436 |
}
|
437 |
|
438 |
-
/**
|
439 |
-
* Adds a specific post's parents to the items array.
|
440 |
-
*
|
441 |
-
* @since 0.6.0
|
442 |
-
* @access public
|
443 |
-
* @param int $post_id The ID of the post to get the parents of.
|
444 |
-
* @return void
|
445 |
-
*/
|
446 |
-
public function do_post_parents( $post_id ) {
|
447 |
-
$parents = array();
|
448 |
-
|
449 |
-
while ( $post_id ) {
|
450 |
-
|
451 |
-
/* Get the post by ID. */
|
452 |
-
$post = get_post( $post_id );
|
453 |
-
|
454 |
-
/* Add the formatted post link to the array of parents. */
|
455 |
-
$parents[] = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . get_the_title( $post_id ) . '</a>';
|
456 |
-
|
457 |
-
/* If there's no longer a post parent, brea out of the loop. */
|
458 |
-
if ( 0 >= $post->post_parent )
|
459 |
-
break;
|
460 |
-
|
461 |
-
/* Change the post ID to the parent post to continue looping. */
|
462 |
-
$post_id = $post->post_parent;
|
463 |
-
}
|
464 |
-
|
465 |
-
/* Get the post hierarchy based off the final parent post. */
|
466 |
-
$this->do_post_hierarchy( $post_id );
|
467 |
-
|
468 |
-
/* Merge the parent items into the items array. */
|
469 |
-
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
470 |
-
}
|
471 |
-
|
472 |
-
/**
|
473 |
-
* Adds a post's terms from a specific taxonomy to the items array.
|
474 |
-
*
|
475 |
-
* @since 0.6.0
|
476 |
-
* @access public
|
477 |
-
* @param int $post_id The ID of the post to get the terms for.
|
478 |
-
* @return void
|
479 |
-
*/
|
480 |
-
public function do_post_terms( $post_id ) {
|
481 |
-
|
482 |
-
/* Get the post type. */
|
483 |
-
$post_type = get_post_type( $post_id );
|
484 |
-
|
485 |
-
/* Add the terms of the taxonomy for this post. */
|
486 |
-
if ( !empty( $this->args['post_taxonomy'][ $post_type ] ) )
|
487 |
-
$this->items[] = get_the_term_list( $post_id, $this->args['post_taxonomy'][ $post_type ], '', ', ', '' );
|
488 |
-
}
|
489 |
-
|
490 |
-
/**
|
491 |
-
* Adds a specific post's hierarchy to the items array. The hierarchy is determined by post type's
|
492 |
-
* rewrite arguments and whether it has an archive page.
|
493 |
-
*
|
494 |
-
* @since 0.6.0
|
495 |
-
* @access public
|
496 |
-
* @param int $post_id The ID of the post to get the hierarchy for.
|
497 |
-
* @return void
|
498 |
-
*/
|
499 |
-
public function do_post_hierarchy( $post_id ) {
|
500 |
-
|
501 |
-
/* Get the post type. */
|
502 |
-
$post_type = get_post_type( $post_id );
|
503 |
-
$post_type_object = get_post_type_object( $post_type );
|
504 |
-
|
505 |
-
/* If this is the 'post' post type, get the rewrite front items and map the rewrite tags. */
|
506 |
-
if ( 'post' === $post_type ) {
|
507 |
-
|
508 |
-
/* Add $wp_rewrite->front to the trail. */
|
509 |
-
$this->do_rewrite_front_items();
|
510 |
-
|
511 |
-
/* Map the rewrite tags. */
|
512 |
-
$this->map_rewrite_tags( $post_id, get_option( 'permalink_structure' ) );
|
513 |
-
}
|
514 |
-
|
515 |
-
/* If the post type has rewrite rules. */
|
516 |
-
elseif ( false !== $post_type_object->rewrite ) {
|
517 |
-
|
518 |
-
/* If 'with_front' is true, add $wp_rewrite->front to the trail. */
|
519 |
-
if ( $post_type_object->rewrite['with_front'] )
|
520 |
-
$this->do_rewrite_front_items();
|
521 |
-
|
522 |
-
/* If there's a path, check for parents. */
|
523 |
-
if ( !empty( $post_type_object->rewrite['slug'] ) )
|
524 |
-
$this->do_path_parents( $post_type_object->rewrite['slug'] );
|
525 |
-
}
|
526 |
-
|
527 |
-
/* If there's an archive page, add it to the trail. */
|
528 |
-
if ( !empty( $post_type_object->has_archive ) ) {
|
529 |
-
|
530 |
-
/* Add support for a non-standard label of 'archive_title' (special use case). */
|
531 |
-
$label = !empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
532 |
-
|
533 |
-
$this->items[] = '<a href="' . get_post_type_archive_link( $post_type ) . '">' . $label . '</a>';
|
534 |
-
}
|
535 |
-
}
|
536 |
-
|
537 |
-
/**
|
538 |
-
* Gets post types by slug. This is needed because the get_post_types() function doesn't exactly
|
539 |
-
* match the 'has_archive' argument when it's set as a string instead of a boolean.
|
540 |
-
*
|
541 |
-
* @since 0.6.0
|
542 |
-
* @access public
|
543 |
-
* @param int $slug The post type archive slug to search for.
|
544 |
-
* @return void
|
545 |
-
*/
|
546 |
-
public function get_post_types_by_slug( $slug ) {
|
547 |
-
|
548 |
-
$return = array();
|
549 |
-
|
550 |
-
$post_types = get_post_types( array(), 'objects' );
|
551 |
-
|
552 |
-
foreach ( $post_types as $type ) {
|
553 |
-
|
554 |
-
if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) )
|
555 |
-
$return[] = $type;
|
556 |
-
}
|
557 |
-
|
558 |
-
return $return;
|
559 |
-
}
|
560 |
-
|
561 |
/**
|
562 |
* Adds the items to the trail items array for taxonomy term archives.
|
563 |
*
|
564 |
-
* @since 0.
|
565 |
-
* @access
|
566 |
* @global object $wp_rewrite
|
567 |
* @return void
|
568 |
*/
|
569 |
-
|
570 |
global $wp_rewrite;
|
571 |
|
572 |
-
|
573 |
-
$term
|
574 |
-
$taxonomy
|
|
|
575 |
|
576 |
-
|
577 |
if ( false !== $taxonomy->rewrite ) {
|
578 |
|
579 |
-
|
580 |
if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front )
|
581 |
-
$this->
|
582 |
|
583 |
-
|
584 |
-
$this->
|
585 |
|
586 |
-
|
587 |
if ( $taxonomy->rewrite['slug'] ) {
|
588 |
|
589 |
$slug = trim( $taxonomy->rewrite['slug'], '/' );
|
590 |
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
*/
|
595 |
$matches = explode( '/', $slug );
|
596 |
|
597 |
-
|
598 |
if ( isset( $matches ) ) {
|
599 |
|
600 |
-
|
601 |
$matches = array_reverse( $matches );
|
602 |
|
603 |
-
|
604 |
foreach ( $matches as $match ) {
|
605 |
|
606 |
-
|
607 |
$slug = $match;
|
608 |
|
609 |
-
|
610 |
$post_types = $this->get_post_types_by_slug( $match );
|
611 |
|
612 |
if ( !empty( $post_types ) ) {
|
613 |
|
614 |
$post_type_object = $post_types[0];
|
615 |
|
616 |
-
|
617 |
$label = !empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name;
|
618 |
|
619 |
-
|
620 |
-
$
|
|
|
|
|
|
|
621 |
|
622 |
-
|
|
|
|
|
623 |
break;
|
624 |
}
|
625 |
}
|
@@ -627,13 +596,36 @@ class Breadcrumb_Trail {
|
|
627 |
}
|
628 |
}
|
629 |
|
630 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
631 |
if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent )
|
632 |
-
$this->
|
633 |
|
634 |
-
|
635 |
if ( is_paged() )
|
636 |
-
$this->items[] = '<a href="'
|
637 |
|
638 |
elseif ( true === $this->args['show_title'] )
|
639 |
$this->items[] = single_term_title( '', false );
|
@@ -642,29 +634,29 @@ class Breadcrumb_Trail {
|
|
642 |
/**
|
643 |
* Adds the items to the trail items array for post type archives.
|
644 |
*
|
645 |
-
* @since 0.
|
646 |
-
* @access
|
647 |
* @return void
|
648 |
*/
|
649 |
-
|
650 |
|
651 |
-
|
652 |
$post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
|
653 |
|
654 |
if ( false !== $post_type_object->rewrite ) {
|
655 |
|
656 |
-
|
657 |
if ( $post_type_object->rewrite['with_front'] )
|
658 |
-
$this->
|
659 |
|
660 |
-
|
661 |
if ( !empty( $post_type_object->rewrite['slug'] ) )
|
662 |
-
$this->
|
663 |
}
|
664 |
|
665 |
-
|
666 |
if ( is_paged() )
|
667 |
-
$this->items[] = '<a href="'
|
668 |
|
669 |
elseif ( true === $this->args['show_title'] )
|
670 |
$this->items[] = post_type_archive_title( '', false );
|
@@ -673,27 +665,27 @@ class Breadcrumb_Trail {
|
|
673 |
/**
|
674 |
* Adds the items to the trail items array for user (author) archives.
|
675 |
*
|
676 |
-
* @since 0.
|
677 |
-
* @access
|
678 |
* @global object $wp_rewrite
|
679 |
* @return void
|
680 |
*/
|
681 |
-
|
682 |
global $wp_rewrite;
|
683 |
|
684 |
-
|
685 |
-
$this->
|
686 |
|
687 |
-
|
688 |
$user_id = get_query_var( 'author' );
|
689 |
|
690 |
-
|
691 |
if ( !empty( $wp_rewrite->author_base ) )
|
692 |
-
$this->
|
693 |
|
694 |
-
|
695 |
if ( is_paged() )
|
696 |
-
$this->items[] = '<a href="'
|
697 |
|
698 |
elseif ( true === $this->args['show_title'] )
|
699 |
$this->items[] = get_the_author_meta( 'display_name', $user_id );
|
@@ -702,78 +694,78 @@ class Breadcrumb_Trail {
|
|
702 |
/**
|
703 |
* Adds the items to the trail items array for minute + hour archives.
|
704 |
*
|
705 |
-
* @since 0.
|
706 |
-
* @access
|
707 |
* @return void
|
708 |
*/
|
709 |
-
|
710 |
|
711 |
-
|
712 |
-
$this->
|
713 |
|
714 |
-
|
715 |
if ( true === $this->args['show_title'] )
|
716 |
-
$this->items[] = sprintf( $this->
|
717 |
}
|
718 |
|
719 |
/**
|
720 |
* Adds the items to the trail items array for minute archives.
|
721 |
*
|
722 |
-
* @since 0.
|
723 |
-
* @access
|
724 |
* @return void
|
725 |
*/
|
726 |
-
|
727 |
|
728 |
-
|
729 |
-
$this->
|
730 |
|
731 |
-
|
732 |
if ( true === $this->args['show_title'] )
|
733 |
-
$this->items[] = sprintf( $this->
|
734 |
}
|
735 |
|
736 |
/**
|
737 |
* Adds the items to the trail items array for hour archives.
|
738 |
*
|
739 |
-
* @since 0.
|
740 |
-
* @access
|
741 |
* @return void
|
742 |
*/
|
743 |
-
|
744 |
|
745 |
-
|
746 |
-
$this->
|
747 |
|
748 |
-
|
749 |
if ( true === $this->args['show_title'] )
|
750 |
-
$this->items[] = sprintf( $this->
|
751 |
}
|
752 |
|
753 |
/**
|
754 |
* Adds the items to the trail items array for day archives.
|
755 |
*
|
756 |
-
* @since 0.
|
757 |
-
* @access
|
758 |
* @return void
|
759 |
*/
|
760 |
-
|
761 |
|
762 |
-
|
763 |
-
$this->
|
764 |
|
765 |
-
|
766 |
-
$year = sprintf( $this->
|
767 |
-
$month = sprintf( $this->
|
768 |
-
$day = sprintf( $this->
|
769 |
|
770 |
-
|
771 |
-
$this->items[] = '<a href="'
|
772 |
-
$this->items[] = '<a href="'
|
773 |
|
774 |
-
|
775 |
if ( is_paged() )
|
776 |
-
$this->items[] = '<a href="'
|
777 |
|
778 |
elseif ( true === $this->args['show_title'] )
|
779 |
$this->items[] = $day;
|
@@ -782,25 +774,25 @@ class Breadcrumb_Trail {
|
|
782 |
/**
|
783 |
* Adds the items to the trail items array for week archives.
|
784 |
*
|
785 |
-
* @since 0.
|
786 |
-
* @access
|
787 |
* @return void
|
788 |
*/
|
789 |
-
|
790 |
|
791 |
-
|
792 |
-
$this->
|
793 |
|
794 |
-
|
795 |
-
$year = sprintf( $this->
|
796 |
-
$week = sprintf( $this->
|
797 |
|
798 |
-
|
799 |
-
$this->items[] = '<a href="'
|
800 |
|
801 |
-
|
802 |
if ( is_paged() )
|
803 |
-
$this->items[] = get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url() ), $week, false );
|
804 |
|
805 |
elseif ( true === $this->args['show_title'] )
|
806 |
$this->items[] = $week;
|
@@ -809,25 +801,25 @@ class Breadcrumb_Trail {
|
|
809 |
/**
|
810 |
* Adds the items to the trail items array for month archives.
|
811 |
*
|
812 |
-
* @since 0.
|
813 |
-
* @access
|
814 |
* @return void
|
815 |
*/
|
816 |
-
|
817 |
|
818 |
-
|
819 |
-
$this->
|
820 |
|
821 |
-
|
822 |
-
$year = sprintf( $this->
|
823 |
-
$month = sprintf( $this->
|
824 |
|
825 |
-
|
826 |
-
$this->items[] = '<a href="'
|
827 |
|
828 |
-
|
829 |
if ( is_paged() )
|
830 |
-
$this->items[] = '<a href="'
|
831 |
|
832 |
elseif ( true === $this->args['show_title'] )
|
833 |
$this->items[] = $month;
|
@@ -836,21 +828,21 @@ class Breadcrumb_Trail {
|
|
836 |
/**
|
837 |
* Adds the items to the trail items array for year archives.
|
838 |
*
|
839 |
-
* @since 0.
|
840 |
-
* @access
|
841 |
* @return void
|
842 |
*/
|
843 |
-
|
844 |
|
845 |
-
|
846 |
-
$this->
|
847 |
|
848 |
-
|
849 |
-
$year = sprintf( $this->
|
850 |
|
851 |
-
|
852 |
if ( is_paged() )
|
853 |
-
$this->items[] = '<a href="'
|
854 |
|
855 |
elseif ( true === $this->args['show_title'] )
|
856 |
$this->items[] = $year;
|
@@ -860,100 +852,249 @@ class Breadcrumb_Trail {
|
|
860 |
* Adds the items to the trail items array for archives that don't have a more specific method
|
861 |
* defined in this class.
|
862 |
*
|
863 |
-
* @since 0.
|
864 |
-
* @access
|
865 |
* @return void
|
866 |
*/
|
867 |
-
|
868 |
|
869 |
-
|
870 |
if ( is_date() || is_time() )
|
871 |
-
$this->
|
872 |
|
873 |
if ( true === $this->args['show_title'] )
|
874 |
-
$this->items[] = $this->
|
875 |
}
|
876 |
|
877 |
/**
|
878 |
* Adds the items to the trail items array for search results.
|
879 |
*
|
880 |
-
* @since 0.
|
881 |
-
* @access
|
882 |
* @return void
|
883 |
*/
|
884 |
-
|
885 |
|
886 |
if ( is_paged() )
|
887 |
-
$this->items[] = '<a href="
|
888 |
|
889 |
elseif ( true === $this->args['show_title'] )
|
890 |
-
$this->items[] = sprintf( $this->
|
891 |
}
|
892 |
|
893 |
/**
|
894 |
* Adds the items to the trail items array for 404 pages.
|
895 |
*
|
896 |
-
* @since 0.
|
897 |
-
* @access
|
898 |
* @return void
|
899 |
*/
|
900 |
-
|
901 |
|
902 |
if ( true === $this->args['show_title'] )
|
903 |
-
$this->items[] = $this->
|
904 |
}
|
905 |
|
906 |
/**
|
907 |
-
*
|
908 |
-
*
|
909 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
910 |
*
|
911 |
* @since 0.6.0
|
912 |
-
* @access
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
913 |
* @param string $path The path (slug) to search for posts by.
|
914 |
* @return void
|
915 |
*/
|
916 |
-
function
|
917 |
|
918 |
-
|
919 |
$path = trim( $path, '/' );
|
920 |
|
921 |
-
|
922 |
if ( empty( $path ) )
|
923 |
return;
|
924 |
|
925 |
-
|
926 |
$post = get_page_by_path( $path );
|
927 |
|
928 |
if ( !empty( $post ) ) {
|
929 |
-
$this->
|
930 |
}
|
931 |
|
932 |
elseif ( is_null( $post ) ) {
|
933 |
|
934 |
-
|
935 |
$path = trim( $path, '/' );
|
936 |
preg_match_all( "/\/.*?\z/", $path, $matches );
|
937 |
|
938 |
-
|
939 |
if ( isset( $matches ) ) {
|
940 |
|
941 |
-
|
942 |
$matches = array_reverse( $matches );
|
943 |
|
944 |
-
|
945 |
foreach ( $matches as $match ) {
|
946 |
|
947 |
-
|
948 |
if ( isset( $match[0] ) ) {
|
949 |
|
950 |
-
|
951 |
$path = str_replace( $match[0], '', $path );
|
952 |
$post = get_page_by_path( trim( $path, '/' ) );
|
953 |
|
954 |
-
|
955 |
if ( !empty( $post ) && 0 < $post->ID ) {
|
956 |
-
$this->
|
957 |
break;
|
958 |
}
|
959 |
}
|
@@ -963,268 +1104,99 @@ class Breadcrumb_Trail {
|
|
963 |
}
|
964 |
|
965 |
/**
|
966 |
-
* Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress
|
967 |
* function get_category_parents() but handles any type of taxonomy.
|
968 |
*
|
969 |
-
* @since 0.
|
970 |
* @param int $term_id ID of the term to get the parents of.
|
971 |
* @param string $taxonomy Name of the taxonomy for the given term.
|
972 |
* @return void
|
973 |
*/
|
974 |
-
function
|
975 |
|
976 |
-
|
977 |
$parents = array();
|
978 |
|
979 |
-
|
980 |
while ( $term_id ) {
|
981 |
|
982 |
-
|
983 |
$term = get_term( $term_id, $taxonomy );
|
984 |
|
985 |
-
|
986 |
-
$parents[] = '<a href="'
|
987 |
|
988 |
-
|
989 |
$term_id = $term->parent;
|
990 |
}
|
991 |
|
992 |
-
|
993 |
if ( !empty( $parents ) )
|
994 |
$this->items = array_merge( $this->items, $parents );
|
995 |
}
|
996 |
|
997 |
/**
|
998 |
* Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of
|
999 |
-
* hackish for now because we're checking for specific %tag% examples and only doing it for the 'post'
|
1000 |
* post type. In the future, maybe it'll handle a wider variety of possibilities, especially for custom post
|
1001 |
* types.
|
1002 |
*
|
1003 |
* @since 0.6.0
|
1004 |
-
* @access
|
1005 |
* @param int $post_id ID of the post whose parents we want.
|
1006 |
* @param string $path Path of a potential parent page.
|
1007 |
* @param array $args Mixed arguments for the menu.
|
1008 |
* @return array
|
1009 |
*/
|
1010 |
-
|
1011 |
|
1012 |
-
/* Get the post based on the post ID. */
|
1013 |
$post = get_post( $post_id );
|
1014 |
|
1015 |
-
|
1016 |
-
if (
|
1017 |
-
return
|
1018 |
|
1019 |
-
|
1020 |
$path = trim( $path, '/' );
|
1021 |
|
1022 |
-
|
1023 |
$matches = explode( '/', $path );
|
1024 |
|
1025 |
-
|
1026 |
if ( is_array( $matches ) ) {
|
1027 |
|
1028 |
-
|
1029 |
foreach ( $matches as $match ) {
|
1030 |
|
1031 |
-
|
1032 |
$tag = trim( $match, '/' );
|
1033 |
|
1034 |
-
|
1035 |
if ( '%year%' == $tag )
|
1036 |
-
$this->items[] = '<a href="'
|
1037 |
|
1038 |
-
|
1039 |
elseif ( '%monthnum%' == $tag )
|
1040 |
-
$this->items[] = '<a href="'
|
1041 |
|
1042 |
-
|
1043 |
elseif ( '%day%' == $tag )
|
1044 |
-
$this->items[] = '<a href="'
|
1045 |
|
1046 |
-
|
1047 |
elseif ( '%author%' == $tag )
|
1048 |
-
$this->items[] = '<a href="
|
1049 |
|
1050 |
-
|
1051 |
elseif ( '%category%' == $tag ) {
|
1052 |
|
1053 |
-
|
1054 |
-
$this->
|
1055 |
-
|
1056 |
-
/* Get the post categories. */
|
1057 |
-
$terms = get_the_category( $post_id );
|
1058 |
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
/* Sort the terms by ID and get the first category. */
|
1063 |
-
usort( $terms, '_usort_terms_by_ID' );
|
1064 |
-
$term = get_term( $terms[0], 'category' );
|
1065 |
-
|
1066 |
-
/* If the category has a parent, add the hierarchy to the trail. */
|
1067 |
-
if ( 0 < $term->parent )
|
1068 |
-
$this->do_term_parents( $term->parent, 'category' );
|
1069 |
-
|
1070 |
-
/* Add the category archive link to the trail. */
|
1071 |
-
$this->items[] = '<a href="' . get_term_link( $term, 'category' ) . '" title="' . esc_attr( $term->name ) . '">' . $term->name . '</a>';
|
1072 |
-
}
|
1073 |
}
|
1074 |
}
|
1075 |
}
|
1076 |
}
|
1077 |
}
|
1078 |
-
|
1079 |
-
/**
|
1080 |
-
* Extends the Breadcrumb_Trail class for bbPress. Only use this if bbPress is in use. This should
|
1081 |
-
* serve as an example for other plugin developers to build custom breadcrumb items.
|
1082 |
-
*
|
1083 |
-
* @since 0.6.0
|
1084 |
-
* @access public
|
1085 |
-
*/
|
1086 |
-
class bbPress_Breadcrumb_Trail extends Breadcrumb_Trail {
|
1087 |
-
|
1088 |
-
/**
|
1089 |
-
* Runs through the various bbPress conditional tags to check the current page being viewed. Once
|
1090 |
-
* a condition is met, add items to the $items array.
|
1091 |
-
*
|
1092 |
-
* @since 0.6.0
|
1093 |
-
* @access public
|
1094 |
-
* @return void
|
1095 |
-
*/
|
1096 |
-
public function do_trail_items() {
|
1097 |
-
|
1098 |
-
/* Add the network and site home links. */
|
1099 |
-
$this->do_network_home_link();
|
1100 |
-
$this->do_site_home_link();
|
1101 |
-
|
1102 |
-
/* Get the forum post type object. */
|
1103 |
-
$post_type_object = get_post_type_object( bbp_get_forum_post_type() );
|
1104 |
-
|
1105 |
-
/* If not viewing the forum root/archive page and a forum archive exists, add it. */
|
1106 |
-
if ( !empty( $post_type_object->has_archive ) && !bbp_is_forum_archive() )
|
1107 |
-
$this->items[] = '<a href="' . get_post_type_archive_link( bbp_get_forum_post_type() ) . '">' . bbp_get_forum_archive_title() . '</a>';
|
1108 |
-
|
1109 |
-
/* If viewing the forum root/archive. */
|
1110 |
-
if ( bbp_is_forum_archive() ) {
|
1111 |
-
|
1112 |
-
if ( true === $this->args['show_title'] )
|
1113 |
-
$this->items[] = bbp_get_forum_archive_title();
|
1114 |
-
}
|
1115 |
-
|
1116 |
-
/* If viewing the topics archive. */
|
1117 |
-
elseif ( bbp_is_topic_archive() ) {
|
1118 |
-
|
1119 |
-
if ( true === $this->args['show_title'] )
|
1120 |
-
$this->items[] = bbp_get_topic_archive_title();
|
1121 |
-
}
|
1122 |
-
|
1123 |
-
/* If viewing a topic tag archive. */
|
1124 |
-
elseif ( bbp_is_topic_tag() ) {
|
1125 |
-
|
1126 |
-
if ( true === $this->args['show_title'] )
|
1127 |
-
$this->items[] = bbp_get_topic_tag_name();
|
1128 |
-
}
|
1129 |
-
|
1130 |
-
/* If viewing a topic tag edit page. */
|
1131 |
-
elseif ( bbp_is_topic_tag_edit() ) {
|
1132 |
-
$this->items[] = '<a href="' . bbp_get_topic_tag_link() . '">' . bbp_get_topic_tag_name() . '</a>';
|
1133 |
-
|
1134 |
-
if ( true === $this->args['show_title'] )
|
1135 |
-
$this->items[] = __( 'Edit', 'breadcrumb-trail' );
|
1136 |
-
}
|
1137 |
-
|
1138 |
-
/* If viewing a "view" page. */
|
1139 |
-
elseif ( bbp_is_single_view() ) {
|
1140 |
-
|
1141 |
-
if ( true === $this->args['show_title'] )
|
1142 |
-
$this->items[] = bbp_get_view_title();
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
/* If viewing a single topic page. */
|
1146 |
-
elseif ( bbp_is_single_topic() ) {
|
1147 |
-
|
1148 |
-
/* Get the queried topic. */
|
1149 |
-
$topic_id = get_queried_object_id();
|
1150 |
-
|
1151 |
-
/* Get the parent items for the topic, which would be its forum (and possibly forum grandparents). */
|
1152 |
-
$this->do_post_parents( bbp_get_topic_forum_id( $topic_id ) );
|
1153 |
-
|
1154 |
-
/* If viewing a split, merge, or edit topic page, show the link back to the topic. Else, display topic title. */
|
1155 |
-
if ( bbp_is_topic_split() || bbp_is_topic_merge() || bbp_is_topic_edit() )
|
1156 |
-
$this->items[] = '<a href="' . bbp_get_topic_permalink( $topic_id ) . '">' . bbp_get_topic_title( $topic_id ) . '</a>';
|
1157 |
-
|
1158 |
-
elseif ( true === $this->args['show_title'] )
|
1159 |
-
$this->items[] = bbp_get_topic_title( $topic_id );
|
1160 |
-
|
1161 |
-
/* If viewing a topic split page. */
|
1162 |
-
if ( bbp_is_topic_split() && true === $this->args['show_title'] )
|
1163 |
-
$this->items[] = __( 'Split', 'breadcrumb-trail' );
|
1164 |
-
|
1165 |
-
/* If viewing a topic merge page. */
|
1166 |
-
elseif ( bbp_is_topic_merge() && true === $this->args['show_title'] )
|
1167 |
-
$this->items[] = __( 'Merge', 'breadcrumb-trail' );
|
1168 |
-
|
1169 |
-
/* If viewing a topic edit page. */
|
1170 |
-
elseif ( bbp_is_topic_edit() && true === $this->args['show_title'] )
|
1171 |
-
$this->items[] = __( 'Edit', 'breadcrumb-trail' );
|
1172 |
-
}
|
1173 |
-
|
1174 |
-
/* If viewing a single reply page. */
|
1175 |
-
elseif ( bbp_is_single_reply() ) {
|
1176 |
-
|
1177 |
-
/* Get the queried reply object ID. */
|
1178 |
-
$reply_id = get_queried_object_id();
|
1179 |
-
|
1180 |
-
/* Get the parent items for the reply, which should be its topic. */
|
1181 |
-
$this->do_post_parents( bbp_get_reply_topic_id( $reply_id ) );
|
1182 |
-
|
1183 |
-
/* If viewing a reply edit page, link back to the reply. Else, display the reply title. */
|
1184 |
-
if ( bbp_is_reply_edit() ) {
|
1185 |
-
$this->items[] = '<a href="' . bbp_get_reply_url( $reply_id ) . '">' . bbp_get_reply_title( $reply_id ) . '</a>';
|
1186 |
-
|
1187 |
-
if ( true === $this->args['show_title'] )
|
1188 |
-
$this->items[] = __( 'Edit', 'breadcrumb-trail' );
|
1189 |
-
|
1190 |
-
} elseif ( true === $this->args['show_title'] ) {
|
1191 |
-
$this->items[] = bbp_get_reply_title( $reply_id );
|
1192 |
-
}
|
1193 |
-
|
1194 |
-
}
|
1195 |
-
|
1196 |
-
/* If viewing a single forum. */
|
1197 |
-
elseif ( bbp_is_single_forum() ) {
|
1198 |
-
|
1199 |
-
/* Get the queried forum ID and its parent forum ID. */
|
1200 |
-
$forum_id = get_queried_object_id();
|
1201 |
-
$forum_parent_id = bbp_get_forum_parent_id( $forum_id );
|
1202 |
-
|
1203 |
-
/* If the forum has a parent forum, get its parent(s). */
|
1204 |
-
if ( 0 !== $forum_parent_id)
|
1205 |
-
$this->do_post_parents( $forum_parent_id );
|
1206 |
-
|
1207 |
-
/* Add the forum title to the end of the trail. */
|
1208 |
-
if ( true === $this->args['show_title'] )
|
1209 |
-
$this->items[] = bbp_get_forum_title( $forum_id );
|
1210 |
-
}
|
1211 |
-
|
1212 |
-
/* If viewing a user page or user edit page. */
|
1213 |
-
elseif ( bbp_is_single_user() || bbp_is_single_user_edit() ) {
|
1214 |
-
|
1215 |
-
if ( bbp_is_single_user_edit() ) {
|
1216 |
-
$this->items[] = '<a href="' . bbp_get_user_profile_url() . '">' . bbp_get_displayed_user_field( 'display_name' ) . '</a>';
|
1217 |
-
|
1218 |
-
if ( true === $this->args['show_title'] )
|
1219 |
-
$this->items[] = __( 'Edit', 'breadcrumb-trail' );
|
1220 |
-
} elseif ( true === $this->args['show_title'] ) {
|
1221 |
-
$this->items[] = bbp_get_displayed_user_field( 'display_name' );
|
1222 |
-
}
|
1223 |
-
}
|
1224 |
-
|
1225 |
-
/* Return the bbPress breadcrumb trail items. */
|
1226 |
-
$this->items = apply_filters( 'breadcrumb_trail_get_bbpress_items', $this->items, $this->args );
|
1227 |
-
}
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
?>
|
2 |
/**
|
3 |
* Breadcrumb Trail - A breadcrumb menu script for WordPress.
|
4 |
*
|
5 |
+
* Breadcrumb Trail is a script for showing a breadcrumb trail for any type of page. It tries to
|
6 |
+
* anticipate any type of structure and display the best possible trail that matches your site's
|
7 |
+
* permalink structure. While not perfect, it attempts to fill in the gaps left by many other
|
8 |
* breadcrumb scripts.
|
9 |
*
|
10 |
+
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
|
11 |
+
* General Public License as published by the Free Software Foundation; either version 2 of the License,
|
12 |
* or (at your option) any later version.
|
13 |
*
|
14 |
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
15 |
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
*
|
17 |
* @package BreadcrumbTrail
|
18 |
+
* @version 1.0.0
|
19 |
* @author Justin Tadlock <justin@justintadlock.com>
|
20 |
+
* @copyright Copyright (c) 2008 - 2015, Justin Tadlock
|
21 |
* @link http://themehybrid.com/plugins/breadcrumb-trail
|
22 |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
23 |
*/
|
24 |
|
25 |
/**
|
26 |
+
* Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class,
|
27 |
* which should be used in theme templates.
|
28 |
*
|
29 |
* @since 0.1.0
|
33 |
*/
|
34 |
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();
|
44 |
/**
|
45 |
* Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user.
|
46 |
*
|
47 |
+
* @since 0.6.0
|
48 |
+
* @access public
|
49 |
*/
|
50 |
class Breadcrumb_Trail {
|
51 |
|
68 |
public $args = array();
|
69 |
|
70 |
/**
|
71 |
+
* Array of text labels.
|
72 |
+
*
|
73 |
+
* @since 1.0.0
|
74 |
+
* @access public
|
75 |
+
* @var array
|
76 |
+
*/
|
77 |
+
public $labels = array();
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Array of post types (key) and taxonomies (value) to use for single post views.
|
81 |
+
*
|
82 |
+
* @since 1.0.0
|
83 |
+
* @access public
|
84 |
+
* @var array
|
85 |
+
*/
|
86 |
+
public $post_taxonomy = array();
|
87 |
+
|
88 |
+
/* ====== Magic Methods ====== */
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Magic method to use in case someone tries to output the layout object as a string.
|
92 |
+
* We'll just return the trail HTML.
|
93 |
+
*
|
94 |
+
* @since 1.0.0
|
95 |
+
* @access public
|
96 |
+
* @return string
|
97 |
+
*/
|
98 |
+
public function __toString() {
|
99 |
+
return $this->trail();
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Sets up the breadcrumb trail properties. Calls the `Breadcrumb_Trail::add_items()` method
|
104 |
+
* to creat the array of breadcrumb items.
|
105 |
*
|
106 |
* @since 0.6.0
|
107 |
* @access public
|
108 |
+
* @param array $args {
|
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.
|
115 |
+
* @type bool $show_browse Whether to show the breadcrumb menu header.
|
116 |
+
* @type array $labels Text labels. @see Breadcrumb_Trail::set_labels()
|
117 |
+
* @type array $post_taxonomy Taxonomies to use for post types. @see Breadcrumb_Trail::set_post_taxonomy()
|
118 |
+
* @type bool $echo Whether to print or return the breadcrumbs.
|
119 |
+
* }
|
120 |
* @return void
|
121 |
*/
|
122 |
public function __construct( $args = array() ) {
|
123 |
|
|
|
|
|
|
|
124 |
$defaults = array(
|
125 |
+
'container' => 'nav',
|
|
|
126 |
'before' => '',
|
127 |
'after' => '',
|
128 |
'show_on_front' => true,
|
129 |
'network' => false,
|
|
|
130 |
'show_title' => true,
|
131 |
'show_browse' => true,
|
132 |
+
'labels' => array(),
|
133 |
+
'post_taxonomy' => array(),
|
134 |
+
'echo' => true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
);
|
136 |
|
137 |
+
// Parse the arguments with the deaults.
|
138 |
$this->args = apply_filters( 'breadcrumb_trail_args', wp_parse_args( $args, $defaults ) );
|
139 |
|
140 |
+
// Set the labels and post taxonomy properties.
|
141 |
+
$this->set_labels();
|
142 |
+
$this->set_post_taxonomy();
|
143 |
|
144 |
+
// Let's find some items to add to the trail!
|
145 |
+
$this->add_items();
|
146 |
}
|
147 |
|
148 |
+
/* ====== Public Methods ====== */
|
149 |
+
|
150 |
/**
|
151 |
+
* Formats the HTML output for the breadcrumb trail.
|
152 |
*
|
153 |
* @since 0.6.0
|
154 |
* @access public
|
156 |
*/
|
157 |
public function trail() {
|
158 |
|
159 |
+
// Set up variables that we'll need.
|
160 |
+
$breadcrumb = '';
|
161 |
+
$item_count = count( $this->items );
|
162 |
+
$item_position = 0;
|
163 |
|
164 |
+
// Connect the breadcrumb trail if there are items in the trail.
|
165 |
+
if ( 0 < $item_count ) {
|
166 |
|
167 |
+
// Add 'browse' label if it should be shown.
|
168 |
+
if ( true === $this->args['show_browse'] )
|
169 |
+
$breadcrumb .= sprintf( '<h2 class="trail-browse">%s</h2>', $this->labels['browse'] );
|
170 |
|
171 |
+
// Open the unordered list.
|
172 |
+
$breadcrumb .= '<ul class="trail-items" itemscope itemtype="http://schema.org/BreadcrumbList">';
|
173 |
|
174 |
+
// Add the number of items and item list order schema.
|
175 |
+
$breadcrumb .= sprintf( '<meta name="numberOfItems" content="%d" />', absint( $item_count ) );
|
176 |
+
$breadcrumb .= '<meta name="itemListOrder" content="Ascending" />';
|
177 |
|
178 |
+
// Loop through the items and add them to the list.
|
179 |
+
foreach ( $this->items as $item ) {
|
|
|
180 |
|
181 |
+
// Iterate the item position.
|
182 |
+
++$item_position;
|
|
|
183 |
|
184 |
+
// Check if the item is linked.
|
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';
|
192 |
|
193 |
+
if ( 1 === $item_position && 1 < $item_count )
|
194 |
+
$item_class .= ' trail-begin';
|
195 |
|
196 |
+
elseif ( $item_count === $item_position )
|
197 |
+
$item_class .= ' trail-end';
|
198 |
+
|
199 |
+
// Create list item attributes.
|
200 |
+
$attributes = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="' . $item_class . '"';
|
201 |
+
|
202 |
+
// Build the meta position HTML.
|
203 |
+
$meta = sprintf( '<meta itemprop="position" content="%s" />', absint( $item_position ) );
|
204 |
+
|
205 |
+
// Build the list item.
|
206 |
+
$breadcrumb .= sprintf( '<li %s>%s%s</li>', $attributes, $item, $meta );
|
207 |
+
}
|
208 |
+
|
209 |
+
// Close the unordered list.
|
210 |
+
$breadcrumb .= '</ul>';
|
211 |
+
|
212 |
+
// Wrap the breadcrumb trail.
|
213 |
+
$breadcrumb = sprintf(
|
214 |
+
'<%1$s role="navigation" aria-label="%2$s" class="breadcrumb-trail breadcrumbs" itemprop="breadcrumb">%3$s%4$s%5$s</%1$s>',
|
215 |
+
tag_escape( $this->args['container'] ),
|
216 |
+
esc_attr( $this->labels['aria_label'] ),
|
217 |
+
$this->args['before'],
|
218 |
+
$breadcrumb,
|
219 |
+
$this->args['after']
|
220 |
+
);
|
221 |
}
|
222 |
|
223 |
+
// Allow developers to filter the breadcrumb trail HTML.
|
224 |
$breadcrumb = apply_filters( 'breadcrumb_trail', $breadcrumb, $this->args );
|
225 |
|
226 |
+
if ( false === $this->args['echo'] )
|
|
|
|
|
227 |
return $breadcrumb;
|
228 |
+
|
229 |
+
echo $breadcrumb;
|
230 |
}
|
231 |
|
232 |
+
/* ====== Protected Methods ====== */
|
233 |
+
|
234 |
/**
|
235 |
+
* Sets the labels property. Parses the inputted labels array with the defaults.
|
236 |
*
|
237 |
+
* @since 1.0.0
|
238 |
+
* @access protected
|
239 |
+
* @return void
|
240 |
*/
|
241 |
+
protected function set_labels() {
|
242 |
+
|
243 |
+
$defaults = array(
|
244 |
+
'browse' => esc_html__( 'Browse:', 'breadcrumb-trail' ),
|
245 |
+
'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', '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. The HTML entities are opening and closing curly quotes.
|
250 |
+
'search' => esc_html__( 'Search results for “%s”', 'breadcrumb-trail' ),
|
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.
|
256 |
+
'archive_week' => esc_html__( 'Week %s', 'breadcrumb-trail' ),
|
257 |
+
|
258 |
+
// "%s" is replaced with the translated date/time format.
|
259 |
'archive_minute_hour' => '%s',
|
260 |
'archive_hour' => '%s',
|
261 |
'archive_day' => '%s',
|
263 |
'archive_year' => '%s',
|
264 |
);
|
265 |
|
266 |
+
$this->labels = apply_filters( 'breadcrumb_trail_labels', wp_parse_args( $this->args['labels'], $defaults ) );
|
267 |
}
|
268 |
|
269 |
/**
|
270 |
+
* Sets the `$post_taxonomy` property. This is an array of post types (key) and taxonomies (value).
|
271 |
+
* The taxonomy's terms are shown on the singular post view if set.
|
272 |
*
|
273 |
+
* @since 1.0.0
|
274 |
+
* @access protected
|
275 |
* @return void
|
276 |
*/
|
277 |
+
protected function set_post_taxonomy() {
|
278 |
+
|
279 |
+
$defaults = array();
|
280 |
|
281 |
+
// If post permalink is set to `%postname%`, use the `category` taxonomy.
|
282 |
+
if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) )
|
283 |
+
$defaults['post'] = 'category';
|
284 |
+
|
285 |
+
$this->post_taxonomy = apply_filters( 'breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) );
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Runs through the various WordPress conditional tags to check the current page being viewed. Once
|
290 |
+
* a condition is met, a specific method is launched to add items to the `$items` array.
|
291 |
+
*
|
292 |
+
* @since 1.0.0
|
293 |
+
* @access protected
|
294 |
+
* @return void
|
295 |
+
*/
|
296 |
+
protected function add_items() {
|
297 |
+
|
298 |
+
// If viewing the front page.
|
299 |
if ( is_front_page() ) {
|
300 |
+
$this->add_front_page_items();
|
301 |
}
|
302 |
|
303 |
+
// If not viewing the front page.
|
304 |
else {
|
305 |
|
306 |
+
// Add the network and site home links.
|
307 |
+
$this->add_network_home_link();
|
308 |
+
$this->add_site_home_link();
|
309 |
|
310 |
+
// If viewing the home/blog page.
|
311 |
if ( is_home() ) {
|
312 |
+
$this->add_posts_page_items();
|
313 |
}
|
314 |
|
315 |
+
// If viewing a single post.
|
316 |
elseif ( is_singular() ) {
|
317 |
+
$this->add_singular_items();
|
318 |
}
|
319 |
|
320 |
+
// If viewing an archive page.
|
321 |
elseif ( is_archive() ) {
|
322 |
|
323 |
if ( is_post_type_archive() )
|
324 |
+
$this->add_post_type_archive_items();
|
325 |
|
326 |
elseif ( is_category() || is_tag() || is_tax() )
|
327 |
+
$this->add_term_archive_items();
|
328 |
|
329 |
elseif ( is_author() )
|
330 |
+
$this->add_user_archive_items();
|
331 |
|
332 |
elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
|
333 |
+
$this->add_minute_hour_archive_items();
|
334 |
|
335 |
elseif ( get_query_var( 'minute' ) )
|
336 |
+
$this->add_minute_archive_items();
|
337 |
|
338 |
elseif ( get_query_var( 'hour' ) )
|
339 |
+
$this->add_hour_archive_items();
|
340 |
|
341 |
elseif ( is_day() )
|
342 |
+
$this->add_day_archive_items();
|
343 |
|
344 |
elseif ( get_query_var( 'w' ) )
|
345 |
+
$this->add_week_archive_items();
|
346 |
|
347 |
elseif ( is_month() )
|
348 |
+
$this->add_month_archive_items();
|
349 |
|
350 |
elseif ( is_year() )
|
351 |
+
$this->add_year_archive_items();
|
352 |
|
353 |
else
|
354 |
+
$this->add_default_archive_items();
|
355 |
}
|
356 |
|
357 |
+
// If viewing a search results page.
|
358 |
elseif ( is_search() ) {
|
359 |
+
$this->add_search_items();
|
360 |
}
|
361 |
|
362 |
+
// If viewing the 404 page.
|
363 |
elseif ( is_404() ) {
|
364 |
+
$this->add_404_items();
|
365 |
}
|
366 |
}
|
367 |
|
368 |
+
// Add paged items if they exist.
|
369 |
+
$this->add_paged_items();
|
370 |
|
371 |
+
// Allow developers to overwrite the items for the breadcrumb trail.
|
372 |
+
$this->items = array_unique( apply_filters( 'breadcrumb_trail_items', $this->items, $this->args ) );
|
373 |
}
|
374 |
|
375 |
/**
|
376 |
* Gets front items based on $wp_rewrite->front.
|
377 |
*
|
378 |
+
* @since 1.0.0
|
379 |
+
* @access protected
|
380 |
* @return void
|
381 |
*/
|
382 |
+
protected function add_rewrite_front_items() {
|
383 |
global $wp_rewrite;
|
384 |
|
385 |
if ( $wp_rewrite->front )
|
386 |
+
$this->add_path_parents( $wp_rewrite->front );
|
387 |
}
|
388 |
|
389 |
/**
|
390 |
* Adds the page/paged number to the items array.
|
391 |
*
|
392 |
+
* @since 1.0.0
|
393 |
+
* @access protected
|
394 |
* @return void
|
395 |
*/
|
396 |
+
protected function add_paged_items() {
|
397 |
|
398 |
+
// If viewing a paged singular post.
|
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' ) ) ) );
|
|
|
405 |
}
|
406 |
|
407 |
/**
|
408 |
* Adds the network (all sites) home page link to the items array.
|
409 |
*
|
410 |
+
* @since 1.0.0
|
411 |
+
* @access protected
|
412 |
* @return void
|
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 |
|
420 |
/**
|
421 |
* Adds the current site's home page link to the items array.
|
422 |
*
|
423 |
+
* @since 1.0.0
|
424 |
+
* @access protected
|
425 |
* @return void
|
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 |
/**
|
437 |
* Adds items for the front page to the items array.
|
438 |
*
|
439 |
+
* @since 1.0.0
|
440 |
+
* @access protected
|
441 |
* @return void
|
442 |
*/
|
443 |
+
protected function add_front_page_items() {
|
444 |
|
445 |
+
// Only show front items if the 'show_on_front' argument is set to 'true'.
|
446 |
if ( true === $this->args['show_on_front'] || is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) {
|
447 |
|
448 |
+
// Add network home link.
|
449 |
+
$this->add_network_home_link();
|
|
|
|
|
|
|
450 |
|
451 |
+
// If on a paged view, add the site home link.
|
452 |
+
if ( is_paged() )
|
453 |
+
$this->add_site_home_link();
|
454 |
|
455 |
+
// If on the main front page, add the network home title.
|
456 |
+
elseif ( true === $this->args['show_title'] )
|
457 |
+
$this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home'];
|
458 |
}
|
459 |
}
|
460 |
|
461 |
/**
|
462 |
* Adds items for the posts page (i.e., is_home()) to the items array.
|
463 |
*
|
464 |
+
* @since 1.0.0
|
465 |
+
* @access protected
|
466 |
* @return void
|
467 |
*/
|
468 |
+
protected function add_posts_page_items() {
|
469 |
|
470 |
+
// Get the post ID and post.
|
471 |
$post_id = get_queried_object_id();
|
472 |
+
$post = get_post( $post_id );
|
473 |
|
474 |
+
// If the post has parents, add them to the trail.
|
475 |
if ( 0 < $post->post_parent )
|
476 |
+
$this->add_post_parents( $post->post_parent );
|
477 |
|
478 |
+
// Get the page title.
|
479 |
$title = get_the_title( $post_id );
|
480 |
|
481 |
+
// Add the posts page item.
|
482 |
if ( is_paged() )
|
483 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), $title );
|
484 |
|
485 |
elseif ( $title && true === $this->args['show_title'] )
|
486 |
$this->items[] = $title;
|
489 |
/**
|
490 |
* Adds singular post items to the items array.
|
491 |
*
|
492 |
+
* @since 1.0.0
|
493 |
+
* @access protected
|
494 |
* @return void
|
495 |
*/
|
496 |
+
protected function add_singular_items() {
|
497 |
|
498 |
+
// Get the queried post.
|
499 |
$post = get_queried_object();
|
500 |
$post_id = get_queried_object_id();
|
501 |
|
502 |
+
// If the post has a parent, follow the parent trail.
|
503 |
if ( 0 < $post->post_parent )
|
504 |
+
$this->add_post_parents( $post->post_parent );
|
505 |
|
506 |
+
// If the post doesn't have a parent, get its hierarchy based off the post type.
|
507 |
else
|
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'] )
|
521 |
$this->items[] = $post_title;
|
522 |
}
|
523 |
}
|
524 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
525 |
/**
|
526 |
* Adds the items to the trail items array for taxonomy term archives.
|
527 |
*
|
528 |
+
* @since 1.0.0
|
529 |
+
* @access protected
|
530 |
* @global object $wp_rewrite
|
531 |
* @return void
|
532 |
*/
|
533 |
+
protected function add_term_archive_items() {
|
534 |
global $wp_rewrite;
|
535 |
|
536 |
+
// Get some taxonomy and term variables.
|
537 |
+
$term = get_queried_object();
|
538 |
+
$taxonomy = get_taxonomy( $term->taxonomy );
|
539 |
+
$done_post_type = false;
|
540 |
|
541 |
+
// If there are rewrite rules for the taxonomy.
|
542 |
if ( false !== $taxonomy->rewrite ) {
|
543 |
|
544 |
+
// If 'with_front' is true, dd $wp_rewrite->front to the trail.
|
545 |
if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front )
|
546 |
+
$this->add_rewrite_front_items();
|
547 |
|
548 |
+
// Get parent pages by path if they exist.
|
549 |
+
$this->add_path_parents( $taxonomy->rewrite['slug'] );
|
550 |
|
551 |
+
// Add post type archive if its 'has_archive' matches the taxonomy rewrite 'slug'.
|
552 |
if ( $taxonomy->rewrite['slug'] ) {
|
553 |
|
554 |
$slug = trim( $taxonomy->rewrite['slug'], '/' );
|
555 |
|
556 |
+
// Deals with the situation if the slug has a '/' between multiple
|
557 |
+
// strings. For example, "movies/genres" where "movies" is the post
|
558 |
+
// type archive.
|
|
|
559 |
$matches = explode( '/', $slug );
|
560 |
|
561 |
+
// If matches are found for the path.
|
562 |
if ( isset( $matches ) ) {
|
563 |
|
564 |
+
// Reverse the array of matches to search for posts in the proper order.
|
565 |
$matches = array_reverse( $matches );
|
566 |
|
567 |
+
// Loop through each of the path matches.
|
568 |
foreach ( $matches as $match ) {
|
569 |
|
570 |
+
// If a match is found.
|
571 |
$slug = $match;
|
572 |
|
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 );
|
585 |
+
|
586 |
+
// Add the post type archive link to the trail.
|
587 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label );
|
588 |
|
589 |
+
$done_post_type = true;
|
590 |
+
|
591 |
+
// Break out of the loop.
|
592 |
break;
|
593 |
}
|
594 |
}
|
596 |
}
|
597 |
}
|
598 |
|
599 |
+
// If there's a single post type for the taxonomy, use it.
|
600 |
+
if ( false === $done_post_type && 1 === count( $taxonomy->object_type ) && post_type_exists( $taxonomy->object_type[0] ) ) {
|
601 |
+
|
602 |
+
// If the post type is 'post'.
|
603 |
+
if ( 'post' === $taxonomy->object_type[0] ) {
|
604 |
+
$post_id = get_option( 'page_for_posts' );
|
605 |
+
|
606 |
+
if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id )
|
607 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
|
608 |
+
|
609 |
+
// If the post type is not 'post'.
|
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 );
|
617 |
+
|
618 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label );
|
619 |
+
}
|
620 |
+
}
|
621 |
+
|
622 |
+
// If the taxonomy is hierarchical, list its parent terms.
|
623 |
if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent )
|
624 |
+
$this->add_term_parents( $term->parent, $term->taxonomy );
|
625 |
|
626 |
+
// Add the term name to the trail end.
|
627 |
if ( is_paged() )
|
628 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) );
|
629 |
|
630 |
elseif ( true === $this->args['show_title'] )
|
631 |
$this->items[] = single_term_title( '', false );
|
634 |
/**
|
635 |
* Adds the items to the trail items array for post type archives.
|
636 |
*
|
637 |
+
* @since 1.0.0
|
638 |
+
* @access protected
|
639 |
* @return void
|
640 |
*/
|
641 |
+
protected function add_post_type_archive_items() {
|
642 |
|
643 |
+
// Get the post type object.
|
644 |
$post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
|
645 |
|
646 |
if ( false !== $post_type_object->rewrite ) {
|
647 |
|
648 |
+
// If 'with_front' is true, add $wp_rewrite->front to the trail.
|
649 |
if ( $post_type_object->rewrite['with_front'] )
|
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 );
|
665 |
/**
|
666 |
* Adds the items to the trail items array for user (author) archives.
|
667 |
*
|
668 |
+
* @since 1.0.0
|
669 |
+
* @access protected
|
670 |
* @global object $wp_rewrite
|
671 |
* @return void
|
672 |
*/
|
673 |
+
protected function add_user_archive_items() {
|
674 |
global $wp_rewrite;
|
675 |
|
676 |
+
// Add $wp_rewrite->front to the trail.
|
677 |
+
$this->add_rewrite_front_items();
|
678 |
|
679 |
+
// Get the user ID.
|
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.
|
687 |
if ( is_paged() )
|
688 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) );
|
689 |
|
690 |
elseif ( true === $this->args['show_title'] )
|
691 |
$this->items[] = get_the_author_meta( 'display_name', $user_id );
|
694 |
/**
|
695 |
* Adds the items to the trail items array for minute + hour archives.
|
696 |
*
|
697 |
+
* @since 1.0.0
|
698 |
+
* @access protected
|
699 |
* @return void
|
700 |
*/
|
701 |
+
protected function add_minute_hour_archive_items() {
|
702 |
|
703 |
+
// Add $wp_rewrite->front to the trail.
|
704 |
+
$this->add_rewrite_front_items();
|
705 |
|
706 |
+
// Add the minute + hour item.
|
707 |
if ( true === $this->args['show_title'] )
|
708 |
+
$this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'breadcrumb-trail' ) ) );
|
709 |
}
|
710 |
|
711 |
/**
|
712 |
* Adds the items to the trail items array for minute archives.
|
713 |
*
|
714 |
+
* @since 1.0.0
|
715 |
+
* @access protected
|
716 |
* @return void
|
717 |
*/
|
718 |
+
protected function add_minute_archive_items() {
|
719 |
|
720 |
+
// Add $wp_rewrite->front to the trail.
|
721 |
+
$this->add_rewrite_front_items();
|
722 |
|
723 |
+
// Add the minute item.
|
724 |
if ( true === $this->args['show_title'] )
|
725 |
+
$this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'breadcrumb-trail' ) ) );
|
726 |
}
|
727 |
|
728 |
/**
|
729 |
* Adds the items to the trail items array for hour archives.
|
730 |
*
|
731 |
+
* @since 1.0.0
|
732 |
+
* @access protected
|
733 |
* @return void
|
734 |
*/
|
735 |
+
protected function add_hour_archive_items() {
|
736 |
|
737 |
+
// Add $wp_rewrite->front to the trail.
|
738 |
+
$this->add_rewrite_front_items();
|
739 |
|
740 |
+
// Add the hour item.
|
741 |
if ( true === $this->args['show_title'] )
|
742 |
+
$this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'breadcrumb-trail' ) ) );
|
743 |
}
|
744 |
|
745 |
/**
|
746 |
* Adds the items to the trail items array for day archives.
|
747 |
*
|
748 |
+
* @since 1.0.0
|
749 |
+
* @access protected
|
750 |
* @return void
|
751 |
*/
|
752 |
+
protected function add_day_archive_items() {
|
753 |
|
754 |
+
// Add $wp_rewrite->front to the trail.
|
755 |
+
$this->add_rewrite_front_items();
|
756 |
|
757 |
+
// Get year, month, and day.
|
758 |
+
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'breadcrumb-trail' ) ) );
|
759 |
+
$month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'breadcrumb-trail' ) ) );
|
760 |
+
$day = sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'breadcrumb-trail' ) ) );
|
761 |
|
762 |
+
// Add the year and month items.
|
763 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
764 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
|
765 |
|
766 |
+
// Add the day item.
|
767 |
if ( is_paged() )
|
768 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day );
|
769 |
|
770 |
elseif ( true === $this->args['show_title'] )
|
771 |
$this->items[] = $day;
|
774 |
/**
|
775 |
* Adds the items to the trail items array for week archives.
|
776 |
*
|
777 |
+
* @since 1.0.0
|
778 |
+
* @access protected
|
779 |
* @return void
|
780 |
*/
|
781 |
+
protected function add_week_archive_items() {
|
782 |
|
783 |
+
// Add $wp_rewrite->front to the trail.
|
784 |
+
$this->add_rewrite_front_items();
|
785 |
|
786 |
+
// Get the year and week.
|
787 |
+
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'breadcrumb-trail' ) ) );
|
788 |
+
$week = sprintf( $this->labels['archive_week'], get_the_time( esc_html_x( 'W', 'weekly archives date format', 'breadcrumb-trail' ) ) );
|
789 |
|
790 |
+
// Add the year item.
|
791 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
792 |
|
793 |
+
// Add the week item.
|
794 |
if ( is_paged() )
|
795 |
+
$this->items[] = esc_url( get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ) ), home_url() ), $week, false ) );
|
796 |
|
797 |
elseif ( true === $this->args['show_title'] )
|
798 |
$this->items[] = $week;
|
801 |
/**
|
802 |
* Adds the items to the trail items array for month archives.
|
803 |
*
|
804 |
+
* @since 1.0.0
|
805 |
+
* @access protected
|
806 |
* @return void
|
807 |
*/
|
808 |
+
protected function add_month_archive_items() {
|
809 |
|
810 |
+
// Add $wp_rewrite->front to the trail.
|
811 |
+
$this->add_rewrite_front_items();
|
812 |
|
813 |
+
// Get the year and month.
|
814 |
+
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'breadcrumb-trail' ) ) );
|
815 |
+
$month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'breadcrumb-trail' ) ) );
|
816 |
|
817 |
+
// Add the year item.
|
818 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
819 |
|
820 |
+
// Add the month item.
|
821 |
if ( is_paged() )
|
822 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month );
|
823 |
|
824 |
elseif ( true === $this->args['show_title'] )
|
825 |
$this->items[] = $month;
|
828 |
/**
|
829 |
* Adds the items to the trail items array for year archives.
|
830 |
*
|
831 |
+
* @since 1.0.0
|
832 |
+
* @access protected
|
833 |
* @return void
|
834 |
*/
|
835 |
+
protected function add_year_archive_items() {
|
836 |
|
837 |
+
// Add $wp_rewrite->front to the trail.
|
838 |
+
$this->add_rewrite_front_items();
|
839 |
|
840 |
+
// Get the year.
|
841 |
+
$year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'breadcrumb-trail' ) ) );
|
842 |
|
843 |
+
// Add the year item.
|
844 |
if ( is_paged() )
|
845 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year );
|
846 |
|
847 |
elseif ( true === $this->args['show_title'] )
|
848 |
$this->items[] = $year;
|
852 |
* Adds the items to the trail items array for archives that don't have a more specific method
|
853 |
* defined in this class.
|
854 |
*
|
855 |
+
* @since 1.0.0
|
856 |
+
* @access protected
|
857 |
* @return void
|
858 |
*/
|
859 |
+
protected function add_default_archive_items() {
|
860 |
|
861 |
+
// If this is a date-/time-based archive, add $wp_rewrite->front to the trail.
|
862 |
if ( is_date() || is_time() )
|
863 |
+
$this->add_rewrite_front_items();
|
864 |
|
865 |
if ( true === $this->args['show_title'] )
|
866 |
+
$this->items[] = $this->labels['archives'];
|
867 |
}
|
868 |
|
869 |
/**
|
870 |
* Adds the items to the trail items array for search results.
|
871 |
*
|
872 |
+
* @since 1.0.0
|
873 |
+
* @access protected
|
874 |
* @return void
|
875 |
*/
|
876 |
+
protected function add_search_items() {
|
877 |
|
878 |
if ( is_paged() )
|
879 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) );
|
880 |
|
881 |
elseif ( true === $this->args['show_title'] )
|
882 |
+
$this->items[] = sprintf( $this->labels['search'], get_search_query() );
|
883 |
}
|
884 |
|
885 |
/**
|
886 |
* Adds the items to the trail items array for 404 pages.
|
887 |
*
|
888 |
+
* @since 1.0.0
|
889 |
+
* @access protected
|
890 |
* @return void
|
891 |
*/
|
892 |
+
protected function add_404_items() {
|
893 |
|
894 |
if ( true === $this->args['show_title'] )
|
895 |
+
$this->items[] = $this->labels['error_404'];
|
896 |
}
|
897 |
|
898 |
/**
|
899 |
+
* Adds a specific post's parents to the items array.
|
900 |
+
*
|
901 |
+
* @since 1.0.0
|
902 |
+
* @access protected
|
903 |
+
* @param int $post_id
|
904 |
+
* @return void
|
905 |
+
*/
|
906 |
+
protected function add_post_parents( $post_id ) {
|
907 |
+
$parents = array();
|
908 |
+
|
909 |
+
while ( $post_id ) {
|
910 |
+
|
911 |
+
// Get the post by ID.
|
912 |
+
$post = get_post( $post_id );
|
913 |
+
|
914 |
+
// If we hit a page that's set as the front page, bail.
|
915 |
+
if ( 'page' == $post->post_type && 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) )
|
916 |
+
break;
|
917 |
+
|
918 |
+
// Add the formatted post link to the array of parents.
|
919 |
+
$parents[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) );
|
920 |
+
|
921 |
+
// If there's no longer a post parent, break out of the loop.
|
922 |
+
if ( 0 >= $post->post_parent )
|
923 |
+
break;
|
924 |
+
|
925 |
+
// Change the post ID to the parent post to continue looping.
|
926 |
+
$post_id = $post->post_parent;
|
927 |
+
}
|
928 |
+
|
929 |
+
// Get the post hierarchy based off the final parent post.
|
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.
|
937 |
+
$this->items = array_merge( $this->items, array_reverse( $parents ) );
|
938 |
+
}
|
939 |
+
|
940 |
+
/**
|
941 |
+
* Adds a specific post's hierarchy to the items array. The hierarchy is determined by post type's
|
942 |
+
* rewrite arguments and whether it has an archive page.
|
943 |
+
*
|
944 |
+
* @since 1.0.0
|
945 |
+
* @access protected
|
946 |
+
* @param int $post_id
|
947 |
+
* @return void
|
948 |
+
*/
|
949 |
+
protected function add_post_hierarchy( $post_id ) {
|
950 |
+
|
951 |
+
// Get the post type.
|
952 |
+
$post_type = get_post_type( $post_id );
|
953 |
+
$post_type_object = get_post_type_object( $post_type );
|
954 |
+
|
955 |
+
// If this is the 'post' post type, get the rewrite front items and map the rewrite tags.
|
956 |
+
if ( 'post' === $post_type ) {
|
957 |
+
|
958 |
+
// Add $wp_rewrite->front to the trail.
|
959 |
+
$this->add_rewrite_front_items();
|
960 |
+
|
961 |
+
// Map the rewrite tags.
|
962 |
+
$this->map_rewrite_tags( $post_id, get_option( 'permalink_structure' ) );
|
963 |
+
}
|
964 |
+
|
965 |
+
// If the post type has rewrite rules.
|
966 |
+
elseif ( false !== $post_type_object->rewrite ) {
|
967 |
+
|
968 |
+
// If 'with_front' is true, add $wp_rewrite->front to the trail.
|
969 |
+
if ( $post_type_object->rewrite['with_front'] )
|
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 |
+
|
977 |
+
// If there's an archive page, add it to the 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 |
+
/**
|
991 |
+
* Gets post types by slug. This is needed because the get_post_types() function doesn't exactly
|
992 |
+
* match the 'has_archive' argument when it's set as a string instead of a boolean.
|
993 |
*
|
994 |
* @since 0.6.0
|
995 |
+
* @access protected
|
996 |
+
* @param int $slug The post type archive slug to search for.
|
997 |
+
* @return void
|
998 |
+
*/
|
999 |
+
protected function get_post_types_by_slug( $slug ) {
|
1000 |
+
|
1001 |
+
$return = array();
|
1002 |
+
|
1003 |
+
$post_types = get_post_types( array(), 'objects' );
|
1004 |
+
|
1005 |
+
foreach ( $post_types as $type ) {
|
1006 |
+
|
1007 |
+
if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) )
|
1008 |
+
$return[] = $type;
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
return $return;
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
/**
|
1015 |
+
* Adds a post's terms from a specific taxonomy to the items array.
|
1016 |
+
*
|
1017 |
+
* @since 1.0.0
|
1018 |
+
* @access protected
|
1019 |
+
* @param int $post_id The ID of the post to get the terms for.
|
1020 |
+
* @param string $taxonomy The taxonomy to get the terms from.
|
1021 |
+
* @return void
|
1022 |
+
*/
|
1023 |
+
protected function add_post_terms( $post_id, $taxonomy ) {
|
1024 |
+
|
1025 |
+
// Get the post type.
|
1026 |
+
$post_type = get_post_type( $post_id );
|
1027 |
+
|
1028 |
+
// Get the post categories.
|
1029 |
+
$terms = get_the_terms( $post_id, $taxonomy );
|
1030 |
+
|
1031 |
+
// Check that categories were returned.
|
1032 |
+
if ( $terms && ! is_wp_error( $terms ) ) {
|
1033 |
+
|
1034 |
+
// Sort the terms by ID and get the first category.
|
1035 |
+
usort( $terms, '_usort_terms_by_ID' );
|
1036 |
+
$term = get_term( $terms[0], $taxonomy );
|
1037 |
+
|
1038 |
+
// If the category has a parent, add the hierarchy to the trail.
|
1039 |
+
if ( 0 < $term->parent )
|
1040 |
+
$this->add_term_parents( $term->parent, $taxonomy );
|
1041 |
+
|
1042 |
+
// Add the category archive link to the trail.
|
1043 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $taxonomy ) ), $term->name );
|
1044 |
+
}
|
1045 |
+
}
|
1046 |
+
|
1047 |
+
/**
|
1048 |
+
* Get parent posts by path. Currently, this method only supports getting parents of the 'page'
|
1049 |
+
* post type. The goal of this function is to create a clear path back to home given what would
|
1050 |
+
* normally be a "ghost" directory. If any page matches the given path, it'll be added.
|
1051 |
+
*
|
1052 |
+
* @since 1.0.0
|
1053 |
+
* @access protected
|
1054 |
* @param string $path The path (slug) to search for posts by.
|
1055 |
* @return void
|
1056 |
*/
|
1057 |
+
function add_path_parents( $path ) {
|
1058 |
|
1059 |
+
// Trim '/' off $path in case we just got a simple '/' instead of a real path.
|
1060 |
$path = trim( $path, '/' );
|
1061 |
|
1062 |
+
// If there's no path, return.
|
1063 |
if ( empty( $path ) )
|
1064 |
return;
|
1065 |
|
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 |
|
1073 |
elseif ( is_null( $post ) ) {
|
1074 |
|
1075 |
+
// Separate post names into separate paths by '/'.
|
1076 |
$path = trim( $path, '/' );
|
1077 |
preg_match_all( "/\/.*?\z/", $path, $matches );
|
1078 |
|
1079 |
+
// If matches are found for the path.
|
1080 |
if ( isset( $matches ) ) {
|
1081 |
|
1082 |
+
// Reverse the array of matches to search for posts in the proper order.
|
1083 |
$matches = array_reverse( $matches );
|
1084 |
|
1085 |
+
// Loop through each of the path matches.
|
1086 |
foreach ( $matches as $match ) {
|
1087 |
|
1088 |
+
// If a match is found.
|
1089 |
if ( isset( $match[0] ) ) {
|
1090 |
|
1091 |
+
// Get the parent post by the given path.
|
1092 |
$path = str_replace( $match[0], '', $path );
|
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 |
}
|
1100 |
}
|
1104 |
}
|
1105 |
|
1106 |
/**
|
1107 |
+
* Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress
|
1108 |
* function get_category_parents() but handles any type of taxonomy.
|
1109 |
*
|
1110 |
+
* @since 1.0.0
|
1111 |
* @param int $term_id ID of the term to get the parents of.
|
1112 |
* @param string $taxonomy Name of the taxonomy for the given term.
|
1113 |
* @return void
|
1114 |
*/
|
1115 |
+
function add_term_parents( $term_id, $taxonomy ) {
|
1116 |
|
1117 |
+
// Set up some default arrays.
|
1118 |
$parents = array();
|
1119 |
|
1120 |
+
// While there is a parent ID, add the parent term link to the $parents array.
|
1121 |
while ( $term_id ) {
|
1122 |
|
1123 |
+
// Get the parent term.
|
1124 |
$term = get_term( $term_id, $taxonomy );
|
1125 |
|
1126 |
+
// Add the formatted term link to the array of parent terms.
|
1127 |
+
$parents[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term, $taxonomy ) ), $term->name );
|
1128 |
|
1129 |
+
// Set the parent term's parent as the parent ID.
|
1130 |
$term_id = $term->parent;
|
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 |
/**
|
1139 |
* Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of
|
1140 |
+
* hackish for now because we're checking for specific %tag% examples and only doing it for the 'post'
|
1141 |
* post type. In the future, maybe it'll handle a wider variety of possibilities, especially for custom post
|
1142 |
* types.
|
1143 |
*
|
1144 |
* @since 0.6.0
|
1145 |
+
* @access protected
|
1146 |
* @param int $post_id ID of the post whose parents we want.
|
1147 |
* @param string $path Path of a potential parent page.
|
1148 |
* @param array $args Mixed arguments for the menu.
|
1149 |
* @return array
|
1150 |
*/
|
1151 |
+
protected function map_rewrite_tags( $post_id, $path ) {
|
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 |
|
1162 |
+
// Split the $path into an array of strings.
|
1163 |
$matches = explode( '/', $path );
|
1164 |
|
1165 |
+
// If matches are found for the path.
|
1166 |
if ( is_array( $matches ) ) {
|
1167 |
|
1168 |
+
// Loop through each of the matches, adding each to the $trail array.
|
1169 |
foreach ( $matches as $match ) {
|
1170 |
|
1171 |
+
// Trim any '/' from the $match.
|
1172 |
$tag = trim( $match, '/' );
|
1173 |
|
1174 |
+
// If using the %year% tag, add a link to the yearly archive.
|
1175 |
if ( '%year%' == $tag )
|
1176 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'breadcrumb-trail' ) ) ) );
|
1177 |
|
1178 |
+
// If using the %monthnum% tag, add a link to the monthly archive.
|
1179 |
elseif ( '%monthnum%' == $tag )
|
1180 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'breadcrumb-trail' ) ) ) );
|
1181 |
|
1182 |
+
// If using the %day% tag, add a link to the daily archive.
|
1183 |
elseif ( '%day%' == $tag )
|
1184 |
+
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'breadcrumb-trail' ) ) ) );
|
1185 |
|
1186 |
+
// If using the %author% tag, add a link to the post author archive.
|
1187 |
elseif ( '%author%' == $tag )
|
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 ( '%category%' == $tag ) {
|
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, 'category' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1198 |
}
|
1199 |
}
|
1200 |
}
|
1201 |
}
|
1202 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/breadcrumb-trail-fi.mo
CHANGED
Binary file
|
languages/breadcrumb-trail-fi.po
CHANGED
@@ -1,137 +1,138 @@
|
|
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:
|
6 |
-
"PO-Revision-Date:
|
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:
|
21 |
-
msgid "Browse:"
|
22 |
-
msgstr "Olet täällä:"
|
23 |
-
|
24 |
-
#: inc/breadcrumbs.php:
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
#.
|
43 |
-
#: inc/breadcrumbs.php:
|
44 |
-
msgid "
|
45 |
-
msgstr "
|
46 |
-
|
47 |
-
#. Translators:
|
48 |
-
#: inc/breadcrumbs.php:
|
49 |
-
msgid "
|
50 |
-
msgstr "
|
51 |
-
|
52 |
-
#. Translators:
|
53 |
-
#: inc/breadcrumbs.php:
|
54 |
-
msgid "
|
55 |
-
msgstr "
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
msgid "
|
60 |
-
msgstr "
|
61 |
-
|
62 |
-
#: inc/breadcrumbs.php:
|
63 |
-
msgctxt "minute archives time format"
|
64 |
-
msgid "i"
|
65 |
-
msgstr ""
|
66 |
-
|
67 |
-
#: inc/breadcrumbs.php:
|
68 |
-
msgctxt "
|
69 |
-
msgid "
|
70 |
-
msgstr "
|
71 |
-
|
72 |
-
#: inc/breadcrumbs.php:
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
#: inc/breadcrumbs.php:
|
79 |
-
msgctxt "
|
80 |
-
msgid "
|
81 |
-
msgstr "
|
82 |
-
|
83 |
-
#: inc/breadcrumbs.php:
|
84 |
-
msgctxt "
|
85 |
-
msgid "
|
86 |
-
msgstr ""
|
87 |
-
|
88 |
-
#: inc/breadcrumbs.php:
|
89 |
-
msgctxt "
|
90 |
-
msgid "
|
91 |
-
msgstr ""
|
92 |
-
|
93 |
-
#: inc/breadcrumbs.php:
|
94 |
-
|
95 |
-
msgid "
|
96 |
-
msgstr "
|
97 |
-
|
98 |
-
|
99 |
-
msgid "
|
100 |
-
msgstr "
|
101 |
-
|
102 |
-
|
103 |
-
msgid "
|
104 |
-
msgstr "
|
105 |
-
|
106 |
-
#.
|
107 |
-
msgid "
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
msgstr ""
|
113 |
-
|
114 |
-
#.
|
115 |
-
msgid ""
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
"
|
120 |
-
msgstr ""
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
#~
|
132 |
-
|
133 |
-
|
134 |
-
#~
|
135 |
-
|
136 |
-
|
137 |
-
#~
|
|
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
ADDED
Binary file
|
languages/breadcrumb-trail-fr_FR.po
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
languages/breadcrumb-trail.pot
CHANGED
@@ -1,122 +1,114 @@
|
|
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 0.
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/breadcrumb-trail\n"
|
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 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
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 |
-
msgid "
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: inc/breadcrumbs.php:
|
62 |
-
msgctxt "minute archives time format"
|
63 |
-
msgid "i"
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: inc/breadcrumbs.php:
|
67 |
-
msgctxt "
|
68 |
-
msgid "
|
69 |
-
msgstr ""
|
70 |
-
|
71 |
-
#: inc/breadcrumbs.php:
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
#: inc/breadcrumbs.php:
|
78 |
-
msgctxt "
|
79 |
-
msgid "
|
80 |
-
msgstr ""
|
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 |
-
|
94 |
-
msgid "
|
95 |
-
msgstr ""
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
#.
|
105 |
-
msgid "
|
106 |
-
msgstr ""
|
107 |
-
|
108 |
-
#.
|
109 |
-
msgid "
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#.
|
113 |
-
msgid "
|
114 |
-
msgstr ""
|
115 |
-
|
116 |
-
#. Author of the plugin/theme
|
117 |
-
msgid "Justin Tadlock"
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#. Author URI of the plugin/theme
|
121 |
-
msgid "http://justintadlock.com"
|
122 |
-
msgstr ""
|
1 |
+
# Copyright (C) 2015 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.0.0-alpha-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 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-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:244
|
16 |
+
msgid "Browse:"
|
17 |
+
msgstr ""
|
18 |
+
|
19 |
+
#: inc/breadcrumbs.php:245
|
20 |
+
msgctxt "breadcrumbs aria label"
|
21 |
+
msgid "Breadcrumbs"
|
22 |
+
msgstr ""
|
23 |
+
|
24 |
+
#: inc/breadcrumbs.php:246
|
25 |
+
msgid "Home"
|
26 |
+
msgstr ""
|
27 |
+
|
28 |
+
#: inc/breadcrumbs.php:247
|
29 |
+
msgid "404 Not Found"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: inc/breadcrumbs.php:248
|
33 |
+
msgid "Archives"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#. Translators: %s is the search query. The HTML entities are opening and
|
37 |
+
#. closing curly quotes.
|
38 |
+
|
39 |
+
#: inc/breadcrumbs.php:250
|
40 |
+
msgid "Search results for “%s”"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#. Translators: %s is the page number.
|
44 |
+
|
45 |
+
#: inc/breadcrumbs.php:252
|
46 |
+
msgid "Page %s"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#. Translators: Minute archive title. %s is the minute time format.
|
50 |
+
|
51 |
+
#: inc/breadcrumbs.php:254
|
52 |
+
msgid "Minute %s"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#. Translators: Weekly archive title. %s is the week date format.
|
56 |
+
|
57 |
+
#: inc/breadcrumbs.php:256
|
58 |
+
msgid "Week %s"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: inc/breadcrumbs.php:708
|
62 |
+
msgctxt "minute and hour archives time format"
|
63 |
+
msgid "g:i a"
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: inc/breadcrumbs.php:725
|
67 |
+
msgctxt "minute archives time format"
|
68 |
+
msgid "i"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: inc/breadcrumbs.php:742
|
72 |
+
msgctxt "hour archives time format"
|
73 |
+
msgid "g a"
|
74 |
+
msgstr ""
|
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 ""
|
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 ""
|
86 |
+
|
87 |
+
#: inc/breadcrumbs.php:760 inc/breadcrumbs.php:1184
|
88 |
+
msgctxt "daily archives date format"
|
89 |
+
msgid "j"
|
90 |
+
msgstr ""
|
91 |
+
|
92 |
+
#: inc/breadcrumbs.php:788
|
93 |
+
msgctxt "weekly archives date format"
|
94 |
+
msgid "W"
|
95 |
+
msgstr ""
|
96 |
+
#. Plugin Name of the plugin/theme
|
97 |
+
msgid "Breadcrumb Trail"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#. Plugin URI of the plugin/theme
|
101 |
+
msgid "http://themehybrid.com/plugins/breadcrumb-trail"
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#. Description of the plugin/theme
|
105 |
+
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."
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#. Author of the plugin/theme
|
109 |
+
msgid "Justin Tadlock"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#. Author URI of the plugin/theme
|
113 |
+
msgid "http://justintadlock.com"
|
114 |
+
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.md
CHANGED
@@ -23,38 +23,36 @@ That's all you need to do to add breadcrumbs to your site. Of course, you can c
|
|
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 |
$defaults = array(
|
26 |
-
'container' => '
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'
|
30 |
-
'
|
31 |
-
'
|
32 |
-
'
|
33 |
-
'
|
34 |
-
|
35 |
-
|
36 |
-
/* Post taxonomy (examples follow). */
|
37 |
'post_taxonomy' => array(
|
38 |
// 'post' => 'post_tag', // 'post' post type and 'post_tag' taxonomy
|
39 |
// 'book' => 'genre', // 'book' post type and 'genre' taxonomy
|
40 |
),
|
41 |
|
42 |
-
/* Labels for text used (see Breadcrumb_Trail::default_labels). */
|
43 |
'labels' => array(
|
44 |
-
'browse' =>
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
56 |
|
57 |
-
|
58 |
'archive_minute_hour' => '%s',
|
59 |
'archive_hour' => '%s',
|
60 |
'archive_day' => '%s',
|
@@ -65,129 +63,31 @@ The `breadcrumb_trail()` function accepts a single parameter of `$args`, which i
|
|
65 |
|
66 |
### Hooks ###
|
67 |
|
|
|
68 |
* `breadcrumb_trail_args` - Filter hook on the array of arguments passed in.
|
|
|
|
|
69 |
* `breadcrumb_trail_items` - Filter hook on the array of items before being output.
|
70 |
-
* `breadcrumb_trail_get_bbpress_items` - Filter hook on the array of items when using bbPress.
|
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.
|
76 |
|
77 |
#### Available properties ####
|
78 |
|
79 |
* `$items` - Array of trail items.
|
80 |
* `$args` - The parsed arguments passed in.
|
|
|
|
|
81 |
|
82 |
#### Available methods #####
|
83 |
|
84 |
* `trail()` - Outputs/returns the final HTML.
|
85 |
-
* `
|
86 |
|
87 |
Others are available, but those are the two you would actually put into real-world use.
|
88 |
|
89 |
-
## Changelog ##
|
90 |
-
|
91 |
-
### Version 0.6.1 ###
|
92 |
-
|
93 |
-
* Make sure `breadcrumb_trail()` can return the HTML.
|
94 |
-
* Add `rel="home"` to the home page link. This got removed at some point.
|
95 |
-
* Do network and site home links in bbPress.
|
96 |
-
* Slight fix to stop bbPress from putting double "Forums" in the breadcrumb trail.
|
97 |
-
* The `show_on_front` argument should only work if the front page is not paginated.
|
98 |
-
* Better handling of the text strings, particularly when displaying date/time.
|
99 |
-
* Updated `breadcrumb-trail.pot` file for better translating.
|
100 |
-
|
101 |
-
### Version 0.6.0 ###
|
102 |
-
|
103 |
-
* [Schema.org](http://schema.org) support.
|
104 |
-
* Completely overhauled the entire plugin, rewriting large swathes of code from the ground up. This version takes an object-oriented approach.
|
105 |
-
* Blew every other breadcrumb menu script out of the water.
|
106 |
-
|
107 |
-
### Version 0.5.3 ###
|
108 |
-
|
109 |
-
#### Enhancements ####
|
110 |
-
|
111 |
-
* Use `post_type_archive_title()` on post type archives in the trail.
|
112 |
-
* Add support for taxonomies that have a `$rewrite->slug` that matches a string value for a custom post type's `has_archive` argument.
|
113 |
-
* Added support for an `archive_title` label for custom post types because we can't use the `post_type_archive_title()` function on single posts views for the post type.
|
114 |
-
* Loads of pagination support on both archive-type pages and paged single posts.
|
115 |
-
* Added support for hierarchical custom post types (get parent posts).
|
116 |
-
* Added the `network` argument to allow multisite owners to run the trail all the way back to the main site.
|
117 |
-
|
118 |
-
#### Bug fixes ####
|
119 |
-
|
120 |
-
* Only check attachment trail if the attachment has a parent.
|
121 |
-
* Fixed the issue where the wrong post type archive link matches with a term archive page.
|
122 |
-
|
123 |
-
### Version 0.5.2 ###
|
124 |
-
|
125 |
-
* No friggin' clue. I think I actually skipped version numbers somehow. :)
|
126 |
-
|
127 |
-
### Version 0.5.1 ###
|
128 |
-
|
129 |
-
* Changed license from GPL 2-only to GPL 2+.
|
130 |
-
* Smarter handling of the `trail-begin` and `trail-end` classes.
|
131 |
-
* Added `container` argument for wrapping breadcrumbs in a custom HTML element.
|
132 |
-
* Changed `bbp_get_forum_parent()` to `bbp_get_forum_parent_id()`.
|
133 |
-
|
134 |
-
### Version 0.5.0 ###
|
135 |
-
|
136 |
-
* Use hardcoded strings for the textdomain, not a variable.
|
137 |
-
* Inline doc updates.
|
138 |
-
* Added bbPress support.
|
139 |
-
* Use `single_post_title()` instead of `get_the_title()` for post titles.
|
140 |
-
|
141 |
-
### Version 0.4.1 ###
|
142 |
-
|
143 |
-
* Use `get_queried_object()` and `get_queried_object_id()` instead of accessing `$wp_query` directly.
|
144 |
-
* Pass `$args` as second parameter in `breadcrumb_trail` hook.
|
145 |
-
|
146 |
-
### Version 0.4.0 ###
|
147 |
-
|
148 |
-
* New function: `breadcrumb_trail_get_items()`, which grabs a list of all the trail items. This separates the items from the main `breadcrumb_trail()` function.
|
149 |
-
* New filter hook: `breadcrumb_trail_items`, which allows devs to filter just the items.
|
150 |
-
* New function: `breadcrumb_trail_map_rewrite_tags()`, which maps the permalink structure tags set under Permalink Settings in the admin to make for a much more accurate breadcrumb trail.
|
151 |
-
* New function: `breadcrumb_trail_textdomain()`, which can be filtered when integrating the plugin into a theme to match the theme's textdomain.
|
152 |
-
* Added functionality to handle WP 3.1 post type enhancements.
|
153 |
-
|
154 |
-
### Version 0.3.1 ###
|
155 |
-
|
156 |
-
* Smarter logic in certain areas.
|
157 |
-
* Removed localization for things that shouldn't be localized with time formats.
|
158 |
-
* `single_tax` set to `null` instead of `false`.
|
159 |
-
* Better escaping of element attributes.
|
160 |
-
* Use `$wp_query->get_queried_object()` and `$wp_query->get_queried_object_id()`.
|
161 |
-
* Add in initial support of WordPress 3.1's post type archives.
|
162 |
-
* Better formatting and organization of the output late in the function.
|
163 |
-
* Added `trail-before` and `trail-after` CSS classes if `$before` or `$after` is set.
|
164 |
-
|
165 |
-
### Version 0.3.1 ###
|
166 |
-
|
167 |
-
* Undefined index error fixes.
|
168 |
-
* Fixes for trying to get a property of a non-object.
|
169 |
-
|
170 |
-
### Version 0.3.0 ###
|
171 |
-
|
172 |
-
* Added more support for custom post types and taxonomies.
|
173 |
-
* Added more support for more complex hierarchies.
|
174 |
-
* The breadcrumb trail now recognizes more patterns with pages as part of the permalink structure of other objects.
|
175 |
-
* All post types can have any taxonomy as the leading part of the trail.
|
176 |
-
* Cleaned up the code.
|
177 |
-
|
178 |
-
### Version 0.2.1 ###
|
179 |
-
|
180 |
-
* Removed and/or added (depending on the case) the extra separator item on sub-categories and date-/time-based breadcrumbs.
|
181 |
-
|
182 |
-
### Version 0.2.0 ###
|
183 |
-
|
184 |
-
* The title of the "home" page (i.e. posts page) when not the front page is now properly recognized.
|
185 |
-
* Cleaned up the code and logic behind the plugin.
|
186 |
-
|
187 |
-
### Version 0.1.0 ###
|
188 |
-
|
189 |
-
* Launch of the new plugin.
|
190 |
-
|
191 |
## Support ##
|
192 |
|
193 |
I run a WordPress community called [Theme Hybrid](http://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.
|
@@ -198,4 +98,4 @@ I know. I know. You might not want to pay for support, but just consider it a
|
|
198 |
|
199 |
Breadcrumb Trail is licensed under the [GNU GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html), version 2 or later.
|
200 |
|
201 |
-
2008 – 
|
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 |
$defaults = array(
|
26 |
+
'container' => 'nav',
|
27 |
+
'before' => '',
|
28 |
+
'after' => '',
|
29 |
+
'show_on_front' => true,
|
30 |
+
'network' => false,
|
31 |
+
'show_title' => true,
|
32 |
+
'show_browse' => true,
|
33 |
+
'echo' => true
|
34 |
+
|
|
|
|
|
35 |
'post_taxonomy' => array(
|
36 |
// 'post' => 'post_tag', // 'post' post type and 'post_tag' taxonomy
|
37 |
// 'book' => 'genre', // 'book' post type and 'genre' taxonomy
|
38 |
),
|
39 |
|
|
|
40 |
'labels' => array(
|
41 |
+
'browse' => esc_html__( 'Browse:', 'breadcrumb-trail' ),
|
42 |
+
'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'breadcrumb-trail' ),
|
43 |
+
'home' => esc_html__( 'Home', 'breadcrumb-trail' ),
|
44 |
+
'error_404' => esc_html__( '404 Not Found', 'breadcrumb-trail' ),
|
45 |
+
'archives' => esc_html__( 'Archives', 'breadcrumb-trail' ),
|
46 |
+
// Translators: %s is the search query. The HTML entities are opening and closing curly quotes.
|
47 |
+
'search' => esc_html__( 'Search results for “%s”', 'breadcrumb-trail' ),
|
48 |
+
// Translators: %s is the page number.
|
49 |
+
'paged' => esc_html__( 'Page %s', 'breadcrumb-trail' ),
|
50 |
+
// Translators: Minute archive title. %s is the minute time format.
|
51 |
+
'archive_minute' => esc_html__( 'Minute %s', 'breadcrumb-trail' ),
|
52 |
+
// Translators: Weekly archive title. %s is the week date format.
|
53 |
+
'archive_week' => esc_html__( 'Week %s', 'breadcrumb-trail' ),
|
54 |
|
55 |
+
// "%s" is replaced with the translated date/time format.
|
56 |
'archive_minute_hour' => '%s',
|
57 |
'archive_hour' => '%s',
|
58 |
'archive_day' => '%s',
|
63 |
|
64 |
### Hooks ###
|
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.
|
68 |
+
* `breadcrumb_trail_labels` - Filter hook on the text labels.
|
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](http://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.
|
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 – 2015 © [Justin Tadlock](http://justintadlock.com).
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Contributors: greenshady
|
4 |
Donate link: http://themehybrid.com/donate
|
5 |
Tags: navigation, menu, breadcrumb, breadcrumbs, microdata, schema
|
6 |
-
Requires at least:
|
7 |
-
Stable tag: 0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.htm
|
10 |
|
@@ -22,14 +22,14 @@ This means that it can also detect custom post types and taxonomies right out of
|
|
22 |
|
23 |
### Features ###
|
24 |
|
25 |
-
*
|
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 |
### Professional support ###
|
31 |
|
32 |
-
If you need professional plugin support from me, the plugin author, you can access the support forums at [Theme Hybrid](http://themehybrid.com
|
33 |
|
34 |
== Installation ==
|
35 |
|
@@ -61,7 +61,19 @@ There are several methods, but in general, you would add the following line of c
|
|
61 |
|
62 |
<?php if ( function_exists( 'breadcrumb_trail' ) ) breadcrumb_trail(); ?>
|
63 |
|
64 |
-
To see all methods and options, refer to the `readme.md` file included with the plugin download.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
### Do breadcrumbs show in Google search results? ###
|
67 |
|
@@ -96,108 +108,17 @@ There's not really much I can do to correct that within the Breadcrumb Trail plu
|
|
96 |
|
97 |
== Upgrade Notice ==
|
98 |
|
99 |
-
### Version 0.
|
100 |
|
101 |
-
If upgrading to a version earlier than
|
102 |
|
103 |
== Changelog ==
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
* Make sure `breadcrumb_trail()` can return the HTML.
|
108 |
-
* Add `rel="home"` to the home page link. This got removed at some point.
|
109 |
-
* Do network and site home links in bbPress.
|
110 |
-
* Slight fix to stop bbPress from putting double "Forums" in the breadcrumb trail.
|
111 |
-
* The `show_on_front` argument should only work if the front page is not paginated.
|
112 |
-
* Better handling of the text strings, particularly when displaying date/time.
|
113 |
-
* Updated `breadcrumb-trail.pot` file for better translating.
|
114 |
-
|
115 |
-
### Version 0.6.0 ###
|
116 |
-
|
117 |
-
* [Schema.org](http://schema.org) support.
|
118 |
-
* Completely overhauled the entire plugin, rewriting large swathes of code from the ground up. This version takes an object-oriented approach.
|
119 |
-
* Blew every other breadcrumb menu script out of the water.
|
120 |
-
|
121 |
-
### Version 0.5.3 ###
|
122 |
-
|
123 |
-
#### Enhancements ####
|
124 |
-
|
125 |
-
* Use `post_type_archive_title()` on post type archives in the trail.
|
126 |
-
* Add support for taxonomies that have a `$rewrite->slug` that matches a string value for a custom post type's `has_archive` argument.
|
127 |
-
* Added support for an `archive_title` label for custom post types because we can't use the `post_type_archive_title()` function on single posts views for the post type.
|
128 |
-
* Loads of pagination support on both archive-type pages and paged single posts.
|
129 |
-
* Added support for hierarchical custom post types (get parent posts).
|
130 |
-
* Added the `network` argument to allow multisite owners to run the trail all the way back to the main site.
|
131 |
-
|
132 |
-
#### Bug fixes ####
|
133 |
-
|
134 |
-
* Only check attachment trail if the attachment has a parent.
|
135 |
-
* Fixed the issue where the wrong post type archive link matches with a term archive page.
|
136 |
-
|
137 |
-
### Version 0.5.2 ###
|
138 |
-
|
139 |
-
* No friggin' clue. I think I actually skipped version numbers somehow. :)
|
140 |
-
|
141 |
-
### Version 0.5.1 ###
|
142 |
-
|
143 |
-
* Changed license from GPL 2-only to GPL 2+.
|
144 |
-
* Smarter handling of the `trail-begin` and `trail-end` classes.
|
145 |
-
* Added `container` argument for wrapping breadcrumbs in a custom HTML element.
|
146 |
-
* Changed `bbp_get_forum_parent()` to `bbp_get_forum_parent_id()`.
|
147 |
-
|
148 |
-
### Version 0.5.0 ###
|
149 |
-
|
150 |
-
* Use hardcoded strings for the textdomain, not a variable.
|
151 |
-
* Inline doc updates.
|
152 |
-
* Added bbPress support.
|
153 |
-
* Use `single_post_title()` instead of `get_the_title()` for post titles.
|
154 |
-
|
155 |
-
### Version 0.4.1 ###
|
156 |
-
|
157 |
-
* Use `get_queried_object()` and `get_queried_object_id()` instead of accessing `$wp_query` directly.
|
158 |
-
* Pass `$args` as second parameter in `breadcrumb_trail` hook.
|
159 |
-
|
160 |
-
### Version 0.4.0 ###
|
161 |
-
|
162 |
-
* New function: `breadcrumb_trail_get_items()`, which grabs a list of all the trail items. This separates the items from the main `breadcrumb_trail()` function.
|
163 |
-
* New filter hook: `breadcrumb_trail_items`, which allows devs to filter just the items.
|
164 |
-
* New function: `breadcrumb_trail_map_rewrite_tags()`, which maps the permalink structure tags set under Permalink Settings in the admin to make for a much more accurate breadcrumb trail.
|
165 |
-
* New function: `breadcrumb_trail_textdomain()`, which can be filtered when integrating the plugin into a theme to match the theme's textdomain.
|
166 |
-
* Added functionality to handle WP 3.1 post type enhancements.
|
167 |
-
|
168 |
-
### Version 0.3.1 ###
|
169 |
-
|
170 |
-
* Smarter logic in certain areas.
|
171 |
-
* Removed localization for things that shouldn't be localized with time formats.
|
172 |
-
* `single_tax` set to `null` instead of `false`.
|
173 |
-
* Better escaping of element attributes.
|
174 |
-
* Use `$wp_query->get_queried_object()` and `$wp_query->get_queried_object_id()`.
|
175 |
-
* Add in initial support of WordPress 3.1's post type archives.
|
176 |
-
* Better formatting and organization of the output late in the function.
|
177 |
-
* Added `trail-before` and `trail-after` CSS classes if `$before` or `$after` is set.
|
178 |
-
|
179 |
-
### Version 0.3.1 ###
|
180 |
-
|
181 |
-
* Undefined index error fixes.
|
182 |
-
* Fixes for trying to get a property of a non-object.
|
183 |
-
|
184 |
-
### Version 0.3.0 ###
|
185 |
|
186 |
-
* Added more support for custom post types and taxonomies.
|
187 |
-
* Added more support for more complex hierarchies.
|
188 |
-
* The breadcrumb trail now recognizes more patterns with pages as part of the permalink structure of other objects.
|
189 |
-
* All post types can have any taxonomy as the leading part of the trail.
|
190 |
-
* Cleaned up the code.
|
191 |
|
192 |
-
### Version 0.2.1 ###
|
193 |
|
194 |
-
* Removed and/or added (depending on the case) the extra separator item on sub-categories and date-/time-based breadcrumbs.
|
195 |
|
196 |
-
### Version 0.2.0 ###
|
197 |
|
198 |
-
* The title of the "home" page (i.e. posts page) when not the front page is now properly recognized.
|
199 |
-
* Cleaned up the code and logic behind the plugin.
|
200 |
|
201 |
-
### Version 0.1.0 ###
|
202 |
|
203 |
-
* Launch of the new plugin.
|
3 |
Contributors: greenshady
|
4 |
Donate link: http://themehybrid.com/donate
|
5 |
Tags: navigation, menu, breadcrumb, breadcrumbs, microdata, schema
|
6 |
+
Requires at least: 4.2
|
7 |
+
Stable tag: 1.0.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.htm
|
10 |
|
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 |
### Professional support ###
|
31 |
|
32 |
+
If you need professional plugin support from me, the plugin author, you can access the support forums at [Theme Hybrid](http://themehybrid.com), which is a professional WordPress help/support site where I handle support for all my plugins and themes for a community of 60,000+ users (and growing).
|
33 |
|
34 |
== Installation ==
|
35 |
|
61 |
|
62 |
<?php if ( function_exists( 'breadcrumb_trail' ) ) breadcrumb_trail(); ?>
|
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 |
+
add_action( 'after_setup_theme', 'bct_theme_setup' );
|
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 |
|
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/readme.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
|
|
|
|
|
|
|
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
|
|
123 |
|
|
|
124 |
|
|