Mobile User Registration

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;
}