Page tree
Skip to end of metadata
Go to start of metadata

Description

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

Note:

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

Examples 


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

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$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',
		)
);

Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
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',
);

Note:

For more information, read our Guide to the LiveAPI System.

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

Note:

For more information, read our Guide to Template Toolkit documentation. 

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

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
	"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": []
	}
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

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.

Note:

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