store->get_languages() as $locale => $language ) { $href = VAA_API::get_vaa_action_link( array( $this->type => $locale ), $this->store->get_nonce( true ) ); $class = 'vaa-' . $this->type . '-item'; $title = $this->get_view_title( $locale ); $view_title = ( $locale !== $title ) ? '' . $locale . ' | ' . $language : $locale; $view_title = VAA_View_Admin_As_Form::do_view_title( $view_title, $this, $locale ); // Check if this role is the current view. if ( VAA_API::is_current_view( $locale, $this->type ) ) { $class .= ' current'; if ( 1 === count( $this->store->get_view() ) ) { $href = false; } } $admin_bar->add_node( array( 'id' => $root . '-' . $this->type . '-' . $locale, 'parent' => $parent, 'title' => $view_title, 'href' => $href, 'meta' => array( // Translators: %s stands for the translated role name. 'title' => sprintf( __( 'View as %s', VIEW_ADMIN_AS_DOMAIN ), $title ), 'class' => $class, ), ) ); } // End foreach(). } else { _doing_it_wrong( __FILE__, esc_html__( 'No toolbar resources found.', VIEW_ADMIN_AS_DOMAIN ), '1.7' ); } // End if().