WC_Helper::_get_extensions_update_notice()
Get an update notice if one or more Woo extensions has an update available.
Method of the class: WC_Helper{}
No Hooks.
Return
String|null
. The update notice or null if everything is up to date.
Usage
$result = WC_Helper::_get_extensions_update_notice();
WC_Helper::_get_extensions_update_notice() WC Helper:: get extensions update notice code WC 9.3.1
private static function _get_extensions_update_notice() { $plugins = self::get_local_woo_plugins(); $updates = WC_Helper_Updater::get_update_data(); $available = 0; foreach ( $plugins as $data ) { if ( empty( $updates[ $data['_product_id'] ] ) ) { continue; } $product_id = $data['_product_id']; if ( version_compare( $updates[ $product_id ]['version'], $data['Version'], '>' ) ) { ++$available; } } if ( ! $available ) { return; } return sprintf( /* translators: %1$s: helper url, %2$d: number of extensions */ _n( 'Note: You currently have <a href="%1$s">%2$d paid extension</a> which should be updated first before updating WooCommerce.', 'Note: You currently have <a href="%1$s">%2$d paid extensions</a> which should be updated first before updating WooCommerce.', $available, 'woocommerce' ), admin_url( 'admin.php?page=wc-addons§ion=helper' ), $available ); }