get_user_locale example

if ( $current_screen->post_type ) {
    $admin_body_class .= ' post-type-' . $current_screen->post_type;
}

if ( $current_screen->taxonomy ) {
    $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy;
}

$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) );
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) );
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );

if ( wp_is_mobile() ) {
    $admin_body_class .= ' mobile';
}

if ( is_multisite() ) {
    $admin_body_class .= ' multisite';
}

if ( is_network_admin() ) {
    $admin_body_class .= ' network-admin';
}
if ( is_array( $args ) ) {
        $args = (object) $args;
    }

    if ( 'query_themes' === $action ) {
        if ( ! isset( $args->per_page ) ) {
            $args->per_page = 24;
        }
    }

    if ( ! isset( $args->locale ) ) {
        $args->locale = get_user_locale();
    }

    if ( ! isset( $args->wp_version ) ) {
        $args->wp_version = substr( $wp_version, 0, 3 ); // x.y     }

    /** * Filters arguments used to query for installer pages from the WordPress.org Themes API. * * Important: An object MUST be returned to this filter. * * @since 2.8.0 * * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API. * @param string $action Requested action. Likely values are 'theme_information', * 'feature_list', or 'query_themes'. */
update_site_option( 'allowedthemes', $allowed_themes );
    }

    /** * Sorts themes by name. * * @since 3.4.0 * * @param WP_Theme[] $themes Array of theme objects to sort (passed by reference). */
    public static function sort_by_name( &$themes ) {
        if ( str_starts_with( get_user_locale(), 'en_' ) ) {
            uasort( $themes, array( 'WP_Theme', '_name_sort' ) );
        } else {
            foreach ( $themes as $key => $theme ) {
                $theme->translate_header( 'Name', $theme->headers['Name'] );
            }
            uasort( $themes, array( 'WP_Theme', '_name_sort_i18n' ) );
        }
    }

    /** * Callback function for usort() to naturally sort themes by name. * * Accesses the Name header directly from the class for maximum speed. * Would choke on HTML but we don't care enough to slow it down with strip_tags(). * * @since 3.4.0 * * @param WP_Theme $a First theme. * @param WP_Theme $b Second theme. * @return int Negative if `$a` falls lower in the natural order than `$b`. Zero if they fall equally. * Greater than 0 if `$a` falls higher in the natural order than `$b`. Used with usort(). */


        if ( in_array( 'description', $fields, true ) ) {
            $data['description'] = $user->description;
        }

        if ( in_array( 'link', $fields, true ) ) {
            $data['link'] = get_author_posts_url( $user->ID, $user->user_nicename );
        }

        if ( in_array( 'locale', $fields, true ) ) {
            $data['locale'] = get_user_locale( $user );
        }

        if ( in_array( 'nickname', $fields, true ) ) {
            $data['nickname'] = $user->nickname;
        }

        if ( in_array( 'slug', $fields, true ) ) {
            $data['slug'] = $user->user_nicename;
        }

        if ( in_array( 'roles', $fields, true ) ) {
            
<?php _e( 'Selected file content:' ); ?></label> <textarea cols="70" rows="30" name="newcontent" id="newcontent" aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo $content; ?></textarea> <input type="hidden" name="action" value="update" /> <input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" /> <input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" /> </div> <?php if ( ! empty( $functions ) ) : ?> <div id="documentation" class="hide-if-no-js"> <label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" /> </div> <?php endif; ?> <div> <div class="editor-notices"> <?php if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : ?> <div class="notice notice-warning inline"> <p> <?php if ( is_writable( $file ) ) : ?> <strong><?php _e( 'Caution:' ); ?></strong> <?php endif; ?>

function wp_credits( $version = '', $locale = '' ) {
    if ( ! $version ) {
        // Include an unmodified $wp_version.         require ABSPATH . WPINC . '/version.php';

        $version = $wp_version;
    }

    if ( ! $locale ) {
        $locale = get_user_locale();
    }

    $results = get_site_transient( 'wordpress_credits_' . $locale );

    if ( ! is_array( $results )
        || str_contains( $version, '-' )
        || ( isset( $results['data']['version'] ) && ! str_starts_with( $version$results['data']['version'] ) )
    ) {
        $url     = "http://api.wordpress.org/core/credits/1.1/?version={$version}&locale={$locale}";
        $options = array( 'user-agent' => 'WordPress/' . $version . '; ' . home_url( '/' ) );

        
$body_class .= ' mobile';
    add_filter( 'admin_viewport_meta', '_customizer_mobile_viewport_meta' );
endif;

if ( $wp_customize->is_ios() ) {
    $body_class .= ' ios';
}

if ( is_rtl() ) {
    $body_class .= ' rtl';
}
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );

if ( wp_use_widgets_block_editor() ) {
    $body_class .= ' wp-embed-responsive';
}

$admin_title = sprintf( $wp_customize->get_document_title_template()__( 'Loading&hellip;' ) );

?> <title><?php echo esc_html( $admin_title ); ?></title> <script type="text/javascript"> var ajaxurl =
// Here we split it into lines.     $lyrics = explode( "\n", $lyrics );

    // And then randomly choose a line.     return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
}

// This just echoes the chosen line, we'll position it later. function hello_dolly() {
    $chosen = hello_dolly_get_lyric();
    $lang   = '';
    if ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {
        $lang = ' lang="en"';
    }

    printf(
        '<p id="dolly"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>',
        __( 'Quote from Hello Dolly song, by Jerry Herman:' ),
        $lang,
        $chosen
    );
}

$user = wp_get_current_user();

        wp_logout();

        if ( ! empty( $_REQUEST['redirect_to'] ) ) {
            $redirect_to           = $_REQUEST['redirect_to'];
            $requested_redirect_to = $redirect_to;
        } else {
            $redirect_to = add_query_arg(
                array(
                    'loggedout' => 'true',
                    'wp_lang'   => get_user_locale( $user ),
                ),
                wp_login_url()
            );

            $requested_redirect_to = '';
        }

        /** * Filters the log out redirect URL. * * @since 4.2.0 * * @param string $redirect_to The redirect destination URL. * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. * @param WP_User $user The WP_User object for the user that's logging out. */

                }

                $page_template = get_page_template_slug( $post );

                if ( false !== $page_template ) {
                    $page_template = empty( $page_template ) ? 'default' : str_replace( '.', '-', basename( $page_template, '.php' ) );
                    $body_class   .= ' page-template-' . sanitize_html_class( $page_template );
                }
            }

            $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );

            if ( ! empty( $set['tinymce']['body_class'] ) ) {
                $body_class .= ' ' . $set['tinymce']['body_class'];
                unset( $set['tinymce']['body_class'] );
            }

            $mce_init = array(
                'selector'          => "#$editor_id",
                'wpautop'           => (bool) $set['wpautop'],
                'indent'            => ! $set['wpautop'],
                'toolbar1'          => implode( ',', $mce_buttons ),
                
 ! empty( $_GET['wp_lang'] ) || ! empty( $_COOKIE['wp_lang'] ) )
    ) {
        if ( ! empty( $_GET['wp_lang'] ) ) {
            $determined_locale = sanitize_locale_name( $_GET['wp_lang'] );
        } else {
            $determined_locale = sanitize_locale_name( $_COOKIE['wp_lang'] );
        }
    } elseif (
        is_admin() ||
        ( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request() )
    ) {
        $determined_locale = get_user_locale();
    }

    if ( ! $determined_locale ) {
        $determined_locale = get_locale();
    }

    /** * Filters the locale for the current request. * * @since 5.0.0 * * @param string $locale The locale. */
$tzstring = 'UTC' . $current_offset;
    } else {
        $tzstring = 'UTC+' . $current_offset;
    }
}

?> <th scope="row"><label for="timezone_string"><?php _e( 'Timezone' ); ?></label></th> <td> <select id="timezone_string" name="timezone_string" aria-describedby="timezone-description"> <?php echo wp_timezone_choice( $tzstringget_user_locale() ); ?> </select> <p class="description" id="timezone-description"> <?php     printf(
        /* translators: %s: UTC abbreviation */
        __( 'Choose either a city in the same timezone as you or a %s (Coordinated Universal Time) time offset.' ),
        '<abbr>UTC</abbr>'
    );
    ?> </p> <p class="timezone-info"> <span id="utc-time">
do_action( "admin_print_scripts-{$hook_suffix}); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    /** This action is documented in wp-admin/admin-header.php */
    do_action( 'admin_print_scripts' );

    /** This action is documented in wp-admin/admin-header.php */
    do_action( "admin_head-{$hook_suffix}); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    /** This action is documented in wp-admin/admin-header.php */
    do_action( 'admin_head' );

    $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );

    if ( is_rtl() ) {
        $admin_body_class .= ' rtl';
    }

    ?> </head> <?php     /** * @global string $body_id */
    
'version'                => array(
                    'label' => __( 'Version' ),
                    'value' => $core_version . $core_update_needed,
                    'debug' => $core_version,
                ),
                'site_language'          => array(
                    'label' => __( 'Site Language' ),
                    'value' => get_locale(),
                ),
                'user_language'          => array(
                    'label' => __( 'User Language' ),
                    'value' => get_user_locale(),
                ),
                'timezone'               => array(
                    'label' => __( 'Timezone' ),
                    'value' => wp_timezone_string(),
                ),
                'home_url'               => array(
                    'label'   => __( 'Home URL' ),
                    'value'   => get_bloginfo( 'url' ),
                    'private' => true,
                ),
                'site_url'               => array(
                    
<?php _e( 'Selected file content:' ); ?></label> <textarea cols="70" rows="25" name="newcontent" id="newcontent" aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo $content; ?></textarea> <input type="hidden" name="action" value="update" /> <input type="hidden" name="file" value="<?php echo esc_attr( $file ); ?>" /> <input type="hidden" name="plugin" value="<?php echo esc_attr( $plugin ); ?>" /> </div> <?php if ( ! empty( $docs_select ) ) : ?> <div id="documentation" class="hide-if-no-js"> <label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" /> </div> <?php endif; ?> <?php if ( is_writable( $real_file ) ) : ?> <div class="editor-notices"> <?php if ( in_array( $plugin(array) get_option( 'active_plugins', array() ), true ) ) { ?> <div class="notice notice-warning inline active-plugin-edit-warning"> <p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p> </div> <?php } ?> </div> <p class="submit">
Home | Imprint | This part of the site doesn't use cookies.