[wp-trac] [WordPress Trac] #16651: Warnings on dashboard: Notice: Trying to get property of non-object in wp-includes/capabilities.php

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 1 08:47:28 UTC 2012


#16651: Warnings on dashboard: Notice: Trying to get property of non-object in wp-
includes/capabilities.php
------------------------------+-----------------------
 Reporter:  grandslambert     |       Owner:
     Type:  defect (bug)      |      Status:  reopened
 Priority:  normal            |   Milestone:
Component:  Warnings/Notices  |     Version:  3.0
 Severity:  normal            |  Resolution:
 Keywords:                    |
------------------------------+-----------------------

Comment (by frumph):

 Is it possible to do a check under the call for get_post_type_object,
 since it returns null we can gather that it must have existed at some
 point in time and then refer to using say 'post' as a fallback for the
 meta_cap ? -- probably could be done cleaner in the function
 get_post_type_object()

 `if (is_null($post_type_object)) $post_type_object = get_post_type_object(
 'post' );`

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16651#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list