[wp-trac] [WordPress Trac] #54833: Twenty Eleven: screen_icon() and get_current_theme() are deprecated
WordPress Trac
noreply at wordpress.org
Thu Jun 30 23:02:16 UTC 2022
#54833: Twenty Eleven: screen_icon() and get_current_theme() are deprecated
--------------------------------------+---------------------
Reporter: Presskopp | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.1
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: good-first-bug has-patch | Focuses:
--------------------------------------+---------------------
Changes (by SergeyBiryukov):
* milestone: Awaiting Review => 6.1
Comment:
I think [attachment:"54833.3.diff"] should work here:
* `screen_icon()` is removed, as it was soft-deprecated in [26537] /
#26119 and formally deprecated in [41274] / #41153.
* The `current_theme` option was introduced for WordPress 2.5 in [6334] /
#5346. Since Twenty Eleven requires WordPress 3.2 or later, I think we can
rely on the option being available.
* `wp_get_theme()` is replaced with `wp_get_theme()->get( 'Name' )`. I
thought `wp_get_theme()` returns an object and not the theme name, so I
was confused for a bit here. However, looking at [20039] / #20138, the
`WP_Theme` class has a `__toString()` method, so this should work as
expected. Still, using `::get( 'Name' )` explicitly would avoid the
confusion, and that's what we use in other instances, e.g. in
`get_theme_mods()`, `remove_theme_mods()`, or the deprecated
`get_current_theme()` function.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54833#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list