Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#17686 closed defect (bug) (fixed)

Twenty Eleven's Width changes after first log in to new install

Reported by: blepoxp's profile blepoxp Owned by: nacin's profile nacin
Milestone: 3.2 Priority: normal
Severity: normal Version: 3.2
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

Just installed trunk and noticed that the Twenty Eleven theme's width jumped up by several hundred pixels after first log in attempt. I don't have time to track it down in the PHP right now but firebug tells me the following:

After a fresh install, before I log in, the HTML source of the home page looks like this on the body element:

<body class="home blog one-column ">

After logging in and then logging back out and returning to the home page it looks like this:

<body class="home blog two-column content-sidebar">

Attachments (1)

17686.diff (635 bytes) - added by dcowgill 13 years ago.

Download all attachments as: .zip

Change History (9)

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.2

So the issue is that the option is instantiated on admin_init.

Solution: twentyeleven_get_theme_options() should return twentyeleven_get_default_theme_options() if for some reason the option === false. Then on admin we'll properly instantiate it.

#2 follow-up: @nacin
13 years ago

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

In [18141]:

Sanity check in twentyeleven_get_theme_options() -- if the option doesn't exist, return the default options instead. We already instantiate the option on admin_init. fixes #17686.

#3 @blepoxp
13 years ago

  • Keywords needs-patch removed

#4 in reply to: ↑ 2 @westi
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to nacin:

In [18141]:

Sanity check in twentyeleven_get_theme_options() -- if the option doesn't exist, return the default options instead. We already instantiate the option on admin_init. fixes #17686.

Why not use the built-in default support of get_option instead of reimplementing it?

#5 @westi
13 years ago

  • Component changed from Themes to Bundled Theme

@dcowgill
13 years ago

#6 @dcowgill
13 years ago

  • Keywords has-patch added

#7 @nacin
13 years ago

Thanks westi. I usually block that feature from memory as it's better to ensure options are autoloaded.

#8 @nacin
13 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In [18152]:

Use default argument for get_option(). props dcowgill, westi. fixes #17686.

Note: See TracTickets for help on using tickets.