[wp-hackers] get_post_meta() returning a cached WP_Error?

Mike Schinkel mikeschinkel at newclarity.net
Fri Oct 22 18:26:01 UTC 2010


Wanted to run this by you to see if I'm missing something.

I'm running this code and it is returning an WP_Error that has been cached (I traced through the code with XDEBUG so know that it got the error from the cache):

$menu_item_id = get_post_meta($post_id,'_microsite_page_menu_item_id',true);

Here is the var_dump() of that error:

object(WP_Error)#114 (2) {
  ["errors"]=>
  array(1) {
    ["update_nav_menu_item_failed"]=>
    array(1) {
      [0]=>
      string(47) "The given object ID is not that of a menu item."
    }
  }
  ["error_data"]=>
  array(0) {
  }
}

Should get_post_meta() be returning a cached WP_Error like this?  I'm passing single=true so shouldn't I just be getting an empty string?  Is this a bug for trac, or expected behavior? 

Thanks in advance for considering this.

-Mike


More information about the wp-hackers mailing list