Description

This function returns the available WordPress® updates from wordpress.org.

You must install the WordPress Manager cPanel plugin to access this API function.

Examples 


https://hostname.example.com:2083/cpsess##########/execute/WordPressInstanceManager/get_latest_wordpress_version_from_wordpress_org?force=1&cache_time=3600

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the latest WordPress version from WordPress.org.
 $instances = $cpanel->uapi(
    'WordPressInstanceManager', 'get_latest_wordpress_version_from_wordpress_org',
	array(
		'force'			=> 	'1',
		'cache_time'	=>	'3600',
		)
);

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve the latest WordPress version from WordPress.org.
my $instances = $cpliveapi->uapi(
    'WordPressInstanceManager', 'get_latest_wordpress_version_from_wordpress_org',
	{
		'force'			=> '1',
		'cache_time'	=> '3600',
);

<!-- Retrieve the latest WordPress version from WordPress.org. -->
[% data = execute( 'WordPressInstanceManager', 'get_latest_wordpress_version_from_wordpress_org', { 'force' => '1', 'cache_time' => '3600', } ); %]

uapi --user=username WordPressInstanceManager get_latest_wordpress_version_from_wordpress_org force=1 cache_time=3600

{
	"errors": null,
	"metadata": {},
	"status": 1,
	"messages": null,
	"data": {
		"offers": [{
			"mysql_version": "5.0",
			"locale": "en_US",
			"packages": {
				"partial": false,
				"rollback": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.7.5.zip",
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.7.5-new-bundled.zip",
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.7.5-no-content.zip"
			},
			"version": "4.7.5",
			"current": "4.7.5",
			"partial_version": false,
			"new_bundled": "4.7",
			"response": "upgrade",
			"php_version": "5.2.4",
			"download": "https://downloads.wordpress.org/release/wordpress-4.7.5.zip"
		}, {
			"new_files": true,
			"partial_version": false,
			"new_bundled": "4.7",
			"current": "4.7.5",
			"version": "4.7.5",
			"packages": {
				"partial": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.7.5.zip",
				"rollback": false,
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.7.5-new-bundled.zip",
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.7.5-no-content.zip"
			},
			"locale": "en_US",
			"mysql_version": "5.0",
			"download": "https://downloads.wordpress.org/release/wordpress-4.7.5.zip",
			"php_version": "5.2.4",
			"response": "autoupdate"
		}, {
			"response": "autoupdate",
			"download": "https://downloads.wordpress.org/release/wordpress-4.6.6.zip",
			"php_version": "5.2.4",
			"mysql_version": "5.0",
			"locale": "en_US",
			"packages": {
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.6.6-no-content.zip",
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.6.6-new-bundled.zip",
				"partial": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.6.6.zip",
				"rollback": false
			},
			"partial_version": false,
			"new_bundled": "4.7",
			"new_files": true,
			"version": "4.6.6",
			"current": "4.6.6"
		}, {
			"response": "autoupdate",
			"download": "https://downloads.wordpress.org/release/wordpress-4.5.9.zip",
			"php_version": "5.2.4",
			"packages": {
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.5.9-new-bundled.zip",
				"partial": false,
				"rollback": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.5.9.zip",
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.5.9-no-content.zip"
			},
			"locale": "en_US",
			"mysql_version": "5.0",
			"new_files": true,
			"new_bundled": "4.7",
			"partial_version": false,
			"current": "4.5.9",
			"version": "4.5.9"
		}, {
			"response": "autoupdate",
			"download": "https://downloads.wordpress.org/release/wordpress-4.4.10.zip",
			"php_version": "5.2.4",
			"locale": "en_US",
			"mysql_version": "5.0",
			"packages": {
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.4.10-no-content.zip",
				"partial": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.4.10.zip",
				"rollback": false,
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.4.10-new-bundled.zip"
			},
			"new_bundled": "4.7",
			"partial_version": false,
			"new_files": true,
			"version": "4.4.10",
			"current": "4.4.10"
		}, {
			"download": "https://downloads.wordpress.org/release/wordpress-4.3.11.zip",
			"php_version": "5.2.4",
			"response": "autoupdate",
			"new_files": true,
			"partial_version": false,
			"new_bundled": "4.7",
			"current": "4.3.11",
			"version": "4.3.11",
			"packages": {
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.3.11-new-bundled.zip",
				"partial": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.3.11.zip",
				"rollback": false,
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.3.11-no-content.zip"
			},
			"locale": "en_US",
			"mysql_version": "5.0"
		}, {
			"new_files": true,
			"new_bundled": "4.7",
			"partial_version": false,
			"current": "4.2.15",
			"version": "4.2.15",
			"packages": {
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.2.15-new-bundled.zip",
				"full": "https://downloads.wordpress.org/release/wordpress-4.2.15.zip",
				"rollback": false,
				"partial": false,
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.2.15-no-content.zip"
			},
			"mysql_version": "5.0",
			"locale": "en_US",
			"download": "https://downloads.wordpress.org/release/wordpress-4.2.15.zip",
			"php_version": "5.2.4",
			"response": "autoupdate"
		}, {
			"response": "autoupdate",
			"php_version": "5.2.4",
			"download": "https://downloads.wordpress.org/release/wordpress-4.1.18.zip",
			"mysql_version": "5.0",
			"locale": "en_US",
			"packages": {
				"full": "https://downloads.wordpress.org/release/wordpress-4.1.18.zip",
				"rollback": false,
				"partial": false,
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.1.18-new-bundled.zip",
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.1.18-no-content.zip"
			},
			"version": "4.1.18",
			"current": "4.1.18",
			"new_bundled": "4.7",
			"partial_version": false,
			"new_files": true
		}, {
			"version": "4.0.18",
			"current": "4.0.18",
			"new_files": true,
			"new_bundled": "4.7",
			"partial_version": false,
			"packages": {
				"rollback": false,
				"full": "https://downloads.wordpress.org/release/wordpress-4.0.18.zip",
				"partial": false,
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-4.0.18-new-bundled.zip",
				"no_content": "https://downloads.wordpress.org/release/wordpress-4.0.18-no-content.zip"
			},
			"mysql_version": "5.0",
			"locale": "en_US",
			"php_version": "5.2.4",
			"download": "https://downloads.wordpress.org/release/wordpress-4.0.18.zip",
			"response": "autoupdate"
		}, {
			"response": "autoupdate",
			"download": "https://downloads.wordpress.org/release/wordpress-3.9.19.zip",
			"php_version": "5.2.4",
			"packages": {
				"no_content": "https://downloads.wordpress.org/release/wordpress-3.9.19-no-content.zip",
				"full": "https://downloads.wordpress.org/release/wordpress-3.9.19.zip",
				"rollback": false,
				"partial": false,
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-3.9.19-new-bundled.zip"
			},
			"locale": "en_US",
			"mysql_version": "5.0",
			"new_files": true,
			"new_bundled": "4.7",
			"partial_version": false,
			"current": "3.9.19",
			"version": "3.9.19"
		}, {
			"new_files": true,
			"new_bundled": "4.7",
			"partial_version": false,
			"version": "3.8.21",
			"current": "3.8.21",
			"packages": {
				"no_content": "https://downloads.wordpress.org/release/wordpress-3.8.21-no-content.zip",
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-3.8.21-new-bundled.zip",
				"partial": false,
				"full": "https://downloads.wordpress.org/release/wordpress-3.8.21.zip",
				"rollback": false
			},
			"locale": "en_US",
			"mysql_version": "5.0",
			"download": "https://downloads.wordpress.org/release/wordpress-3.8.21.zip",
			"php_version": "5.2.4",
			"response": "autoupdate"
		}, {
			"packages": {
				"no_content": "https://downloads.wordpress.org/release/wordpress-3.7.21-no-content.zip",
				"rollback": false,
				"full": "https://downloads.wordpress.org/release/wordpress-3.7.21.zip",
				"partial": false,
				"new_bundled": "https://downloads.wordpress.org/release/wordpress-3.7.21-new-bundled.zip"
			},
			"locale": "en_US",
			"mysql_version": "5.0",
			"version": "3.7.21",
			"current": "3.7.21",
			"new_files": true,
			"partial_version": false,
			"new_bundled": "4.7",
			"response": "autoupdate",
			"php_version": "5.2.4",
			"download": "https://downloads.wordpress.org/release/wordpress-3.7.21.zip"
		}],
		"translations": []
	}
}

Parameters

ParameterTypeDescriptionPossible valuesExample
forceBoolean

Whether to force a reload from the remote API. Otherwise, the function returns information stored in local cache.

This value defaults to 0.

  • 1 — Force reload.
  • 0 — Read local cache.
0
cache_timeinteger

The length of time to cache the database between requests to wordpress.org.

This value defaults to 86400.

A valid whole number, measured in seconds.3600

Returns

ReturnTypeDescriptionPossible valuesExample
offersarray

This array contains the returned value from wordpress.org's Version Check API.

For additional information about the returned values, read WordPress's Version Check API documentation.