Making WordPress.org


Ignore:
Timestamp:
01/30/2018 03:18:52 AM (9 years ago)
Author:
dd32
Message:

Theme Directory: API: Move the Themes_API class into the plugin, making api.wordpress.org/themes/info/ a wrapper for it.

See #1630

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r6419 r6462  
    118118         * @return string|void
    119119         */
    120         public function get_result() {
    121                 if ( defined( 'JSON_RESPONSE' ) && JSON_RESPONSE ) {
     120        public function get_result( $format = 'raw' ) {
     121                if ( 'json' === $format ) {
    122122                        return wp_json_encode( $this->response );
    123                 } else {
     123                } elseif ( 'php' === $format ) {
    124124                        return serialize( $this->response );
     125                } else { // 'raw' === $format, or anything else.
     126                        return $this->response;
    125127                }
    126128        }
Note: See TracChangeset for help on using the changeset viewer.