How can I make a plugin send an alert to one's dashboard at the top right below where the WordPress upgrade notice might normally appear?
I imagine I need some kind of add_filter() or add_action() call in the plugins' code.
How can I make a plugin send an alert to one's dashboard at the top right below where the WordPress upgrade notice might normally appear?
I imagine I need some kind of add_filter() or add_action() call in the plugins' code.
<? function addDashboardAlert() { ?>
<style type="text/css">
.alert {
padding-top:4px;
padding-bottom:6px;
padding-left:302px;
background-color:#ebfbff;
border-bottom:1px solid #CCC;
display:none;
}
</style>
<script type="text/javascript">
$j = jQuery;
$j().ready(function(){ //when page has fully loaded
$j('h2:contains("Dashboard")').parent().prev().after('<div id="my-plugin-alert" class="alert">X Plugin 2.0 is available. <a href="">Upgrade Now!</a></div>');
setTimeout("$j('#my-plugin-alert').fadeIn('slow');clearTimeout();",1000);
});
</script>
<? } add_action('admin_head','addDashboardAlert'); ?>This topic has been closed to new replies.