WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14381 closed defect (bug) (fixed)

WordPress doesn't report the currently active theme

Reported by: josephscott Owned by:
Milestone: 3.0.1 Priority: normal
Severity: normal Version: 3.0
Component: General Keywords: has-patch
Focuses: Cc:

Description

In rev [11714] WordPress stopped reporting the currently active theme to api.wordpress.org - see ticket #10220 for more history.

I've created a small patch to fix this, while I was in there I renamed the field 'active_theme' instead of 'template' to be more descriptive.

Attachments (4)

wp-includes--update.php.diff (854 bytes) - added by josephscott 4 years ago.
14381.diff (3.4 KB) - added by ryan 4 years ago.
14381.2.diff (3.7 KB) - added by ryan 4 years ago.
Send more theme fields to api. Blacklist unneeded fields.
14381.3.diff (3.7 KB) - added by josephscott 4 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 ryan4 years ago

Should it use 'stylesheet' instead of 'template'?

comment:2 westi4 years ago

The whole naming convention in this function is a little sucky it seems.

I guess we should clear some of that up too.

comment:3 westi4 years ago

$current_theme->active_stylesheet = get_option( 'stylesheet' );
Should probably add so we get parent and child theme

comment:4 ryan4 years ago

Does api.wordpress.org need any fields other than Name and Version. It seems we are sending a lot of useless data.

comment:5 ryan4 years ago

Also, current_theme is being filled with the previous update response and then stuck into the request. Seems current_theme when sent in the request should not have checked and response fields.

ryan4 years ago

comment:6 ryan4 years ago

That cleans things up a bit. $current_theme is gone. Instead the current theme slug is assigned to the 'current_theme' key of the themes array. This gets rid of all of the local cache junk that was being sent to api under the current_theme key. The themes array is populated with only the Name and Version for each theme. That's all I see being used api side. The last cached update and the new update are in better named $last_update and $new_update variables.

ryan4 years ago

Send more theme fields to api. Blacklist unneeded fields.

comment:7 ryan4 years ago

It seems we need to send more than just version, name, and slug to help with disambiguation. Updated patch to blacklist certain fields and let the rest through.

josephscott4 years ago

comment:8 josephscott4 years ago

I don't think we need Description, Tags or Screenshot fields either.

comment:9 ryan4 years ago

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

(In [15455]) Clean up wp_update_themes(). Fix reporting of active theme. Props josephscott. fixes #14381 for 3.1

comment:10 ryan4 years ago

(In [15456]) Clean up wp_update_themes(). Fix reporting of active theme. Props josephscott. fixes #14381 for 3.0.1

Note: See TracTickets for help on using tickets.