is_user_admin example


        do_action( 'wp_network_dashboard_setup' );

        /** * Filters the list of widgets to load for the Network Admin dashboard. * * @since 3.1.0 * * @param string[] $dashboard_widgets An array of dashboard widget IDs. */
        $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );
    } elseif ( is_user_admin() ) {

        /** * Fires after core widgets for the User Admin dashboard have been registered. * * @since 3.1.0 */
        do_action( 'wp_user_dashboard_setup' );

        /** * Filters the list of widgets to load for the User Admin dashboard. * * @since 3.1.0 * * @param string[] $dashboard_widgets An array of dashboard widget IDs. */


    $blogname = get_bloginfo( 'name' );

    if ( ! $blogname ) {
        $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
    }

    if ( is_network_admin() ) {
        /* translators: %s: Site title. */
        $blogname = sprintf( __( 'Network Admin: %s' )esc_html( get_network()->site_name ) );
    } elseif ( is_user_admin() ) {
        /* translators: %s: Site title. */
        $blogname = sprintf( __( 'User Dashboard: %s' )esc_html( get_network()->site_name ) );
    }

    $title = wp_html_excerpt( $blogname, 40, '…' );

    $wp_admin_bar->add_node(
        array(
            'id'    => 'site-name',
            'title' => $title,
            'href'  => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(),
        )


global $pagenow,
    $is_lynx$is_gecko$is_winIE$is_macIE$is_opera$is_NS4$is_safari$is_chrome$is_iphone$is_IE$is_edge,
    $is_apache$is_IIS$is_iis7$is_nginx;

// On which page are we? if ( is_admin() ) {
    // wp-admin pages are checked more carefully.     if ( is_network_admin() ) {
        preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF']$self_matches );
    } elseif ( is_user_admin() ) {
        preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF']$self_matches );
    } else {
        preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF']$self_matches );
    }

    $pagenow = ! empty( $self_matches[1] ) ? $self_matches[1] : '';
    $pagenow = trim( $pagenow, '/' );
    $pagenow = preg_replace( '#\?.*?$#', '', $pagenow );

    if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {
        $pagenow = 'index.php';
    }
// Catch plugins that include admin-header.php before admin.php completes. if ( empty( $current_screen ) ) {
    set_current_screen();
}

get_admin_page_title();
$title = strip_tags( $title );

if ( is_network_admin() ) {
    /* translators: Network admin screen title. %s: Network title. */
    $admin_title = sprintf( __( 'Network Admin: %s' )get_network()->site_name );
} elseif ( is_user_admin() ) {
    /* translators: User dashboard screen title. %s: Network title. */
    $admin_title = sprintf( __( 'User Dashboard: %s' )get_network()->site_name );
} else {
    $admin_title = get_bloginfo( 'name' );
}

if ( $admin_title === $title ) {
    /* translators: Admin screen title. %s: Admin screen name. */
    $admin_title = sprintf( __( '%s — WordPress' )$title );
} else {
    $screen_title = $title;

    
// Used in the HTML title tag.     /* translators: %s: User's display name. */
    $title = __( 'Edit User %s' );
}

if ( current_user_can( 'edit_users' ) && ! IS_PROFILE_PAGE ) {
    $submenu_file = 'users.php';
} else {
    $submenu_file = 'profile.php';
}

if ( current_user_can( 'edit_users' ) && ! is_user_admin() ) {
    $parent_file = 'users.php';
} else {
    $parent_file = 'profile.php';
}

$profile_help = '<p>' . __( 'Your profile contains information about you (your &#8220;account&#8221;) as well as some personal options related to using WordPress.' ) . '</p>' .
    '<p>' . __( 'You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.' ) . '</p>' .
    '<p>' . __( 'You can select the language you wish to use while using the WordPress administration screen without affecting the language site visitors see.' ) . '</p>' .
    '<p>' . __( 'Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.' ) . '</p>' .
    '<p>' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out Everywhere Else button.' ) . '</p>' .
    '<p>' . __( 'Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.' ) . '</p>' .
    
if ( is_network_admin() ) {

    /** * Fires before the administration menu loads in the Network Admin. * * The hook fires before menus and sub-menus are removed based on user privileges. * * @private * @since 3.1.0 */
    do_action( '_network_admin_menu' );
} elseif ( is_user_admin() ) {

    /** * Fires before the administration menu loads in the User Admin. * * The hook fires before menus and sub-menus are removed based on user privileges. * * @private * @since 3.1.0 */
    do_action( '_user_admin_menu' );
} else {

    
// Site-related.         add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 );

        // Content-related.         if ( ! is_network_admin() && ! is_user_admin() ) {
            add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
            add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
        }
        add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );

        add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );

        /** * Fires after menus are added to the menu bar. * * @since 3.1.0 */

function self_admin_url( $path = '', $scheme = 'admin' ) {
    if ( is_network_admin() ) {
        $url = network_admin_url( $path$scheme );
    } elseif ( is_user_admin() ) {
        $url = user_admin_url( $path$scheme );
    } else {
        $url = admin_url( $path$scheme );
    }

    /** * Filters the admin URL for the current site or network depending on context. * * @since 4.9.0 * * @param string $url The complete URL including scheme and path. * @param string $path Path relative to the URL. Blank string if no path is specified. * @param string $scheme The scheme to use. */
Home | Imprint | This part of the site doesn't use cookies.