基本上我想使用wordpress函数wp_create_user()
或wp_update_user()
wordpress之外(wordpress目录之外)。
我尝试使用以下所有代码片段加载wordpress环境,我能够在这两种情况下正确使用函数,但问题是这也会加载我不想要的wordpress模板。
First Method:
<?php
define(\'WP_USE_THEMES\', false);
require (\'../blog/wp-load.php\');
?>
Second Method:
<?php
define(\'WP_USE_THEMES\', false);
require (\'../blog/wp-blog-header.php\');
?>
Directory Structure:
/blog
|
|_ Wordpress installed here
/admin
|
|_ admin.php (I want to use wp functions here)
注意:我正在使用Writr theme 在我的wordpress博客中。