Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我要在我的插件中获得wordpress用户身份验证功能?_Javascript_Php_Jquery_Wordpress - Fatal编程技术网

Javascript 我要在我的插件中获得wordpress用户身份验证功能?

Javascript 我要在我的插件中获得wordpress用户身份验证功能?,javascript,php,jquery,wordpress,Javascript,Php,Jquery,Wordpress,我有一个要求,我需要在wordpress页面中仔细检查用户凭据 我创建了一个插件,里面有我的页面模板 我创建了一个仅为登录用户显示的用户输入表单,但在提交之前,我正在收集用户名和密码,我希望使用以下功能与当前登录的wordpress用户进行检查: wp_authenticate_username_password $userdata = get_user_by('login', $username); global $current_user 等等 形式很简单,如下所示: <!--

我有一个要求,我需要在wordpress页面中仔细检查用户凭据

  • 我创建了一个插件,里面有我的页面模板
  • 我创建了一个仅为登录用户显示的用户输入表单,但在提交之前,我正在收集用户名和密码,我希望使用以下功能与当前登录的wordpress用户进行检查:

    wp_authenticate_username_password
    $userdata = get_user_by('login', $username);
    global $current_user 
    
  • 等等

    形式很简单,如下所示:

    <!-- Text input-->
            <div class="form-group">
                <label class="col-md-4 control-label" for="textInput1">User Name</label>
                <div class="col-md-4">
                    <input id="textInputUserName" class="form-control input-md" name="textInputUserName" required="" type="text" placeholder="e.g. Same credentials ..." />
                </div>
            </div>
    
            <!-- Password input-->
                    <div class="form-group">
                        <label class="col-md-4 control-label" for="passwordinput">Password </label>
                        <div class="col-md-4">
                            <input id="passwordinput" name="passwordinput" type="password" placeholder="******" class="form-control input-md" required="">
    
                        </div>
                    </div>
    
    但我无法让这些函数工作。这是我第一次使用wordpress,我对Javascript和php等相关web技术不太了解,我只涉猎了一些代码

    有知识的人能帮我吗?我怎样才能让它工作

    谢谢 阿拉姆

    附言:
    我想再次检查,并在我的网站相同的凭据,以创建一个帐户在另一个服务器提供不同的服务。问题不在于我应该使用什么Wordpress函数,而是如何使用它们?因为它们都在表单模板文件中工作,但在我的php脚本文件中失败,该文件在我的插件中更深入。我缺少哪些设置?

    为什么要在用户已登录时重新对其进行身份验证?您是否尝试过
    wp\u check\u password()
    ?我想再次检查并使用我网站的相同凭据在另一个提供不同服务的服务器上创建帐户。问题不在于我应该使用什么Wordpress函数,而是如何使用它们?因为它们都在表单模板文件中工作,但在我的php脚本文件中失败,该文件在我的插件中更深入。我缺少什么设置?你提到你使用自己的插件。你如何注册这个插件?它是否在管理员的插件页面中可见,是否可以打开/关闭?因为如果每个插件都是正确的,那么
    user.php等
    中的函数必须在插件中可用。嗨,pgk,插件在插件页面中可见,我可以打开/关闭它。我不明白“如果一切正常”
    
    require_once ( '../../../wp-includes/user.php');
    require_once ( '../../../wp-includes/pluggable.php');