Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_dashboard_url [ WordPress Function ]

get_dashboard_url ( $user_id, $path = '', $scheme = 'admin' )
Parameters:
  • (int) $user_id User ID
  • (string) $path Optional path relative to the dashboard. Use only paths known to both blog and user admins.
  • (string) $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
Returns:
  • (string) Dashboard url link with optional path appended.
Defined at:



Get the URL to the user's dashboard.

If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site, the dashboard for the current site is returned. If the user cannot edit the current site, the dashboard to the user's primary blog is returned.

Source


<?php
function get_dashboard_url$user_id$path ''$scheme 'admin' ) {
    
$user_id = (int) $user_id;

    
$blogs get_blogs_of_user$user_id );
    if ( ! 
is_super_admin() && empty($blogs) ) {
        
$url user_admin_url$path$scheme );
    } elseif ( ! 
is_multisite() ) {
        
$url admin_url$path$scheme );
    } else {
        
$current_blog get_current_blog_id();
        if ( 
$current_blog  && ( is_super_admin$user_id ) || in_array$current_blogarray_keys$blogs ) ) ) ) {
            
$url admin_url$path$scheme );
        } else {
            
$active get_active_blog_for_user$user_id );
            if ( 
$active )
                
$url get_admin_url$active->blog_id$path$scheme );
            else
                
$url user_admin_url$path$scheme );
        }
    }

    return 
apply_filters'user_dashboard_url'$url$user_id$path$scheme);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics