Title: functions.php changes does not apply
Last modified: May 14, 2019

---

# functions.php changes does not apply

 *  [Emil8250](https://wordpress.org/support/users/emil8250/)
 * (@emil8250)
 * [7 years ago](https://wordpress.org/support/topic/functions-php-changes-does-not-apply/)
 * Hi, first of all, it’s my first time posting here, so if I’ve missed something
   important, please let me know.
 * I’ve tried to add the following at the buttom of my functions.php file:
 *     ```
       function create_sl_user() {
           $url = "URL HER";
           $user_id = "USERID HER";
           $data_string = 'JSON + $user_id';
   
           wp_remote_post($url, array(
               'method' => 'POST',
               'httpversion' => '1.0',
               'headers' => array(),
               'body' => $data_string
           ));
       }
   
       add_action('user_register', 'create_sl_user', 1);
       ```
   
 * But when I save the file and register a new user, nothing happens.
    It was supposed
   to create a new user in my own system.
 * I’ve tested my API with PowerShell and JavaScript, where it works as intended.
 * //Emil

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Emil8250](https://wordpress.org/support/users/emil8250/)
 * (@emil8250)
 * [7 years ago](https://wordpress.org/support/topic/functions-php-changes-does-not-apply/#post-11531042)
 * For the record, I’m using WordPress 5.2 with the “Hestia” theme.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years ago](https://wordpress.org/support/topic/functions-php-changes-does-not-apply/#post-11531759)
 * What part of WP are you sending a POST request to? The REST API? The API requires
   proper [authentication](https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/)
   before POST requests will be honored.
 * To [create a user](https://developer.wordpress.org/rest-api/reference/users/#create-a-user),
   you need at least username and email. User ID is not part of the data because
   WP auto-assigns IDs. If you have some other sort of ID data to save, it can be
   saved in user meta.
 *  Thread Starter [Emil8250](https://wordpress.org/support/users/emil8250/)
 * (@emil8250)
 * [7 years ago](https://wordpress.org/support/topic/functions-php-changes-does-not-apply/#post-11545496)
 * I am trying to do a HTTP Post to a remote API, not wordpress’s own API.
 * I want it to make the above post, when a new user registers in WP, so that the
   same account is created in my other system, if that makes sense?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years ago](https://wordpress.org/support/topic/functions-php-changes-does-not-apply/#post-11546604)
 * Ah, I see. print_r the value returned by wp_remote_post(). The problem with print_r()
   or var_dump() is your browser may not be expecting output at this point, so the
   output is best captured and output to a log file. If you don’t want to fuss with
   a file write routine, you could simply email yourself the output. For example:
 *     ```
       $response = wp_remote_post( $args );
       wp_mail('your_email@goes.here', 'Remote post data returned', print_r( $response, true ));
       ```
   
 * If the returned data is a WP_Error object, the message it contains will give 
   you a clue about the problem. If it’s an array of server response data, the POST
   was successful as far as this end is concerned and the issue is likely at the
   other end.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘functions.php changes does not apply’ is closed to new replies.

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [login](https://wordpress.org/support/topic-tag/login/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [register](https://wordpress.org/support/topic-tag/register/)
 * [user](https://wordpress.org/support/topic-tag/user/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/functions-php-changes-does-not-apply/#post-11546604)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
