Changeset 6462 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 01/30/2018 03:18:52 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r6419 r6462 788 788 789 789 /** 790 * Makes a query against api.wordpress.org/themes/info/1.0/ without making a HTTP call 791 * Switches to the appropriate blog for the query. 792 */ 793 function wporg_themes_query_api( $method, $args = array() ) { 790 * Make a query against the api.wordpress.org/themes/info/ API 791 * This function can be used to access the API without making an external HTTP call. 792 * 793 * NOTE: The API also calls this function. 794 * 795 * @param $method string The Method being called. Valid values: 'query_themes', 'theme_information', 'hot_tags', 'feature_list', and 'get_commercial_shops' 796 * @param $args array The arguements for the call. 797 * @param $format string The format to return the data in. Valid values: 'json', 'php', 'raw' (default) 798 */ 799 function wporg_themes_query_api( $method, $args = array(), $format = 'raw' ) { 794 800 if ( ! class_exists( 'Themes_API' ) ) { 795 if ( file_exists( __DIR__ . '/class-themes-api.php' ) ) { 796 include_once __DIR__ . '/class-themes-api.php'; 797 } else { 798 include_once API_WPORGPATH . 'themes/info/1.0/class-themes-api.php'; 799 } 801 include_once __DIR__ . '/class-themes-api.php'; 800 802 } 801 803 802 804 $api = new Themes_API( $method, $args ); 803 805 804 return $api-> response;806 return $api->get_result( $format ); 805 807 } 806 808
Note: See TracChangeset
for help on using the changeset viewer.