Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add_login_logout_register_menu( $items, $args )
- {
- if ( $args->theme_location != 'secondary-menu' )
- {
- return $items;
- }
- if ( is_user_logged_in() )
- {
- $current_user = wp_get_current_user();
- $items .= "HOLA " . esc_html( $current_user->user_login ) . " | ";
- $items .= '
- <a href="' . wp_logout_url() . '">CERRAR SESIÓN</a>
- ';
- }
- else
- {
- $items .= '
- <a href="/login”>INICIAR SESIÓN</a> |
- ';
- $items .= '
- <a href="/registro">CREAR CUENTA</a>
- ';
- }
- return $items;
- }
- add_filter( 'wp_nav_menu_items', 'add_login_logout_register_menu', 199, 2 );
Add Comment
Please, Sign In to add comment