Opened 2 years ago

Closed 2 years ago

#17686 closed defect (bug) (fixed)

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

Reported by: blepoxp Owned by: nacin
Priority: normal Milestone: 3.2
Component: Bundled Theme Version: 3.2
Severity: normal Keywords: has-patch
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 2 years ago.

Download all attachments as: .zip

Change History (9)

  • 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.

comment:2 follow-up: ↓ 4   nacin2 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.

  • Keywords needs-patch removed

comment:4 in reply to: ↑ 2   westi2 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?

  • Component changed from Themes to Bundled Theme
  • Keywords has-patch added

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

  • 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.