Advertisement
duskopro

update-plugin.class.php.old

May 9th, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public function update_state( $transient ) {
  2.  
  3. $plugin = $this->plugin;
  4.  
  5. if (isset($plugin) && !empty($plugin) && isset($plugin['version']) && version_compare($plugin['version'], TG_VERSION) > 0) {
  6.  
  7. $API = new TG_Envato_API();
  8.  
  9. $_plugin = array(
  10. 'slug' => dirname($plugin['slug']),
  11. 'new_version' => $plugin['version'],
  12. 'url' => $plugin['url'],
  13. 'package' => $API->deferred_download($plugin['id']),
  14. 'name' => $plugin['name'],
  15. );
  16.  
  17. $transient->response[$plugin['slug']] = (object) $_plugin;
  18.  
  19. } else {
  20.  
  21. if (isset($transient->response['the-grid/the-grid.php'])) {
  22. unset($transient->response['the-grid/the-grid.php']);
  23. }
  24.  
  25. }
  26.  
  27. return $transient;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement