Can we validate user email changes?

You can use this hook to send a mail to your old email address <?php add_action( ‘profile_update’, ‘my_profile_update’, 10, 2 ); function my_profile_update( $user_id, $old_user_data ) { //Load new user data by uid and compare with old data // Email code about profile changes } ?> I think this should work for you.

Verify Submitted Form Values and Show Warning Messages with Setting API

First add a validation callback to your register_settings: register_setting( ‘settingsapi_optiongroupname’, ‘settingsapi_optionname’,’validation_callback’); then define validation_callback: function validation_callback($input){ //check if all is good //If so then return the wanted value to be saved //If Not then hook your admin notice function and return null to be saved ex: if ($something){ return $input; }else{ add_settings_error(‘unique_identifyer’,esc_attr(‘settings_updated’),__(‘Settings saved.’),’updated’); add_action(‘admin_notices’, ‘print_errors’); … Read more

WordPress Phone Verification

Of course this is possible it would just require some custom coding. This is an open ended question so I’ll give you an open ended answer of how I may go about this. Add phone number field to user contact Use the profile_update hook to store a random code associated with that number Create a … Read more

How to update author display name on blog posts based on user role

The main culprit is this line $current_user = wp_get_current_user(); As the name “get current user” suggests, it gets you the currently logged in user. That is not what you want. Being in the the_author filter, you can use the global $authordata variable, as the function calling the filter relies on it as well. function add_verification_bagdge_to_authors($display_name) … Read more

tech