WP_CLI
WpOrgApi::get_core_download_offer()
Gets a download offer.
Method of the class: WpOrgApi{}
No Hooks.
Return
Array|false
. False on failure. Associative array of the offer on success.
Usage
$WpOrgApi = new WpOrgApi(); $WpOrgApi->get_core_download_offer( $locale );
- $locale(string)
- Locale to request an offer from.
Default: 'en_US'
WpOrgApi::get_core_download_offer() WpOrgApi::get core download offer code WP-CLI 2.8.0-alpha
public function get_core_download_offer( $locale = 'en_US' ) { $response = $this->get_core_version_check( $locale ); if ( ! is_array( $response ) || ! isset( $response['offers'] ) || ! is_array( $response['offers'] ) ) { return false; } $offer = $response['offers'][0]; if ( ! array_key_exists( 'locale', $offer ) || $locale !== $offer['locale'] ) { return false; } return $offer; }