• Resolved joeinc

    (@joeinc)


    I have an ACF field group which is added to my register form, I found a gist from WP User Manager here: https://gist.github.com/wp-user-manager/290e64a10a47d5873d4192d7b0d7b6ca

    This gist seems to let you specify the custom fields you would like to be notified when they are updated on a user profile, is there a way to incorporate the ACF fields into this? As well as the standard wordpress fields such as email address etc.

    Would appreciate any help on this

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Mark Kevin

    (@mkesteban08)

    Hi @joeinc ,

    It’s practically the same format that you would want to follow if you would like to proceed with such. Take note that ACF will use the field’s name as the meta_key and the value entered as the meta_value.

    You will need to use only the meta_value of the field and use it to print like from this line:
    $message .= sprintf( esc_html__( ‘Website: %s’, ‘wp-user-manager’ ), $user->user_url ) . “<br>”;

    From the example above, you will just need to change user_url to what the field has as a meta_value and nothing else.

    I hope that this could help. Have a nice day!

    Best regards,
    Mark

    Thread Starter joeinc

    (@joeinc)

    Thanks for your reply @mkesteban08 I did try to add both the ACF field names and the field key to the below but neither seemed to work, do you have any ideas?

    $field_keys_to_alert = array(
    		'wpum_custom_field',
    	);
    Plugin Author WP User Manager

    (@wpusermanager)

    The ACF field names will be different. Best to error_log( print_r( $_POST, true) ); in that code to see what they are named.

    Thread Starter joeinc

    (@joeinc)

    Thanks @wpusermanager, I can get the current value of a user’s ACF field using this $user->site_name (site_name being the name of the ACF field) but if I put ‘site_name’ in the $field_keys_to_alert array and then change the value using the account page I don’t seem to receive an email alert at all. Not too sure what else to try for this

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Admin Notification for user updating ACF user fields’ is closed to new replies.