\PluginUpdate

A simple container class for holding information about an available update.

Summary

Methods
Properties
Constants
fromJson()
fromPluginInfo()
fromObject()
toStdClass()
toWpFormat()
$id
$slug
$version
$homepage
$download_url
$upgrade_notice
$icons
$filename
$tested
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$fields
N/A

Properties

$id

$id : 

Type

$slug

$slug : 

Type

$version

$version : 

Type

$homepage

$homepage : 

Type

$download_url

$download_url : 

Type

$upgrade_notice

$upgrade_notice : 

Type

$icons

$icons : 

Type

$filename

$filename : 

Type

$tested

$tested : 

Type

$fields

$fields : 

Type

Methods

fromJson()

fromJson(string  $json, boolean  $triggerErrors = false) : \PluginUpdate|null

Create a new instance of PluginUpdate from its JSON-encoded representation.

Parameters

string $json
boolean $triggerErrors

Returns

\PluginUpdate|null

fromPluginInfo()

fromPluginInfo(\PluginInfo  $info) : \PluginUpdate

Create a new instance of PluginUpdate based on an instance of PluginInfo.

Basically, this just copies a subset of fields from one object to another.

Parameters

\PluginInfo $info

Returns

\PluginUpdate

fromObject()

fromObject(\StdClass|\PluginInfo|\PluginUpdate  $object) : \PluginUpdate

Create a new instance of PluginUpdate by copying the necessary fields from another object.

Parameters

\StdClass|\PluginInfo|\PluginUpdate $object

The source object.

Returns

\PluginUpdate

The new copy.

toStdClass()

toStdClass() : \StdClass

Create an instance of StdClass that can later be converted back to a PluginUpdate. Useful for serialization and caching, as it avoids the "incomplete object" problem if the cached value is loaded before this class.

Returns

\StdClass

toWpFormat()

toWpFormat() : object

Transform the update into the format used by WordPress native plugin API.

Returns

object