WC_Plugins_Screen_Updates::get_upgrade_notice()
Get the upgrade notice from WordPress.org.
Method of the class: WC_Plugins_Screen_Updates{}
No Hooks.
Return
String
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_upgrade_notice( $version );
- $version(string) (required)
- WooCommerce new version.
WC_Plugins_Screen_Updates::get_upgrade_notice() WC Plugins Screen Updates::get upgrade notice code WC 9.3.3
protected function get_upgrade_notice( $version ) { $transient_name = 'wc_upgrade_notice_' . $version; $upgrade_notice = get_transient( $transient_name ); if ( false === $upgrade_notice ) { $response = wp_safe_remote_get( 'https://plugins.svn.wordpress.org/woocommerce/trunk/readme.txt' ); if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) ) { $upgrade_notice = $this->parse_update_notice( $response['body'], $version ); set_transient( $transient_name, $upgrade_notice, DAY_IN_SECONDS ); } } return $upgrade_notice; }