thought-afterGeeky stuff by Lafinboy

Oh hai!

thought-after.com is published by Lafinboy, aka Scott Swabey, a self confessed geek, standards compliant web developer, OOP afflicted code monkey, loving father and husband. These are (some of) his thoughts.

Following the upgrade of WordPress to version 3.0 I noticed that there were some errors with the Ad-minister plugin, specifically on the main administration page (tools.php?page=ad-minister).

The page was now displaying an error message:

Catchable fatal error: Object of class WP_Error could not be converted to string in ***/***/***/wpincludes/functions.php
on line 302

The error is due to a change in the way new posts are created in WP3. The fix (until such time as the plugin is updated by the authors) is to replace the following section of code in the administer_queue_scripts function in the ad-minister.php file:

// Create a new one
$_POST['post_title'] = 'Ad-minister Data Holder ' . $nbr;
$_POST['post_type'] = 'administer';
$_POST['content'] = 'This post holds your Ad-minister data';
$id = wp_write_post();
update_option('administer_post_id', $id);

with the new code:

// Create a new one
$adminster_post = array();
$adminster_post['post_title'] = 'Ad-minister Data Holder ' . $nbr;
$adminster_post['post_type'] = 'administer';
$adminster_post['content'] = 'This post holds your Ad-minister data';
$id = wp_insert_post( $adminster_post,true );
update_option('administer_post_id', $id);
This entry was posted by Lafinboy in Wordpress. Bookmark the permalink.

8 Responses to Ad-minister plugin: Catchable fatal error

  1. Paul says:

    Perfect thank you:)

  2. B Marie says:

    Okay, seriously you rock! *high five*

  3. Mongo says:

    thank you, the fix worked great! lifesaver!

  4. Krutik says:

    Thank you so much. thank you..

  5. Awesome help! Worked-Thanks!

  6. Awesome, thank you so much!

Leave a Reply

Your email address will not be published. Required fields are marked *

Browse by Topic

Email Me