WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/01/2018 05:18:54 AM (3 years ago)
Author:
dd32
Message:

Themes: Use api.wordpress.org/themes/info/1.2/ to query theme information.

See #43192.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r42615 r42632  
    56205620            $wporg_args = array(
    56215621                'per_page' => 100,
    5622                 'fields'   => array(
    5623                     'screenshot_url' => true,
    5624                     'description'    => true,
    5625                     'rating'         => true,
    5626                     'downloaded'     => true,
    5627                     'downloadlink'   => true,
    5628                     'last_updated'   => true,
    5629                     'homepage'       => true,
    5630                     'num_ratings'    => true,
    5631                     'tags'           => true,
    5632                     'parent'         => true,
    5633                     // 'extended_author' => true, @todo: WordPress.org throws a 500 server error when this is here.
    5634                 ),
    56355622            );
    56365623
     
    56755662
    56765663                $theme->name        = wp_kses( $theme->name, $themes_allowedtags );
    5677                 $theme->author      = wp_kses( $theme->author, $themes_allowedtags );
    56785664                $theme->version     = wp_kses( $theme->version, $themes_allowedtags );
    56795665                $theme->description = wp_kses( $theme->description, $themes_allowedtags );
    5680                 $theme->tags        = implode( ', ', $theme->tags );
    56815666                $theme->stars       = wp_star_rating(
    56825667                    array(
     
    57035688                $theme->id           = $theme->slug;
    57045689                $theme->screenshot   = array( $theme->screenshot_url );
    5705                 $theme->authorAndUri = $theme->author;
    5706                 // The .org API can return the full parent theme details if passed the 'parent' arg, or if passed the 'template' option it'll return that in the event it's a child theme.
     5690                $theme->authorAndUri = wp_kses( $theme->author['display_name'], $themes_allowedtags );
     5691
    57075692                if ( isset( $theme->parent ) ) {
    57085693                    $theme->parent = $theme->parent['slug'];
Note: See TracChangeset for help on using the changeset viewer.