WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#20364 closed defect (bug) (duplicate)

Can't access the dashboard if your current template/stylesheet options are invalid

Reported by: westi Owned by: nacin
Milestone: Priority: high
Severity: major Version: 3.4
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

If your current template/stylesheet options are invalid - for example they point at a theme that has been deleted then you get the expected WSOD on the front-end so in desperation you go to login in to /wp-admin/ only to find that shows a WSOD too :(

Pre WP_Theme this worked a treat.

The issue is wp_dashboard_right_now() which has this code:

	$theme = wp_get_theme();

	echo "\n\t<p>";

	if ( $theme->errors() ) {

wp_get_theme() can return false.

Broken by [20029] - current_theme_info always returned a stdClass whatever the validity of the current theme by wp_get_theme() doesn't.

Attached patch is one possible fix.

Attachments (1)

20364.diff (524 bytes) - added by westi 2 years ago.
Simple fix to check for false as well as errors

Download all attachments as: .zip

Change History (3)

comment:1 follow-up: dd322 years ago

westi2 years ago

Simple fix to check for false as well as errors

comment:2 in reply to: ↑ 1 westi2 years ago

  • Milestone 3.4 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Replying to dd32:

#20361 / [20363] ?

Cool, I missed that.

Closing this as a dupe.

Note: See TracTickets for help on using tickets.