Yoast Breadcrumbs - Version 0.8.4

Version Description

  • Upgraded Backend class to 0.2.
Download this release

Release Info

Developer joostdevalk
Plugin Icon wp plugin Yoast Breadcrumbs
Version 0.8.4
Comparing to
See all releases

Code changes from version 0.8.3 to 0.8.4

Files changed (3) hide show
  1. readme.txt +4 -1
  2. yoast-breadcrumbs.php +1 -1
  3. yst_plugin_tools.php +24 -11
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://yoast.com/donate/
4
Tags: rss, footer
5
Requires at least: 2.2
6
Tested up to: 2.8.2
7
- stable tag: 0.8.2
8
9
Easily add breadcrumbs to your template!
10
@@ -28,6 +28,9 @@ More info:
28
29
== Changelog ==
30
31
= 0.8.3 =
32
* Upgraded Backend class to 0.1.2.
33
4
Tags: rss, footer
5
Requires at least: 2.2
6
Tested up to: 2.8.2
7
+ stable tag: 0.8.4
8
9
Easily add breadcrumbs to your template!
10
28
29
== Changelog ==
30
31
+ = 0.8.4 =
32
+ * Upgraded Backend class to 0.2.
33
+
34
= 0.8.3 =
35
* Upgraded Backend class to 0.1.2.
36
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.8.3
6
Author: Joost de Valk
7
Author URI: http://yoast.com/
8
2
Plugin Name: Yoast Breadcrumbs
3
Plugin URI: http://yoast.com/wordpress/breadcrumbs/
4
Description: Outputs a fully customizable breadcrumb path.
5
+ Version: 0.8.4
6
Author: Joost de Valk
7
Author URI: http://yoast.com/
8
yst_plugin_tools.php CHANGED
@@ -2,7 +2,7 @@
2
3
/**
4
* Backend Class for use in all Yoast plugins
5
- * Version 0.1.2
6
*/
7
8
if (!class_exists('Yoast_Plugin_Admin')) {
@@ -14,6 +14,7 @@ if (!class_exists('Yoast_Plugin_Admin')) {
14
var $shortname = '';
15
var $ozhicon = '';
16
var $optionname = '';
17
var $accesslvl = 'manage_options';
18
19
function Yoast_Plugin_Admin() {
@@ -115,14 +116,14 @@ if (!class_exists('Yoast_Plugin_Admin')) {
115
function form_table($rows) {
116
$content = '<table class="form-table">';
117
foreach ($rows as $row) {
118
- $content .= '<tr valign="top"><th scrope="row">';
119
if (isset($row['id']) && $row['id'] != '')
120
$content .= '<label for="'.$row['id'].'">'.$row['label'].':</label>';
121
else
122
$content .= $row['label'];
123
if (isset($row['desc']) && $row['desc'] != '')
124
$content .= '<br/><small>'.$row['desc'].'</small>';
125
- $content .= '</th><td>';
126
$content .= $row['content'];
127
$content .= '</td></tr>';
128
}
@@ -136,7 +137,7 @@ if (!class_exists('Yoast_Plugin_Admin')) {
136
function plugin_like() {
137
$content = '<p>'.__('Why not do any or all of the following:','ystplugin').'</p>';
138
$content .= '<ul>';
139
- $content .= '<li>'.__('Link to it so other folks can find out about it.','ystplugin').'</li>';
140
$content .= '<li><a href="http://wordpress.org/extend/plugins/'.$this->hook.'/">'.__('Give it a good rating on WordPress.org.','ystplugin').'</a></li>';
141
$content .= '<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2017947">'.__('Donate a token of your appreciation.','ystplugin').'</a></li>';
142
$content .= '</ul>';
@@ -166,9 +167,9 @@ if (!class_exists('Yoast_Plugin_Admin')) {
166
}
167
$content .= '<li class="rss"><a href="http://yoast.com/feed/">Subscribe with RSS</a></li>';
168
$content .= '<li class="email"><a href="http://yoast.com/email-blog-updates/">Subscribe by email</a></li>';
169
- Yoast_Plugin_Admin::postbox('yoastlatest', 'Latest news from Yoast', $content);
170
} else {
171
- Yoast_Plugin_Admin::postbox('yoastlatest', 'Latest news from Yoast', 'Nothing to say...');
172
}
173
}
174
@@ -182,10 +183,19 @@ if (!class_exists('Yoast_Plugin_Admin')) {
182
}
183
184
function db_widget() {
185
- require_once(ABSPATH.WPINC.'/rss.php');
186
- if ( $rss = fetch_rss( 'http://feeds2.feedburner.com/joostdevalk' ) ) {
187
echo '<div class="rss-widget">';
188
- echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';
189
echo '<ul>';
190
$rss->items = array_slice( $rss->items, 0, 3 );
191
foreach ( (array) $rss->items as $item ) {
@@ -199,14 +209,17 @@ if (!class_exists('Yoast_Plugin_Admin')) {
199
echo '<div style="border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
200
echo '<a href="http://feeds2.feedburner.com/joostdevalk"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
201
echo ' &nbsp; &nbsp; &nbsp; ';
202
- echo '<a href="http://yoast.com/email-blog-updates/"><img src="http://cdn.yoast.com/email_sub.png" alt=""/> Subscribe by email</a>';
203
echo '</div>';
204
echo '</div>';
205
}
206
}
207
208
function widget_setup() {
209
- wp_add_dashboard_widget( 'yoast_db_widget' , 'The Latest news from Yoast' , array(&$this, 'db_widget'));
210
}
211
}
212
}
2
3
/**
4
* Backend Class for use in all Yoast plugins
5
+ * Version 0.2
6
*/
7
8
if (!class_exists('Yoast_Plugin_Admin')) {
14
var $shortname = '';
15
var $ozhicon = '';
16
var $optionname = '';
17
+ var $homepage = '';
18
var $accesslvl = 'manage_options';
19
20
function Yoast_Plugin_Admin() {
116
function form_table($rows) {
117
$content = '<table class="form-table">';
118
foreach ($rows as $row) {
119
+ $content .= '<tr><th valign="top" scrope="row">';
120
if (isset($row['id']) && $row['id'] != '')
121
$content .= '<label for="'.$row['id'].'">'.$row['label'].':</label>';
122
else
123
$content .= $row['label'];
124
if (isset($row['desc']) && $row['desc'] != '')
125
$content .= '<br/><small>'.$row['desc'].'</small>';
126
+ $content .= '</th><td valign="top">';
127
$content .= $row['content'];
128
$content .= '</td></tr>';
129
}
137
function plugin_like() {
138
$content = '<p>'.__('Why not do any or all of the following:','ystplugin').'</p>';
139
$content .= '<ul>';
140
+ $content .= '<li><a href="'.$this->homepage.'">'.__('Link to it so other folks can find out about it.','ystplugin').'</a></li>';
141
$content .= '<li><a href="http://wordpress.org/extend/plugins/'.$this->hook.'/">'.__('Give it a good rating on WordPress.org.','ystplugin').'</a></li>';
142
$content .= '<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2017947">'.__('Donate a token of your appreciation.','ystplugin').'</a></li>';
143
$content .= '</ul>';
167
}
168
$content .= '<li class="rss"><a href="http://yoast.com/feed/">Subscribe with RSS</a></li>';
169
$content .= '<li class="email"><a href="http://yoast.com/email-blog-updates/">Subscribe by email</a></li>';
170
+ $this->postbox('yoastlatest', 'Latest news from Yoast', $content);
171
} else {
172
+ $this->postbox('yoastlatest', 'Latest news from Yoast', 'Nothing to say...');
173
}
174
}
175
183
}
184
185
function db_widget() {
186
+ $options = get_option('yoastdbwidget');
187
+ if (isset($_POST['yoast_removedbwidget'])) {
188
+ $options['removedbwidget'] = true;
189
+ update_option('yoastdbwidget',$options);
190
+ }
191
+ if ($options['removedbwidget']) {
192
+ echo "If you reload, this widget will be gone and never appear again, unless you decide to delete the database option 'yoastdbwidget'.";
193
+ return;
194
+ }
195
+ require_once(ABSPATH.WPINC.'/rss.php');
196
+ if ( $rss = fetch_rss( 'http://yoast.com/feed/' ) ) {
197
echo '<div class="rss-widget">';
198
+ echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img src="http://netdna.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';
199
echo '<ul>';
200
$rss->items = array_slice( $rss->items, 0, 3 );
201
foreach ( (array) $rss->items as $item ) {
209
echo '<div style="border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
210
echo '<a href="http://feeds2.feedburner.com/joostdevalk"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
211
echo ' &nbsp; &nbsp; &nbsp; ';
212
+ echo '<a href="http://yoast.com/email-blog-updates/"><img src="http://netdna.yoast.com/email_sub.png" alt=""/> Subscribe by email</a>';
213
+ echo '<form class="alignright" method="post"><input type="hidden" name="yoast_removedbwidget" value="true"/><input title="Remove this widget from all users dashboards" type="submit" value="X"/></form>';
214
echo '</div>';
215
echo '</div>';
216
}
217
}
218
219
function widget_setup() {
220
+ $options = get_option('yoastdbwidget');
221
+ if (!$options['removedbwidget'])
222
+ wp_add_dashboard_widget( 'yoast_db_widget' , 'The Latest news from Yoast' , array(&$this, 'db_widget'));
223
}
224
}
225
}