Editable registration date field in user profile

The user_registered field is not in wp_usermeta, but wp_user. You should be using wp_update_user: add_action( ‘show_user_profile’, ‘extra_user_profile_fields’ ); add_action( ‘edit_user_profile’, ‘extra_user_profile_fields’ ); function extra_user_profile_fields( $user ) { ?> <h3><?php _e(“Información AbIbBEV”, “blank”); ?></h3> <table class=”form-table”> <tr> <th><label for=”user_registered”><?php _e(“Fecha de ingreso Empleado”); ?></label></th> <td> <input type=”text” name=”user_registered” id=”user_registered” value=”<?php echo esc_attr( get_the_author_meta( ‘user_registered’, $user->ID ) … Read more

Is there a way to identify a user in a custom REST API method? [duplicate]

I spent two days searching for a simple way without adding plugins. first in function.php where you define your api //enqueue the script which will use the api function api_callings_scripts() { wp_enqueue_script(‘score-script’, get_template_directory_uri() . ‘/js/ScoreSaving.js’, [‘jquery’], NULL, TRUE); // Pass nonce to JS. wp_localize_script(‘score-script’, ‘ScoreSettings’, [ ‘nonce’ => wp_create_nonce(‘wp_rest’), ]); } add_action( ‘wp_enqueue_scripts’, ‘api_callings_scripts’ ); … Read more

What are some best practices for user exit strategy?

Although you could create another class of users, I’d just do the following: Change their password to something really strong and random Change their email address to an invalid value (or maybe a variation of yours) so they can’t do a password reset. Maybe change their description/info to show that they are a ‘past employee’ … Read more