Question: How do you actually display these bubbles?
I tried populating them with this code in my functions.php file, without this plugin, and they seem to work fine with AME:
add_action( 'admin_menu', 'pending_posts_bubble_wpse_89028', 999 );
function pending_posts_bubble_wpse_89028()
{
global $menu;
$args = array( 'public' => true );
$post_types = get_post_types( $args );
unset( $post_types['attachment'] );
foreach( $post_types as $pt )
{
// count posts
$cpt_count = wp_count_posts( $pt );
if ( $cpt_count->pending )
{
$suffix = ( 'post' == $pt ) ? '' : "?post_type=$pt";
$key = recursive_array_search_php_91365( "edit.php$suffix", $menu );
if( !$key )
return;
$menu[$key][0] .= sprintf(
'<span class="update-plugins count-%1$s"><span class="plugin-count">%1$s</span></span>',
$cpt_count->pending
);
}
}
}
function recursive_array_search_php_91365( $needle, $haystack )
{
foreach( $haystack as $key => $value )
{
$current_key = $key;
if(
$needle === $value
OR (
is_array( $value )
&& recursive_array_search_php_91365( $needle, $value ) !== false
)
)
{
return $current_key;
}
}
return false;
}
The issue appears to be that Admin Tweaks is adding a bunch of new lines to the menu title which confuses AME plugin because it doesn’t “understand” multilines in menu titles, and that’s why it keeps resetting the title.
P.S. I just noticed that I was the one who asked that question on WP Answers and you were the same one who answered ??