[wp-trac] [WordPress Trac] #20103: Rewrite get_themes() and other enemies of sanity

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 4 13:08:58 UTC 2012


#20103: Rewrite get_themes() and other enemies of sanity
--------------------------+------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.4
Component:  Themes        |     Version:  1.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by nacin):

 get_theme_updates() could use some work. I don't like how it assigns a
 property directly to WP_Theme — WP_Theme has no public properties, only
 read-only back compat ones.

 It should instead wrap `wp_get_themes( array( 'updates' => true ) )`.
 WP_Theme should set up an update property to automatically pull from the
 site transient. We can cache the site transient value as a static variable
 in WP_Theme->update(), to prevent calling get_site_transient() over and
 over.

 The structure ends up being backwards compatible so we could easily
 continue to use get_theme_updates() rather than wp_get_themes(), but since
 method access will be preferred to property access, we should probably
 switch to wp_get_themes().

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20103#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list