Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_update_account( $user_id, $user_meta ) {
- $account_id = get_user_meta( $user_id, 'ac_account_id', true );
- if ( ! empty( $account_id ) ) {
- $params = wp_fusion()->crm->get_params();
- $data = array(
- 'accountCustomFieldDatum' => array(
- 'accountId' => $account_id,
- 'customFieldId' => 2,
- 'fieldValue' => 'NEW VALUE',
- ),
- );
- $params['body'] = json_encode( $data );
- wp_remote_post( wp_fusion()->crm->api_url . '/api/3/accountCustomFieldData', $params );
- }
- }
- add_action( 'wpf_user_updated', 'my_update_account', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement