While developing plugins for our clients I sometimes find myself needing a way to draw attention to that particular section of the administration area. WordPress unfortunetly doesn’t support a way to easily add notifications so I created a quick snippet of code that will do just that. I hope you find it useful in your development.
All you have to do is add this to your plugin or functions.php file and you’re ready to go. There are three parameters that need to be set:
- target_menu: this is the menu you want to target, just inspect your admin screen with Firebug and you need to grab the ID of the LI menu LI element
- bubble_msg: this is the actual message you want to display, you can use a number or string. This would work more on case by case basis so you could write a query that returns a number of recently commented on posts or number of posts waiting to be approved for publishing.
- bg_color: this is the color that you want the bubble background to be.
Let me know if you run into any issues but I hope you can find a use for this code.