Title: Using Action Hooks
Last modified: August 30, 2016

---

# Using Action Hooks

 *  [rflores](https://wordpress.org/support/users/rflores/)
 * (@rflores)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/using-action-hooks/)
 * Got a project with WordPress that uses the wp-client & woocommerce plugin. New
   users get registered on checkout. I need to call a 3rd party’s REST API to update
   a remote database when new users are registered and when current users get updated.
   I also need to update product subscriptions through the 3rd party’s REST API.
 * I created my own plugin to do this but I’m pulling my hair out because I can’t
   figure out how to do this. I tried using an action hook for either the WordPress“
   user register” and I even tried to use the WP-Client action hook “wpc_client_new_client_registered”.
 * I tried using echo statements to see if they fire off but all that happens is
   that the checkout complete page commences. How do I use these hooks and how can
   I get the registered user’s data so I can use cURL to call the REST API?

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/using-action-hooks/#post-6758204)
 * ‘user_register’ should fire, but using `echo` to test this probably will not 
   work. `echo` is often inappropriate in many action callbacks because the browser
   is not yet expecting content from the server. You need to use something independent
   of browser state, either through output buffering or using `error_log()` or some
   other file write function. I know at least one dev who uses `wp_mail()` for this
   purpose, emailing himself debug data 🙂

Viewing 1 replies (of 1 total)

The topic ‘Using Action Hooks’ is closed to new replies.

## Tags

 * [action hook](https://wordpress.org/support/topic-tag/action-hook/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [wp client](https://wordpress.org/support/topic-tag/wp-client/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/using-action-hooks/#post-6758204)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
