我使用为具有cliente自定义角色的不同用户上传文件。
我能够显示字段并使它们工作(虽然它们只在编辑用户时出现,而不是在创建用户时出现,但这是针对另一个问题的)。我现在试图实现的是上传文件到不同的文件夹为不同的用户。
以下是代码:
// Here we add a new user role, "cliente"
add_role( 'cliente', 'Cliente' );
add_filter('wp_handle_upload_prefilter', 'my_upload_prefilter');
a
我正在做wordpress多站点的工作。
当用户创建新站点时,他被赋予了administrator.He的角色,它的功能是
“编辑-用户”
“管理网络用户”,
‘编辑_用户’,‘促进_用户’。
但是,当用户试图在同一站点中编辑另一个用户时,将获得权限错误。
但如果我评论这句话:
`if(!current_user_can('edit_user', $userid))` in user-edit.php line around 148 and 100
它works.But用户角色不能更改。
有趣的是,用户具有“编辑_ user”的功能,我已经检查过很多次了。
在更新用户时,我会继续得到这个错误:
PHP Warning: Cannot modify header information - headers already sent by (output started at /wp-admin/includes/update.php:134) in /wp-includes/pluggable.php on line 866, referer: /wp-admin/user-edit.php?user_id=4&wp_http_referer=%2Fwp-admin%2Fusers.php
知道为什么吗?
我的header.php似乎不是以
当我试图激活我的插件时,出现了这个错误:
注意:第48行/home/gateway/domains/gateway.nl/public_html/wp-content/plugins/myplugin/includes/admin/admin.php中的未定义索引: HTTP_REFERER
这一行是这个块:
//change upload directory
public function user_upload_files_dir($upload) {
//check if this a user-edit page
$current_page = basename