Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17677 closed defect (bug) (fixed)

Notice: Trying to get property of non-object in /wp-admin/includes/template.php on line 1856

Reported by: greuben's profile greuben Owned by: ryan's profile ryan
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch twenty-eleven
Focuses: Cc:

Description

Login as an author to reproduce

Attachments (1)

2011.diff (961 bytes) - added by greuben 13 years ago.

Download all attachments as: .zip

Change History (7)

@greuben
13 years ago

#1 @ryan
13 years ago

  • Milestone changed from Awaiting Review to 3.2

#2 @ryan
13 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [18135]:

Check result of add_theme_page(). Return if false. Props greuben. fixes #17677

#3 @ryan
13 years ago

Did it a bit differently just in case we add anything else to that function.

#4 @nacin
13 years ago

In [18136]:

Document that add_submenu_page() might return false if ! current_user_can(). see #17677.

#5 follow-up: @nacin
13 years ago

add_menu_page() and friends does not return false in this case. Can anyone think of a reason why?

#6 in reply to: ↑ 5 @greuben
13 years ago

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' );
} );
Note: See TracTickets for help on using tickets.