Make WordPress Core

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#11611 closed enhancement (fixed)

Allow pluggable arg checking in current_theme_supports

Reported by: hakre's profile hakre Owned by: ryan's profile ryan
Milestone: 3.4 Priority: normal
Severity: normal Version: 2.9
Component: Themes Keywords: has-patch 3.2-early
Focuses: Cc:

Description

There is an @todo task left in the file wp-includes/theme.php inside the current_theme_supports function. The original author should decide wether or not he wants to implement the noted feature or to just drop it.

From other code I've seen today, it's commong to check $args[0] for being an array and if so to set $args =& $arg[0];

Attachments (3)

11611.diff (730 bytes) - added by dd32 14 years ago.
11611.2.diff (601 bytes) - added by ryan 12 years ago.
Per duck_'s comment
11611-unit.diff (1.0 KB) - added by ryan 12 years ago.
Unit tests

Download all attachments as: .zip

Change History (15)

@dd32
14 years ago

#1 follow-up: @dd32
14 years ago

  • Keywords dev-feedback has-patch added; developer-feedback removed

attachment 11611.diff added

  • My Take of how the pluggable support should be done.

#2 in reply to: ↑ 1 @hakre
14 years ago

Replying to dd32:

attachment 11611.diff added

  • My Take of how the pluggable support should be done.

I've read it in another way then. Can you just share two or three words what your patch is doing / should provide? I have problems to understand it.

#3 @hakre
14 years ago

The @todo tag was introduced in [12350] by ryan based on it's own (untested marked) code in #11364. Maybe ryan should explain the @todo tag.

#4 @dd32
14 years ago

I've read it in another way then. Can you just share two or three words what your patch is doing / should provide? I have problems to understand it.

My understanding was, That for any features which accepts an array, There needed to be a filter to allow for plugins to take care of the array-based checking - As core only knows about how to handle the post-thumbnail array, Other features arrays may contain different data.

#5 @nacin
14 years ago

  • Milestone changed from 3.0 to 3.1
  • Type changed from defect (bug) to enhancement

Patch looks okay to me.

There are other issues in the theme support API we're not going to get to in 3.0, such as a more robust remove_theme_support() (#12739) that can handle multiple arguments. Moving to 3.1 for now.

#6 @nacin
14 years ago

  • Keywords dev-feedback removed

#7 @nacin
14 years ago

  • Milestone changed from Awaiting Triage to 3.1

#8 @jane
14 years ago

  • Keywords 3.2-early added
  • Milestone changed from 3.1 to Future Release

Missed the boat, entering beta. 3.2-early.

#9 @duck_
13 years ago

  • Keywords changed from has-patch, 3.2-early to has-patch 3.2-early

Pretty much how I was writing the patch before I double checked for an existing ticket.

However, I think moving the return apply_filters out of the switch statement would be better for readability. Having it as the default case makes the final return true; dead code and weird.

Version 0, edited 13 years ago by duck_ (next)

@ryan
12 years ago

Per duck_'s comment

@ryan
12 years ago

Unit tests

#10 @ryan
12 years ago

  • Milestone changed from Future Release to 3.4

#11 @ryan
12 years ago

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

In [19682]:

Allow pluggable arg checking in current_theme_supports. Props dd32. fixes #11611

Note: See TracTickets for help on using tickets.