我要将XAMPP连接到WordPress。因此,我可以迁移自己创建的主题,但是当我单击登录到WordPress按钮时,遇到错误代码。
我将在下面发布给所有了解它的人。
谢谢您的帮助!
我已经尝试了一些有关如何执行此操作的教程,但是仍然遇到相同的问题。我也尝试访问有问题的用户文档,但它不允许我访问。
警告:非法字符串偏移量“ remember”在 C:\ xampp1 \ htdocs \ NRFG_WP \ wp-includes \ user.php在第39行
警告:无法将空字符串分配给的字符串偏移量 C:\ xampp1 \ htdocs \ NRFG_WP \ wp-includes \ user.php在第39行
警告:非法字符串偏移“ user_login”位于 C:\ xampp1 \ htdocs \ NRFG_WP \ wp-includes \ user.php,第54行
致命错误:未被捕获的错误:无法创建对字符串的引用/来自字符串的引用 C:\ xampp1 \ htdocs \ NRFG_WP \ wp-includes \ user.php:54中的偏移量 跟踪:#0 C:\ xampp1 \ htdocs \ NRFG_WP \ wp-login.php(770):wp_signon('', '')#1 {main}抛出C:\ xampp1 \ htdocs \ NRFG_WP \ wp-includes \ user.php 在第54行
这里是PHP,直到所有提到的行为止:
<?php
/**
* WordPress User API
*
* @package WordPress
* @subpackage Users
*/
/**
* Authenticate user with remember capability.
*
* The credentials is an array that has 'user_login', 'user_password', and
* 'remember' indices. If the credentials is not given, then the log in form
* will be assumed and used if set.
*
* The various authentication cookies will be set by this function and will be
* set for a longer period depending on if the 'remember' credential is set to
* true.
*
* @since 2.5.0
*
* @param array $credentials Optional. User info in order to sign on.
* @param bool $secure_cookie Optional. Whether to use secure cookie.
* @return WP_User|WP_Error WP_User on success, WP_Error on failure.
*/
function wp_signon( $credentials = array(), $secure_cookie = '' ) {
if ( empty($credentials) ) {
if ( ! empty($_POST['log']) )
$credentials['user_login'] = $_POST['log'];
if ( ! empty($_POST['pwd']) )
$credentials['user_password'] = $_POST['pwd'];
if ( ! empty($_POST['rememberme']) )
$credentials['remember'] = $_POST['rememberme'];
}
if ( !empty($credentials['remember']) )
$credentials['remember'] = true;
else
$credentials['remember'] = false;
/**
* Fires before the user is authenticated.
*
* The variables passed to the callbacks are passed by reference,
* and can be modified by callback functions.
*
* @since 1.5.1
*
* @todo Decide whether to deprecate the wp_authenticate action.
*
* @param string $user_login Username, passed by reference.
* @param string $user_password User password, passed by reference.
*/
do_action_ref_array( 'wp_authenticate', array( &$credentials['user_login'], &$credentials['user_password'] ) );