=')) {
return;
}
// only show badge if not dismissed
if (get_option('givewp_new_notification_campaigns_dismissed', false) !== false) {
return;
}
// add "NEW" badge to the GiveWP menu item
add_action( 'admin_menu', function() {
global $menu;
array_walk($menu, static function (&$item) {
if ($item[0] === 'GiveWP') {
$title = $item[0];
$item[0] = sprintf('%s %s', $title, __('NEW', 'give'));
}
});
});
// dismiss the notice when visiting the campaigns list page
if (isset($_GET['page']) && $_GET['page'] === 'give-campaigns') {
update_option('givewp_new_notification_campaigns_dismissed', true);
}
}
}