Support Forum
This is a directory-based multisite with about 30 sub-sites
We are using WPMU's Batch Create plugin to add multiple members to multiple subsites. This saves an enormous amount of time. However, SP will not recognize the newly added members. It does recognize members added manually via the WP dashboard.
The confusing thing is that if we install and activate SP on a new subsite, when it creates its initial user list, it recognizes all the members, regardless of whether they were added by Batch Create, another similar plugin, or by the WP Dashboard. So clearly, SP knows how to recognize the users.
But once SP is set up, it no longer recognizes any new users added with the plugin.
One interesting quirk, is that, on initial installation, SP takes the user list from the main site, not just from the subsite. But after installation, even when we specifically add a user to a subsite, SP will not recognize it if Batch Create is used (or any similar plugin - we've tried three).
Is there a patch that will enable SP to recognize any user added to a subsite (or to the main site, as that happens first)?
When I contacted WPMU, they suggested the following patch to functions.php, but it made no difference when we tried it.
add_action( 'add_user_to_blog', 'wpmu_sp_create_member_data', 99, 3 );
function wpmu_sp_create_member_data( $user_id, $role, $blog_id )
{
switch_to_blog($blog_id);
if(is_admin() && is_plugin_active('simple-press/sp-control.php') {
require_once WP_PLUGIN_DIR . '/simple-press/sp-control.php';
require_once WP_PLUGIN_DIR . '/simple-press/sp-api/sp-api-wpdb.php';
require_once WP_PLUGIN_DIR . '/simple-press/sp-api/sp-api-users.php';sp_create_member_data( $user_id );
}
restore_current_blog();
}
There is a continuing error on install (see image below) where SP cannot unzip the resources part1 file on install, even though the directory it is in has full read/write permission for the user apache that SP uses. It has to be unzipped manually. One confusing thing is that it refers to Part 2 but lists the file Part 1. Not sure if that is relevant to this issue.
Any help appreciated!
I don't know how techie you are but WordPress communicates via a system of program 'hooks' - which I always suggest people think of as a messaging system. This system informs plugins of actions and events that are taking place so that plugins can respond accordingly.
When a plugin is written that takes over a normal. core WP function, then it is imperative that it also uses the same hooks to inform plugins of the usual events. My initial guess is that your member creation plugin is not doing this.
For reference and so you can go back to the authors and ask them this question - these are the hooks that WordPress actions and that Simple:Press responds to:
add_action('wpmu_new_user', 'sp_create_member_data', 99); add_action('wpmu_activate_user', 'sp_create_member_data', 99); add_action('added_existing_user', 'sp_create_member_data', 99); add_action('wpmu_delete_user', 'sp_delete_member_data'); add_action('remove_user_from_blog', 'sp_delete_member_data', 10, 2); add_action('user_register', 'sp_create_member_data', 99); add_action('delete_user', 'sp_delete_member_data'); add_action('profile_update', 'sp_update_member_data'); add_action('set_user_role', 'sp_map_role_to_ug', 10, 2); add_action('add_user_role', 'sp_map_role_to_ug', 10, 2); add_action('delete_user_form', 'sp_delete_user_form', 10, 2);
These show the hook (left argument) and the SP function that is invoked when a hook is called (right argument)
YELLOW
SWORDFISH
|
1 Guest(s)