How to notify users of blog updates a la Admin Plugin Update notifications?

What I would like to do is mimic how WordPress shows an administrator how many new updates there are for installed plugins (a tiny number displayed next to a link). The main difference is that I want to serve this info to a logged-in user on the front end (since they last visited):

  • new messages they’ve received (Buddypress)
  • new forum posts (Buddypress)
  • new posts for “favorited” categories

Not sure where to find the code that provides plugin update notices but that would be a start…

2 Answers
2

As far as display goes, the admin code does this in several ways.

  1. Via the ‘message’ class for stuff
    that shows once at the top of the
    content area.
  2. On the left nav menu,
    either on the Plugins tab or up
    where it says Dashboard.
  3. And in the list of themes (or plugins).

Items 2 and 3 get their information via a handshake with the api.wordpress.org server.

Item 1’s code can (mostly) be found in wp-admin/users.php. I would go into more detail, but my wife just told me to ‘Get the hell off the computer because we’re going to the beach.’ Bye!

Leave a Comment