me, myself & andrei

24 Jul 2008
Organize Series for WordPress 2.6

My series plugin, that proved great so far, started to fail on me a bit after installing WordPress 2.6, but this evening I found some fixes.

One of the bugs is that the administration menus don’t link correctly any longer.

Open orgSeries.php, and replace the function series_organize_options (line 156) with the following:

// ANDRIE
function series_organize_options() {
	global $wp_version;
	if (function_exists('add_options_page')) {
		if ( isset( $wp_version ) && $wp_version >= 2.5 )
			add_options_page('Organize Series Options', 'Series Options', 9, SERIES_DIR . '/' . 'orgSeries-options-new.php');
		else
			add_options_page('Organize Series Options', 'Series Options', 9, SERIES_DIR . '/' . 'orgSeries-options.php');
	}
	if (function_exists('add_management_page'))
		add_management_page('Organize Series Management', 'Series', 9, SERIES_DIR . '/' . 'orgSeries-manage.php');
}
//END

Then there’s another bug related to WordPress Revisions. If you have them turned off, then things are ok. Otherwise, the plugin starts counting revisions as well as part of the series, which ends up with numbering gone wrong.

Open series-taxonomy.php and replace line 384

$post_ID = (int) $post_ID;

with the following

$post_ID = (int) $post_ID;
// ANDRIE
$post = get_post($post_ID);
if ($post->post_type == 'revision'){
return;
}
//END

This fix doesn’t take care of the previous revisions though, that are already marked as part of the series. There is a fix for that as well, but that will be in an update to this post later this week ,)


Andrei