'iografica',
);
// Make request and extract plug-in object
$response = wp_remote_post(
'http://api.wordpress.org/themes/info/1.0/',
array(
'body' => array(
'action' => 'query_themes',
'request' => serialize((object)$args)
)
)
);
if ( !is_wp_error($response) ) {
$returned_object = unserialize(wp_remote_retrieve_body($response));
$theme = $returned_object->themes;
if ( !is_object($theme) && !is_array($theme) ) {
// Response body does not contain an object/array
echo esc_html__('An error has occurred', 'boxed-wp');
}
else {
// Display a list of the plug-ins and the number of downloads
if ( $theme ) {
foreach ( $theme as $theme ) { ?>