« Back to blog

Random Quotes Bug Fix

I've been using the Random Quotes plugin by Dustin Barnes since before WordPress 2.0 and it has worked quite well for me. Adding, editing, and managing those quotes in the Wits Bits section of my front page has been quite easy. However, when WordPress 2.1 came out, that's when I noticed something that shouldn't happen. You see, exporting posts, comments, etc. from WordPress has been integrated in version 2.1, but I never noticed it until I turned off the Random Quotes plugin. And this was in WordPress 2.2 already. I re-downloaded the latest version of Random Quotes and re-installed it but it still gave me the same problem. Well, actually, there was no problem with managing quotes, whatsoever. It's just that when the plugin is turned on, the Export feature of WordPress is hidden, or as I would say, stomped out into oblivion, and that the Random Quotes management page took over its place. Not that I mind because I rarely export my blog anyway. Its just that my OCD kicked in and I knew I have to do something about it. So I checked the plugin code, and after a few minutes of tinkering, finally found something that may be the culprit. The way the plugin tells WordPress to place the plugin's management page is somewhat different. So I tried finding a way to fix it so that the way the plugin tells WordPress how to display the management page would be acceptable to WordPress. The Bug:
function wp_quotes_admin_menu($content) { global $submenu; $submenu['edit.php'][40] = array(__('Quotes'), 10, 'edit-quotes.php'); } add_action('admin_menu', 'wp_quotes_admin_menu');
The Fix:
function wp_quotes_admin_menu() { // Add a new menu under Manage: add_management_page('Quotes', 'Quotes', 10, 'edit-quotes.php'); } add_action('admin_menu', 'wp_quotes_admin_menu');
That should do the trick. It now displays alongside Export, and other plugins' management page. Just make sure you do have the file edit-quotes.php in the wp-admin folder. I already suggested this to the plugin author by leaving a comment in his site, but I noticed that his latest post was last July. So I decided to put this out in the open just in case people are getting the same issue. Just a note of disclaimer: I haven't tested this on a new install of the plugin, so I suggest you backup everything first before trying this fix. Happy Hunting!

by

| Viewed
times | Favorited 0 times
Filed under:              

1 Comment

Jan 23, 2008
Random Quotes Plugin Update « Gormful said...
[...] Random Quotes plugin. I have been using it for quite some time now, as mentioned previously in an older post. It still quite works for me. The bug previously resolved was the placement of the plugin’s [...]

Leave a comment...