基于cjbj\'s answer above, 这就是我所做的。。。
我去了/wp includes/admin栏。php并将相关代码稍加修改(见下文)复制到我的插件中。以下是最终结果:
if ( !current_user_can(\'edit_posts\') )
return;
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$awaiting_text = sprintf( _n( \'%s comment awaiting moderation\', \'%s comments awaiting moderation\', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
$icon = \'<span class="ab-icon"></span>\';
$title = \'<span id="ab-awaiting-mod" class="ab-label awaiting-mod pending-count count-\' . $awaiting_mod . \'" aria-hidden="true">\' . number_format_i18n( $awaiting_mod ) . \'</span>\';
$title .= \'<span class="screen-reader-text">\' . $awaiting_text . \'</span>\';
$wp_admin_bar->add_menu( array(
\'id\' => \'comments\',
\'parent\' => \'top-secondary\',
\'title\' => $icon . $title,
\'href\' => admin_url(\'edit-comments.php\'),
) );
我所做的就是添加“parent”(家长)=>“top secondary”(根据cjbj的建议)。这正是我需要它做的。