PHP 如何使用WordPress进行登录和密码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 如何使用WordPress进行登录和密码相关的知识,希望对你有一定的参考价值。

<div id="barra-login">
    
        <p>
        
     <?php global $user_ID; if ( $user_ID ) : ?>

<?php global $current_user; get_currentuserinfo(); ?>
        <?php
if( !empty($current_user->display_name) ){
$nome = $current_user->display_name;
} elseif( !empty($current_user->first_name) && !empty($current_user->last_name) ){
$nome = $current_user->first_name." ".$current_user->last_name;
} else {
$nome = $current_user->user_login;
}
?>
Welcome, <strong><?php echo $nome; ?></strong>
           [ <a href="<?php echo get_option('home')?>/painel/">My Dashboard</a> | <a href="<?php echo wp_logout_url( htmlentities(get_option('home')) ); ?>" title="Logout">Logout</a> ]

       <?php else : ?>

           <strong>Welcome Visitor!</strong> [ <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=register&redirect_to=<?php echo get_option('home')?>/my-information/">Join us</a> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php">Log</a> ]

<?php endif; ?>
        
        </p>
        
    </div>

以上是关于PHP 如何使用WordPress进行登录和密码的主要内容,如果未能解决你的问题,请参考以下文章

WordPress登录框显示/隐藏输入的密码

如何在没有密码的情况下记录wordpress用户

登录页面将我带到主页 Wordpress

PHP如何对用户密码进行加密

如何进入wordpress后台拿shell

Wordpress - 登录后的密码保护页面白页