[wp-trac] [WordPress Trac] #17677: Notice: Trying to get property of non-object in /wp-admin/includes/template.php on line 1856

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 4 00:04:32 UTC 2011


#17677: Notice: Trying to get property of non-object in /wp-
admin/includes/template.php on line 1856
-------------------------------------+---------------------
 Reporter:  greuben                  |       Owner:  ryan
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  3.2
Component:  Themes                   |     Version:
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch twenty-eleven  |
-------------------------------------+---------------------

Comment (by greuben):

 > add_menu_page() and friends does not return false in this case. Can
 anyone think of a reason why?
 Maybe because top level menus should always exist to show low cap level
 menus if any.
 {{{
 add_action( 'admin_menu', function(){
         add_menu_page( 'test', 'test', 'manage_options', 'test',
 '__return_false' );
         add_submenu_page( 'test', 'test-2', 'test-2', 'read', 'test2',
 '__return_false' );
 } );
 }}}

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


More information about the wp-trac mailing list