Mobile User Registration

I am writing an android (and eventually iphone) app that is proposing to register a user to a wordpress site. The intent is to have the user registration solely through the mobile device and not through a website front end. The app will update the wordpress site and the user will be able to login in to see his data. I have a general idea on how to use the wp hooks with json to do the mobile registration. However, is there a way to the registration process without enabling “anyone can register” in “general/settings”? (note: I looked through all the questions using “Mobile User Registration” but did not see any related.). Thanks in advance

Related posts

Leave a Reply

1 comment

  1. New users CAN be allowed to register remotely without setting “anyone can register” in “general/settings”. The client is android and in addition to the android java client code using the ‘org.xmlrpc library’, the following was added to ‘functions.php’ in the child theme:

    function xml_add_method( $methods ) {
        $methods['xxx.wp_create_user'] = 'xxx_wp_create_user';
        return $methods;
    }
    
    add_filter( 'xmlrpc_methods', 'xml_add_method');
    
    function xxx_wp_create_user( $args ) {
        $uname = $args[1];
        $pword = $args[2];
        $email = $args[3];
       $user_id = wp_create_user( $uname, $pword, $email ); 
       return $user_id;
    }