WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#22972 new enhancement

Improve parameter name for wp_get_theme()

Reported by: johnbillion Owned by:
Priority: normal Milestone: Awaiting Review
Component: Themes Version: 3.4
Severity: minor Keywords: has-patch
Cc:

Description (last modified by johnbillion)

The name of the first parameter for wp_get_theme() is misleading. It's called $stylesheet when in fact you're passing in the name of the theme's template directory, not the stylesheet.

The function is a wrapper for the WP_Theme class which gets its parameter names correct.

Attachments (1)

22972.patch (1.6 KB) - added by johnbillion 6 months ago.

Download all attachments as: .zip

Change History (4)

comment:1 johnbillion6 months ago

  • Description modified (diff)

johnbillion6 months ago

comment:2 johnbillion6 months ago

  • Keywords has-patch added
  • Severity changed from normal to minor

comment:3 SergeyBiryukov6 months ago

I guess stylesheet is the common notation for theme's directory name throughout the theme-related functions.

That's how it's described in WP_Theme:
http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/class-wp-theme.php#L86

It's also used as a parameter in get_theme_root(), get_theme_root_uri(), get_raw_theme_root(), switch_theme(), and wp_customize_url(), so 22972.patch would make that less consistent.

Note: See TracTickets for help on using tickets.