Modifying admin sidebar contents to show pending posts indicator

@ign

Replace the line of code you posted with the following..

foreach( $menu as $menu_key => $menu_data ) :
    if( 'edit.php' != $menu_data[2] )
        continue;
    $menu[$menu_key][0] .= " <span class="update-plugins count-$pending_count"><span class="plugin-count">" . number_format_i18n($pending_count) . '</span></span>';
endforeach;

..that should avoid the need to know the specific key.. (let me know if any problems)..

Hope that helps.. 🙂

Leave a Comment