• Resolved cjsdfw

    (@cjsdfw)


    Hi,
    First of all thanks for your wonderful plugin.

    I am getting a strange behavior when cloning from a template through the API and want to find out if is expected behavior or not:

    If I clone from template using the NS Cloner GUI the new cloned site includes the user defined in the template: in my case is the super admin.

    However, I clone a site using the same template from the API: making the call from within another plugin, then the user is not cloned or is deleted (no way for me to tell) but the super admin user is not defined in the new site.

    I am using the Free version, in case it makes a difference. Also it seems to me this just stated happening as off Version 3.1.0 though I am not sure as I don’t have the previous install available.

    Please advice. Thanks ahead for your reply.
    Carlos

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Never Settle

    (@neversettle)

    Hello! Thanks for the feedback and the question. Whether it’s called from the GUI or from custom code running in another plugin the Cloner’s ns_wp_create_site() function which is part of the default core create_site step calls the wp_get_current_user() in order to pass that to WP’s wpmu_validate_blog_signup() function. The only thing I can think of is that for some reason wp_get_current_user() might not be able to get the current user during the context in which it’s running. Otherwise, the Cloner’s behavior between GUI and remote call should be identical in most cases unless something else interfere’s with the standard WP functions it relies on like wp_get_current_user().

    It’s important to note that the Free version will NOT copy users. So, if there’s an admin / super admin on the source site and the Cloner is called remotely as a different user, only the different user will be added to the new site. This is expected behavior.

    Also, if you are calling Cloner remotely from a non-user context like wp-cron or some other automated method, it’s possible that no user will be added to the new clone site which is also expected.

    Hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘Clone users from template through API’ is closed to new replies.