集成自动更新服务器

This commit is contained in:
文派备案 2025-03-26 15:30:33 +08:00
parent 71e7d64e41
commit 7f12edb6ae
124 changed files with 13116 additions and 2 deletions

View file

@ -0,0 +1,38 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p3;
use stdClass;
if ( !class_exists(Update::class, false) ):
/**
* A simple container class for holding information about an available update.
*
* @author Janis Elsts
* @access public
*/
abstract class Update extends Metadata {
public $slug;
public $version;
public $download_url;
public $translations = array();
/**
* @return string[]
*/
protected function getFieldNames() {
return array('slug', 'version', 'download_url', 'translations');
}
public function toWpFormat() {
$update = new stdClass();
$update->slug = $this->slug;
$update->new_version = $this->version;
$update->package = $this->download_url;
return $update;
}
}
endif;