Switch language

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




wp_register [ WordPress Function ]

wp_register ( $before = '
  • ', $after = '
  • ', $echo = true
    )
    Parameters:
    • (string) $before Text to output before the link (defaults to <li>).
    • (string) $after Text to output after the link (defaults to </li>).
    • (boolean) $echo Default to echo and not return the link.
    Uses:
    Defined at:



    Display the Registration or Admin link.

    Display a link which allows the user to navigate to the registration page if not logged in and registration is enabled or to the dashboard if logged in.

    Source

    
    <?php
    function wp_register$before '<li>'$after '</li>'$echo true ) {

        if ( ! 
    is_user_logged_in() ) {
            if ( 
    get_option('users_can_register') )
                
    $link $before '<a href="' site_url('wp-login.php?action=register''login') . '">' __('Register') . '</a>' $after;
            else
                
    $link '';
        } else {
            
    $link $before '<a href="' admin_url() . '">' __('Site Admin') . '</a>' $after;
        }

        if ( 
    $echo )
            echo 
    apply_filters('register'$link);
        else
            return 
    apply_filters('register'$link);
    }
    ?>

    Examples [ wp-snippets.com ]

    Google Arama Sonuçlarý

    Dahasý ...

    0 User Note(s)

    Henüz yok. Ýlk sen ol!

    Yeni Ekle ...



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