Skip to:
Content
Pages
Categories
Search
Top
Bottom

A Hook After Registration And Profile Editing

  • Hi there,

    I am looking for a hook that runs after each user registers, and after she updates her profile. I want to retrieve their latitude and longitude based on their address and zip code, and save it in another table, and I’m looking for a perfect place to put in this piece of code.

    Any ideas?

    Thanks a lot in advance!

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

  • rich
    Member

    @etivite

    You probably want

    bp_core_activated_user (maybe sign up user – but depends on your workflow)

    &

    xprofile_updated_profile (if you’re keying of xprofile data)

    Thanks for the help and the great website you’ve put together, @etivite.

    Looking at your website, I found another (and suiting my purposes in a better way) action called something like xprofile_profile_field_data_updated or something like that. According to your website and the BuddyPress code, I should receive the field_id and the value, which I think means that the id of the field that has been changed, plus the value, will be sent to my function. However, adding my function to that hook with add_action (like add_action(‘xprofile_profile_field_data_updated’, array(‘Naam’, ‘test’), 10, 2)), and then doing a print_r when logged in with admin gives me a 1 as $field_id, and ‘admin’ as $value.

    How does this work? Isn’t it supposed to give me, say, the field ID of zip_code and the new value?

    Thanks!


    rich
    Member

    @etivite

    [php]
    function something( $field_id, $value ) {
    //…
    }
    add_action( ‘xprofile_profile_field_data_updated’, ‘something’, 1, 2 );
    [/php]

    see https://codex.wordpress.org/Function_Reference/add_action

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘A Hook After Registration And Profile Editing’ is closed to new replies.
Skip to toolbar