Skip to content

Commit

Permalink
show upgrade_notice also on plugin overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Jul 21, 2023
1 parent e3772aa commit 5c1bc7d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions antispam_bee.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<div class="update-message">%s</div>',
wpautop( $data['upgrade_notice'] )
);
}
}


/*
Expand Down Expand Up @@ -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
);

0 comments on commit 5c1bc7d

Please sign in to comment.