[wp-trac] [WordPress Trac] #18169: [15491] prevents to plug into the update API

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 19 09:13:49 UTC 2011


#18169: [15491] prevents to plug into the update API
-------------------------------+-----------------------------
 Reporter:  Denis-de-Bernardy  |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Upgrade/Install    |    Version:  3.1
 Severity:  normal             |   Keywords:
-------------------------------+-----------------------------
 I'm a bit late to the party, but I've only noted now that changeset
 [15491] introduced a subtle change to the WP API, which prevents to
 readily plug into the update API:

 Prior to it, the sequence went something like this:

 {{{
 $args = array(...); // set using a filter
 $api = themes_api('query_themes', $args);
 if ( is_wp_error($api) )
     wp_die($api);
 display_themes($api->themes, $api->info['page'], $api->info['pages']);
 }}}

 It now goes like this:


 {{{
 switch ($tab) {
    case ...: // valid case
    $args = array(...); // relevant args
    break;
      $args = false; // this is new. a filter should be present here...
 }
 if (!$args) return; // the 'query_themes' hook is no longer useful
 $api = themes_api('query_themes', $args);
 if ( is_wp_error($api) )
     wp_die($api);
 display_themes($api->themes, $api->info['page'], $api->info['pages']);
 }}}

 I used to use a hook in there to add a tab in the installer. The stab is
 still around, and is as far as I can tell part of it is still working, but
 it no longer seems possible to display the results using the normal API.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18169>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list