Version Description
Download this release
Release Info
Developer | joostdevalk |
Plugin | Yoast Breadcrumbs |
Version | 0.7 |
Comparing to | |
See all releases |
Code changes from version 0.6.3 to 0.7
- readme.txt +2 -2
- yoast-breadcrumbs.php +20 -5
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: joostdevalk
|
|
3 |
Donate link: http://yoast.com/donate/
|
4 |
Tags: rss, footer
|
5 |
Requires at least: 2.2
|
6 |
-
Tested up to: 2.
|
7 |
-
stable tag: 0.
|
8 |
|
9 |
Easily add breadcrumbs to your template!
|
10 |
|
3 |
Donate link: http://yoast.com/donate/
|
4 |
Tags: rss, footer
|
5 |
Requires at least: 2.2
|
6 |
+
Tested up to: 2.7
|
7 |
+
stable tag: 0.7
|
8 |
|
9 |
Easily add breadcrumbs to your template!
|
10 |
|
yoast-breadcrumbs.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Plugin Name: Yoast Breadcrumbs
|
3 |
Plugin URI: http://yoast.com/wordpress/breadcrumbs/
|
4 |
Description: Outputs a fully customizable breadcrumb path.
|
5 |
-
Version: 0.6.
|
6 |
Author: Joost de Valk
|
7 |
Author URI: http://yoast.com/
|
8 |
|
@@ -19,6 +19,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
19 |
// Load some defaults
|
20 |
$opt = array();
|
21 |
$opt['home'] = "Home";
|
|
|
22 |
$opt['sep'] = "»";
|
23 |
$opt['prefix'] = "You are here:";
|
24 |
$opt['boldlast'] = true;
|
@@ -45,7 +46,7 @@ if ( ! class_exists( 'YoastBreadcrumbs_Admin' ) ) {
|
|
45 |
if (!current_user_can('manage_options')) die(__('You cannot edit the Yoast Breadcrumbs options.'));
|
46 |
check_admin_referer('yoast-breadcrumbs-updatesettings');
|
47 |
|
48 |
-
foreach (array('home', 'sep', 'singleparent', 'prefix', 'archiveprefix', 'searchprefix', 'breadcrumbprefix', 'breadcrumbsuffix') as $option_name) {
|
49 |
if (isset($_POST[$option_name])) {
|
50 |
$opt[$option_name] = htmlentities(html_entity_decode($_POST[$option_name]));
|
51 |
}
|
@@ -77,6 +78,10 @@ if ( ! class_exists( 'YoastBreadcrumbs_Admin' ) ) {
|
|
77 |
<th scope="row" valign="top"><label for="home">Anchor text for the Homepage:</label></th>
|
78 |
<td><input type="text" name="home" id="home" value="<?php echo $opt['home']; ?>"/></td>
|
79 |
</tr>
|
|
|
|
|
|
|
|
|
80 |
<tr>
|
81 |
<th scope="row" valign="top"><label for="prefix">Prefix for the breadcrumb path:</label></th>
|
82 |
<td><input type="text" name="prefix" id="prefix" value="<?php echo $opt['prefix']; ?>"/></td>
|
@@ -152,12 +157,22 @@ function yoast_breadcrumb($prefix = '', $suffix = '', $display = true) {
|
|
152 |
$nofollow = ' rel="nofollow" ';
|
153 |
}
|
154 |
|
155 |
-
$
|
156 |
|
157 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
$output = bold_or_not($opt['home']);
|
|
|
|
|
159 |
} elseif ( !is_page() ) {
|
160 |
-
$output = $
|
161 |
if ( ( is_single() || is_category() || is_tag() || is_date() || is_author() ) && $opt['singleparent'] != 0) {
|
162 |
$output .= '<a href="'.get_permalink($opt['singleparent']).'">'.get_the_title($opt['singleparent']).'</a> '.$opt['sep'].' ';
|
163 |
}
|
2 |
Plugin Name: Yoast Breadcrumbs
|
3 |
Plugin URI: http://yoast.com/wordpress/breadcrumbs/
|
4 |
Description: Outputs a fully customizable breadcrumb path.
|
5 |
+
Version: 0.6.4
|
6 |
Author: Joost de Valk
|
7 |
Author URI: http://yoast.com/
|
8 |
|
19 |
// Load some defaults
|
20 |
$opt = array();
|
21 |
$opt['home'] = "Home";
|
22 |
+
$opt['blog'] = "Blog";
|
23 |
$opt['sep'] = "»";
|
24 |
$opt['prefix'] = "You are here:";
|
25 |
$opt['boldlast'] = true;
|
46 |
if (!current_user_can('manage_options')) die(__('You cannot edit the Yoast Breadcrumbs options.'));
|
47 |
check_admin_referer('yoast-breadcrumbs-updatesettings');
|
48 |
|
49 |
+
foreach (array('home', 'blog', 'sep', 'singleparent', 'prefix', 'archiveprefix', 'searchprefix', 'breadcrumbprefix', 'breadcrumbsuffix') as $option_name) {
|
50 |
if (isset($_POST[$option_name])) {
|
51 |
$opt[$option_name] = htmlentities(html_entity_decode($_POST[$option_name]));
|
52 |
}
|
78 |
<th scope="row" valign="top"><label for="home">Anchor text for the Homepage:</label></th>
|
79 |
<td><input type="text" name="home" id="home" value="<?php echo $opt['home']; ?>"/></td>
|
80 |
</tr>
|
81 |
+
<tr>
|
82 |
+
<th scope="row" valign="top"><label for="blog">Anchor text for the Blog:</label></th>
|
83 |
+
<td><input type="text" name="blog" id="blog" value="<?php echo $opt['blog']; ?>"/></td>
|
84 |
+
</tr>
|
85 |
<tr>
|
86 |
<th scope="row" valign="top"><label for="prefix">Prefix for the breadcrumb path:</label></th>
|
87 |
<td><input type="text" name="prefix" id="prefix" value="<?php echo $opt['prefix']; ?>"/></td>
|
157 |
$nofollow = ' rel="nofollow" ';
|
158 |
}
|
159 |
|
160 |
+
$on_front = get_option('show_on_front');
|
161 |
|
162 |
+
if ($on_front == "page") {
|
163 |
+
$homelink = '<a'.$nofollow.'href="'.get_permalink(get_option('page_on_front')).'">'.$opt['home'].'</a>';
|
164 |
+
$bloglink = $homelink.' '.$opt['sep'].' <a href="'.get_permalink(get_option('page_for_posts')).'">'.$opt['blog'].'</a>';
|
165 |
+
} else {
|
166 |
+
$homelink = '<a'.$nofollow.'href="'.get_bloginfo('url').'">'.$opt['home'].'</a>';
|
167 |
+
$bloglink = $homelink;
|
168 |
+
}
|
169 |
+
|
170 |
+
if ( ($on_front == "page" && is_front_page()) || ($on_front == "posts" && is_home()) ) {
|
171 |
$output = bold_or_not($opt['home']);
|
172 |
+
} elseif ( $on_front == "page" && is_home() ) {
|
173 |
+
$output = $homelink.' '.$opt['sep'].' '.bold_or_not($opt['blog']);
|
174 |
} elseif ( !is_page() ) {
|
175 |
+
$output = $bloglink.' '.$opt['sep'].' ';
|
176 |
if ( ( is_single() || is_category() || is_tag() || is_date() || is_author() ) && $opt['singleparent'] != 0) {
|
177 |
$output .= '<a href="'.get_permalink($opt['singleparent']).'">'.get_the_title($opt['singleparent']).'</a> '.$opt['sep'].' ';
|
178 |
}
|