WordPress.org

Make WordPress Core

#21685 closed enhancement (fixed)

Twenty Twelve: Code simplifications (and one tabs > spaces issue)

Reported by: obenland Owned by: lancewillett
Milestone: 3.5 Priority: normal
Severity: minor Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

There are a few opportunities to further streamline the code.

I'll separate my proposals by file, to make it easier to leave changes out that don't find approval.

Attachments (7)

21685-indentation.diff (32.0 KB) - added by obenland 20 months ago.
21685-sidebars.diff (3.0 KB) - added by obenland 20 months ago.
21685-comments.diff (824 bytes) - added by obenland 20 months ago.
21685-customizer.diff (1009 bytes) - added by obenland 20 months ago.
21685-navigation.diff (2.0 KB) - added by obenland 20 months ago.
21685-theme-options.diff (1.0 KB) - added by obenland 20 months ago.
21685.2.diff (696 bytes) - added by DrewAPicture 19 months ago.
condition checked twice

Download all attachments as: .zip

Change History (17)

obenland20 months ago

obenland20 months ago

obenland20 months ago

obenland20 months ago

comment:1 obenland20 months ago

21685-indentation.diff: Makes HTML indentation consistent across all template files. Moves to if-endif syntax in homepage.php for consistency.

21685-sidebars.diff: Consistently calls sidebars with just the ID. Removes unnecessary closing/opening php tags and makes in-code comment consistent with how it is done in other parts of the Theme

21685-comments.diff: Removes unnecessary closing/opening php tags and indentation

21685-customizer.diff: No need to put the selector in a variable as it will be called only once anyway

21685-navigation.diff: Tabs > spaces

21685-theme-options.diff: No need for extra trues and falses, the conditional already returns the desired result. Capability is set to 'edit_theme_options' by default

comment:2 ocean9020 months ago

  • Milestone changed from Awaiting Review to 3.5

comment:3 lancewillett20 months ago

In [21616]:

Twenty Twelve: spaces to tabs in navigation.js, props obenland. See #21685.

comment:4 lancewillett20 months ago

In [21620]:

Twenty Twelve: consistently call sidebar areas with just the ID value, props obenland. See #21685.

comment:5 lancewillett20 months ago

In [21621]:

Twenty Twelve: comments.php, cleanup and better indentation. Props obenland, see #21685.

comment:6 lancewillett20 months ago

In [21623]:

Twenty Twelve: theme-options.php fixes from obenland, see #21685.

  • Capability is already set to 'edit_theme_options' by default
  • Simplify logic for form input validation

comment:7 lancewillett20 months ago

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

I'm going to skip most of the template file indentation fixes -- it's already set up as intended there.

Thanks for all the cleanup, obenland! Great stuff.

comment:8 lancewillett20 months ago

In [21643]:

Twenty Twelve: use sidebar ID string value for sidebar checks instead of hard-coded integer, props nacin. See #21685.

DrewAPicture19 months ago

condition checked twice

comment:9 DrewAPicture19 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

21685.2.diff removes a duplicate/misplaced condition in theme-customizer.js

comment:10 lancewillett19 months ago

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

In [22168]:

Twenty Twelve: remove a duplicate/misplaced condition in theme-customizer.js, props DrewAPicture. Closes #21685.

Note: See TracTickets for help on using tickets.