我正在WordPress版本3.4.2中创建一个插件。当管理员提交表单时,将在我的插件目录中创建一个新文件夹,并在该新文件夹中保存一个文件。
但它给了我以下错误:
error : The file has not been created
$dir = plugins_url()."/folder-name/;
上述代码返回以下路径:http://localhost/website/wp-content/plugins/abc/folder-name
mkdir($dir, 0777, true);