所有插件都有效,但在我的自定义插件 $wpdb、wp_create_user、wp_insert_user 中不起作用。例如,不起作用
$user_id = 1;
$website = 'http://wordpress.org';
wp_insert_user( array ('ID' => $user_id, 'user_url' => $website) ) ;
global $wpdb;
if(!isset($wpdb)) {
require_once('../../../wp-config.php');
//require_once('../../../wp-load.php');
require_once('../../../wp-includes/wp-db.php');
}
$insertUser = "INSERT INTO $wpdb->users (user_login, user_pass, user_email, user_url) VALUES ('123', '123', 'rokk@gmail.com', 'lasad.com')";
$wpdb->query( $insertUser );