is_term_publicly_viewable example

if ( current_user_can( 'delete_term', $tag->term_id ) ) {
            $actions['delete'] = sprintf(
                '<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
                wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
                /* translators: %s: Taxonomy term name. */
                esc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' )$tag->name ) ),
                __( 'Delete' )
            );
        }

        if ( is_term_publicly_viewable( $tag ) ) {
            $actions['view'] = sprintf(
                '<a href="%s" aria-label="%s">%s</a>',
                get_term_link( $tag ),
                /* translators: %s: Taxonomy term name. */
                esc_attr( sprintf( __( 'View &#8220;%s&#8221; archive' )$tag->name ) ),
                __( 'View' )
            );
        }

        /** * Filters the action links displayed for each term in the Tags list table. * * @since 2.8.0 * @since 3.0.0 Deprecated in favor of {@see '{$taxonomy}_row_actions'} filter. * @since 5.4.2 Restored (un-deprecated). * * @param string[] $actions An array of action links to be displayed. Default * 'Edit', 'Quick Edit', 'Delete', and 'View'. * @param WP_Term $tag Term object. */
&& ( get_post_type_archive_link( $post_type_object->name ) )
            && ! ( 'post' === $post_type_object->name && 'posts' === get_option( 'show_on_front' ) ) ) {
            $wp_admin_bar->add_node(
                array(
                    'id'    => 'archive',
                    'title' => $post_type_object->labels->view_items,
                    'href'  => get_post_type_archive_link( $current_screen->post_type ),
                )
            );
        } elseif ( 'term' === $current_screen->base && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) ) {
            $tax = get_taxonomy( $tag->taxonomy );
            if ( is_term_publicly_viewable( $tag ) ) {
                $wp_admin_bar->add_node(
                    array(
                        'id'    => 'view',
                        'title' => $tax->labels->view_item,
                        'href'  => get_term_link( $tag ),
                    )
                );
            }
        } elseif ( 'user-edit' === $current_screen->base && isset( $user_id ) ) {
            $user_object = get_userdata( $user_id );
            $view_link   = get_author_posts_url( $user_object->ID );
            
Home | Imprint | This part of the site doesn't use cookies.