wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_register › WordPress Function
Seit1.5.0
Veraltetn/v
› wp_register ( $before = '<li>', $after = '</li>', $display = true )
Parameter: (3) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Displays 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.Ähnliche Funktionen: wp_register_style, wp_register_script, wp_deregister_style, wp_reset_query, wp_deregister_script
Quellcode
function wp_register( $before = '<li>', $after = '</li>', $display = true ) { if ( ! is_user_logged_in() ) { if ( get_option( 'users_can_register' ) ) { $link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __( 'Register' ) . '</a>' . $after; } else { $link = ''; } } elseif ( current_user_can( 'read' ) ) { $link = $before . '<a href="' . admin_url() . '">' . __( 'Site Admin' ) . '</a>' . $after; } else { $link = ''; } /** * Filters the HTML link to the Registration or Admin page. * * Users are sent to the admin page if logged-in, or the registration page * if enabled and logged-out. * * @since 1.5.0 * * @param string $link The HTML code for the link to the Registration or Admin page. */ $link = apply_filters( 'register', $link ); if ( $display ) { echo $link; } else { return $link; } }