Fixing Now-Reading’s Admin Menu

I like using Now-Reading to track what books I’m cur­rently read­ing, have read and want to read on my web­site. Unfor­tu­nately the plugin’s author has been too busy of late to update the plu­gin and one of the recent updates to Word­Press caused Now-Reading’s admin menu to break (when using the sin­gle menu option). PHP is not a pro­gram­ming lan­guage that I’m really famil­iar with but I did some pok­ing around in Now-Reading’s code and found if I changed this snip of code:

	if ( $options['menuLayout'] == NR_MENU_SINGLE ) {

		add_menu_page('Now Reading', 'Now Reading', 9, 'admin.php?page=add_book', 'now_reading_add');

		add_submenu_page('admin.php?page=add_book', 'Add a Book', 'Add a Book',$nr_level , 'add_book', 'now_reading_add');

		add_submenu_page('admin.php?page=add_book', 'Manage Books', 'Manage Books', $nr_level, 'manage_books', 'nr_manage');

		add_submenu_page('admin.php?page=add_book', 'Options', 'Options', 9, 'nr_options', 'nr_options');

To read like this:

	if ( $options['menuLayout'] == NR_MENU_SINGLE ) {

		add_menu_page('Now Reading', 'Now Reading', 9, 'add_book', 'now_reading_add');

		add_submenu_page('add_book', 'Add a Book', 'Add a Book',$nr_level , 'add_book', 'now_reading_add');
		add_submenu_page('add_book', 'Manage Books', 'Manage Books', $nr_level, 'manage_books', 'nr_manage');
		add_submenu_page('add_book', 'Options', 'Options', 9, 'nr_options', 'nr_options');

Then Now-Reading’s sin­gle admin menu worked prop­erly again.

Share and Enjoy:
  • del.icio.us
  • Digg
  • StumbleUpon
  • Twitter
  • Reddit
  • Google Bookmarks
  • Facebook
  • MySpace
  • Yahoo! Buzz
  • Print

Similar Posts

About Mark McKibben

Mark is a data analyst for [REDACTED], currently residing in the Midwest. CoffeeBear is a place for him to spout off about whatever catches his fancy. In his spare time, Mark does a bit of webdev & design. To stalk him more effectively, try following him on Twitter.

One Comment

  1. Mark says:
    August 26th, 2009 at 9:40 am

    While this fix works to restore the func­tion­al­ity of the admin menu to Rob Miller’s Now Read­ing plu­gin; the plu­gin broke a week later due to changes at Ama­zon. Not want­ing to give up my now-reading/library; I’ve switched to using Now Read­ing Reloaded.

    It’s basi­cally the same plu­gin but under active devel­op­ment by another per­son who has more time to work on it.

Leave a Reply

This work by Mark McKibben is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.