Try dumping your data and you should see the problem:
function coinDeposit() {
$current_user = wp_get_current_user();
var_dump($current_user); die;
update_user_meta( $ID, 'depositAddress', $account);
}
The user object is empty. That is because a newly created user is not automatically logged in. There is an email confirmation step, and then login. Until that login, wp_current_user()
isn’t going to give you a user object.
Fortunately, user_register
is passed the user ID by the Core. Just use that:
function coinDeposit($ID) {
$coin = new jsonRPCClient('http://user:[email protected]:14022/');
$account = $coin->getaccountaddress($ID);
update_user_meta( $ID, 'depositAddress', $account);
}
add_action('user_register', 'coinDeposit');
Related Posts:
- How To Get User Data in Callback Function for pre_user_nicename?
- Register new user, assign custom role then send email
- Custom registration field to SQL database
- wp_headers vs send_headers. When to use each?
- How many filter/action hooks are healthy?
- Earliest hook to reliably get $post/$posts
- Remove Editor From Homepage
- What does (10, 2) mean when used with add_filter
- Filter username field on registration for profanity and unwanted words
- Valid characters for actions, hooks and filters
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- How to check if a hook is hooked or not?
- Store source permalink on XMLRPC calls
- How to make post and comment count unclickable with dashboard_glance_items hook
- Hook into admin post list page
- How do I know if author field was changed on post save?
- About Hooks and Filters
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- changing variable through filters or action hooks
- Too many actions/filters!
- Apply a filter only once
- How to get list of all hooks of current theme / plugin?
- Making a class available via actions filters
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- Explanation for remove_filter used in the below code [closed]
- How to change the blog title with add_filter? details below
- What’s the best way to split admin-only functionality in the theme’s functions.php file?
- Filter list by a unique meta value dilemma
- return values from hooks do_action and apply_filters, which is better
- How to get all the predefined do_action() calls from an active theme
- Is it possible to track down Actions and Filters?
- When to use actions and when to use filters
- Return a custom value in a function added to an action hook
- Same Conditionals Not Working on Two Different Hooks
- get_header and hook avoid normal call
- Can the wp_filter object hold multiple values with the same key
- apply_filters/do_action tag characters limit
- Is there a filter called ‘network_admin_init’?
- Filter taxonomy admin pagination
- Insert term when page is published – avoid duplicates after edits
- Are there actions or filters I can use for Ajax calls?
- Capture post content before page renders
- Correct method of redirecting user login
- How to filter for user registration, be able to throw error message
- How to remove action with slashes and arrows?
- Can the wordpress color palettes by changed through Javascript?
- How do I use remove_action on an add_action that uses an array?
- Changing WordPress core without hacking core
- How to pass variables to custom filter from multiple functions
- Comment search plugin
- How to customize the “Insert/edit link” popup box?
- Proper after_setup_theme and wp_head cleanup
- How to get a single hook from wp_head()?
- Add a filter inside an action init
- Is it possible to apply_filter on a wp_ajax_ action?
- Filter for when the post is updated
- Add a filter to an action [closed]
- Avoid user registrations with specific email provider
- How can I specify the post status of an untrashed post?
- Filter get_page_by_path()
- why require – does not load filter
- Remove actions/filters that are set with create_function()
- Most performant/functional way to add actions/filters?
- Remove tags without a specific meta key from “choose from the most used tags”
- What is the action hook to use if you want to capture the new password during password change?
- Use has_filter on comment_post
- Echo string in admin panel footer beside version no
- How to change default text for specific post type
- How can I edit comment meta value before it is saved?
- Disable sanitize_file_name on upload without modifying functions.php
- Register users by e-mail
- Redirect after post deleted
- Making an add_filter() call from within an add_filter() call
- Plugin default settings hook
- alternative to the_content filter
- How would I use a filter to remove header banner on certain post types
- Action hook to control access to certain parts of my site
- Finding actual functions added to hooks and filters
- Replace Data In Post & Update Meta Field Post Is Saved
- How to pass a variable between filter/action functions?
- style_loader_tag not changing stylesheet to preload
- Adding link options in insert/edit link dialog window
- how to use apply filter for Class?
- How can I see exactly what arguments are being passed through a filter so that I may modify them?
- WordPress set featured image to first image of the post
- Does anybody know what the $current_screen ->id for customizer.php is?
- adding an action inside if condition not working
- Using add_filters() , apply_filter(), add_action() and do_action() in extending a plugin
- Action for opening attachment or manipulating all attachment links
- Put data in my-account/view-order/id/ page
- What action/filter can be used for modifying the page to be rendered?
- Hook inside a hook
- Filter and validate user role in registration
- check, if any “add_action” function contains string XXXXXXXXX
- Remove action added from class
- Hook into ‘when user logs in’ [persistent login]
- Is this correct usage of filters in WordPress [closed]
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- can’t output gray scaled image I’ve created using add_image_size
- Can you call a filter hook by “add_action”?