Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#20556 closed defect (bug) (fixed)

Always include post-thumbnail-template and deprecate require_if_theme_supports()

Reported by: nacin Owned by: nacin
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: Post Thumbnails Keywords: 2nd-opinion
Focuses: Cc:


require_if_theme_supports() was a nice idea at the time, but we've never found reason to leverage it. Let's remove it, and always include post-thumbnail-template.php.

As it is, some of these functions are useful when post thumbnails are not supported by the theme. (get_post_thumbnail_id(), for example). The whole file with these functions is under 100 lines.

Always including this file has the benefit of avoiding a sysopen call. opcode caching FTW. see #17112.

No plugins use require_if_theme_supports().

Attachments (1)

20556.diff (1.4 KB) - added by jkudish 4 years ago.
un-deprecate require_if_theme_supports function

Download all attachments as: .zip

Change History (6)

#1 @nacin
4 years ago

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

In [20610]:

Deprecate require_if_theme_supports(). Always require post-thumbnail-template.php. fixes #20556. fixes #20409.

#2 @scribu
4 years ago

  • Keywords 2nd-opinion added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Wait, plugins might not use require_if_theme_supports(), but themes do.

It's useful if you allow child themes to disable certain features.

#3 @nacin
4 years ago

I had searched themes.svn, but not very well. Looks like a few themes use it: https://www.google.com/search?q=require_if_theme_supports+site%3Athemes.svn.wordpress.org.

Happy with keeping it in theme.php.

4 years ago

un-deprecate require_if_theme_supports function

#4 @jkudish
4 years ago

  • Cc joachim.kudish@… added

#5 @nacin
4 years ago

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

In [20642]:

Undeprecate require_if_theme_supports() for themes using it for legitimate reasons. see [20610]. props scribu, jkudish. fixes #20556.

Note: See TracTickets for help on using tickets.