_get_admin_bar_pref example

<?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?> </label> <?php _e( '<a href="https://wordpress.org/documentation/article/keyboard-shortcuts-classic-editor/#keyboard-shortcuts-for-comments">Documentation on Keyboard Shortcuts</a>' ); ?> </td> </tr> <?php endif; ?> <tr class="show-admin-bar user-admin-bar-front-wrap"> <th scope="row"><?php _e( 'Toolbar' ); ?></th> <td> <label for="admin_bar_front"> <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profile_user->ID ) ); ?> /> <?php _e( 'Show Toolbar when viewing site' ); ?> </label><br /> </td> </tr> <?php                     $languages                = get_available_languages();
                    $can_install_translations = current_user_can( 'install_languages' ) && wp_can_install_language_pack();
                    ?> <?php if ( $languages || $can_install_translations ) : ?> <tr class="user-language-wrap"> <th scope="row">


    // Integrated into the admin.     if ( is_admin() ) {
        return true;
    }

    if ( ! isset( $show_admin_bar ) ) {
        if ( ! is_user_logged_in() || 'wp-login.php' === $pagenow ) {
            $show_admin_bar = false;
        } else {
            $show_admin_bar = _get_admin_bar_pref();
        }
    }

    /** * Filters whether to show the admin bar. * * Returning false to this hook is the recommended way to hide the admin bar. * The user's display preference is used for logged in users. * * @since 3.1.0 * * @param bool $show_admin_bar Whether the admin bar should be shown. Default false. */
Home | Imprint | This part of the site doesn't use cookies.