带有密码字段的前端注册表

时间:2012-10-17 作者:Swen

我正在尝试为我的Wordpress网站创建一个前端注册表。注册表在标题中,所以我看到的任何插件都不能工作,因为它们使用短代码。

请查看我的网站以获得更好的解释。我想在页面顶部的下拉框中填写注册表。

2 个回复
最合适的回答,由SO网友:Nicole 整理而成

如果要使用使用短代码的插件,可以在模板中使用以下内容在模板中调用它:

<?php echo do_shortcode (\'[your-shortcode]\'); ?>
对于前端登录,您还可以执行类似于以下表单/代码的操作:

<form method="post" action="<?php bloginfo(\'url\') ?>/wp-login.php" class="wp-user-form">
            <div class="username">
                <label for="user_login"><?php _e(\'Username\'); ?>: </label>
                <input type="text" name="log" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" id="user_login" tabindex="11" />
            </div>
            <div class="password">
                <label for="user_pass"><?php _e(\'Password\'); ?>: </label>
                <input type="password" name="pwd" value="" size="20" id="user_pass" tabindex="12" />
            </div>
            <div class="login_fields">
                <div class="rememberme">
                    <label for="rememberme">
                        <input type="checkbox" name="rememberme" value="forever" checked="checked" id="rememberme" tabindex="13" /> Remember me
                    </label>
                </div>
                <?php do_action(\'login_form\'); ?>
                <input type="submit" name="user-submit" value="<?php _e(\'Login\'); ?>" tabindex="14" class="user-submit" />
                <input type="hidden" name="redirect_to" value="<?php echo $_SERVER[\'REQUEST_URI\']; ?>" />
                <input type="hidden" name="user-cookie" value="1" />
            </div>
        </form>

SO网友:Dakshinamurthy Karra

我最近也需要类似的东西,并使用了滑动面板。在plugins repo上发布了它-可规划的滑动面板。看看它是否符合你的要求。

结束

相关推荐

Check the password of a user

我想检查用户是否有特定密码,因此我一直在尝试wp_check_password 但被检查的帐户已注销,在调用之前无法再次登录wp_check_password 在代码中。深入研究代码,我发现它使用新的哈希设置密码。而且如果我使用wp_check_password( \'hello\', md5(\'hello\'), 1 );, 它甚至不检查数据库中的内容并返回true。那不是一只虫子吗?有什么办法可以检查用户的密码吗?