mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix generate dummies and api request method
This commit is contained in:
@@ -51,10 +51,21 @@ class UM_ADDON_generate_random_users {
|
|||||||
$json_url = add_query_arg('results', $total_users, $json_url );
|
$json_url = add_query_arg('results', $total_users, $json_url );
|
||||||
$arr_post_header['results'] = $total_users;
|
$arr_post_header['results'] = $total_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$response = wp_remote_get( $json_url, array('timeout' => 120 ) );
|
||||||
|
$json = '';
|
||||||
|
|
||||||
$response = file_get_contents( $json_url );
|
if( is_array($response) ) {
|
||||||
$json = json_decode( $response );
|
if( isset( $response['body'] ) && ! empty( $response['body'] ) ){
|
||||||
|
$json = json_decode( $response['body'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( is_wp_error( $response ) ){
|
||||||
|
wp_die( $response->get_error_message() );
|
||||||
|
}
|
||||||
|
|
||||||
if( ! empty( $json ) ){
|
if( ! empty( $json ) ){
|
||||||
|
|
||||||
remove_action('um_after_new_user_register', 'um_after_new_user_register', 10, 2);
|
remove_action('um_after_new_user_register', 'um_after_new_user_register', 10, 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user