From 5c1bc7d6e4d62b55fbaf2a32a671ba4ced59be8a Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 21 Jul 2023 10:23:12 +0200 Subject: [PATCH] show upgrade_notice also on plugin overview page --- antispam_bee.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/antispam_bee.php b/antispam_bee.php index 92b2d89f..08864926 100755 --- a/antispam_bee.php +++ b/antispam_bee.php @@ -1081,6 +1081,26 @@ public static function clear_scheduled_hook() { } } + /** + * Shows plugin update no + * + * @since 2.12.0 + * + * @param array $plugin_data An array of plugin metadata. See get_plugin_data() + * and the {@see 'plugin_row_meta'} filter for the list + * of possible values. + * @param object $response An object of metadata about the available plugin update. + * + * @return void + */ + public static function upgrade_notice( $data, $response ) { + if ( isset( $data['upgrade_notice'] ) ) { + printf( + '
%s
', + wpautop( $data['upgrade_notice'] ) + ); + } + } /* @@ -3035,3 +3055,14 @@ private static function asb_updated() { 'uninstall', ) ); + +// Upgrade notice. +add_action( + 'in_plugin_update_message-' . __FILE__, + array( + 'Antispam_Bee', + 'upgrade_notice', + ), + 10, + 2 +); \ No newline at end of file