Make WordPress Core


Ignore:
Timestamp:
12/16/2014 10:38:52 PM (11 years ago)
Author:
ocean90
Message:

Pass locale to wordpress.org theme/plugin API.

In the future this will be used to return localized plugin/theme info.

see #30735.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r30697 r30944  
    315315 * @return mixed
    316316 */
    317     function themes_api( $action, $args = null ) {
    318 
    319     if ( is_array($args) )
    320         $args = (object)$args;
    321 
    322     if ( !isset($args->per_page) )
     317function themes_api( $action, $args = null ) {
     318
     319    if ( is_array( $args ) ) {
     320        $args = (object) $args;
     321    }
     322
     323    if ( ! isset( $args->per_page ) ) {
    323324        $args->per_page = 24;
     325    }
     326
     327    if ( ! isset( $args->locale ) ) {
     328        $args->locale = get_locale();
     329    }
     330
    324331    /**
    325332     * Filter arguments used to query for installer pages from the WordPress.org Themes API.
     
    332339     * @param string $action Requested action. Likely values are 'theme_information',
    333340     *                       'feature_list', or 'query_themes'.
    334     */
     341     */
    335342    $args = apply_filters( 'themes_api_args', $args, $action );
    336343
Note: See TracChangeset for help on using the changeset viewer.