WP_CLI
WpOrgApi::get_theme_info()
Gets a theme's info.
Method of the class: WpOrgApi{}
No Hooks.
Return
Array|false
. False on failure. Associative array of the offer on success.
Usage
$WpOrgApi = new WpOrgApi(); $WpOrgApi->get_theme_info( $theme, $locale );
- $theme(string) (required)
- Theme slug to query.
- $locale(string)
- Locale to request info for.
Default: 'en_US'
WpOrgApi::get_theme_info() WpOrgApi::get theme info code WP-CLI 2.8.0-alpha
public function get_theme_info( $theme, $locale = 'en_US' ) { $action = 'theme_information'; $request = [ 'locale' => $locale, 'slug' => $theme, ]; $url = sprintf( '%s?%s', self::THEME_INFO_ENDPOINT, http_build_query( compact( 'action', 'request' ), null, '&' ) ); $response = $this->json_get_request( $url ); if ( ! is_array( $response ) ) { return false; } return $response; }