Skip to main content
Tweeted twitter.com/StackWordPress/status/805554073684602883
edited title
Link
Ignacio
  • 223
  • 4
  • 15

Modifying admin sidebar contents to show pending posts indicator

Source Link
Ignacio
  • 223
  • 4
  • 15

Modifying admin sidebar contents

I've been trying to get a pending count to appear on the admin sidebar, for pending posts, like the little bubble that appears for pending comments:

Comments pending bubble

Offtopic: Am I the only one that thinks this should be core behaviour? Where should I suggest this feature?

Anyhow, I found this plugin, but I noticed it didn't always worked. Sometimes the notifier appears on Pages or other item.

The code it uses to add the pending count goes something like this:

$menu[5][0] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n($pending_count) . '</span></span>';

So, clearly the problem is the hard-coded 5 there, but how can I update it so it always points to Posts?

I'll be glad to commit this change to the plugin if we know the answer.

Thanks!