Skip to content

Commit

Permalink
support themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcath committed Jun 20, 2018
1 parent 66c52e7 commit 2bbb4f3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/wup-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ public function updateResponseKey(){

public function updateResponse($state){
if($this->type == 'theme'){
return array();
return array(
'new_version' => $state->wupVersion,
'url' => $state->detailsUrl,
'package' => $state->downloadUrl,
'theme' => $this->slug
);
}else{
$update = new StdClass;
$update->slug = $this->slug;
Expand Down Expand Up @@ -120,6 +125,11 @@ public function getLocalPluginVersion(){
return $data['Version'];
}

public function getLocalThemeVersion(){
$theme = wp_get_theme($this->theme);
return $theme->get('Version');
}

public function getWUPData($localVersion){
global $wp_version;

Expand All @@ -143,7 +153,7 @@ public function getWUPData($localVersion){
);

$response = wp_remote_get($this->url, $args);

return json_decode($response['body']);
}
}

0 comments on commit 2bbb4f3

Please sign in to comment.