Get user id after save post
The action save_post gets triggered after a post is saved, not after a user is saved. For this you need the action profile_update.
The action save_post gets triggered after a post is saved, not after a user is saved. For this you need the action profile_update.
There is an action https://developer.wordpress.org/reference/hooks/check_passwords/ which can be used to add your checking code. You could save your ‘strength indicator’ by adding it to $_POST and then re-accessing it when the user data is saved. Actions for that are https://codex.wordpress.org/Plugin_API/Action_Reference/user_register and https://codex.wordpress.org/Plugin_API/Action_Reference/profile_update. These actions are listed on https://codex.wordpress.org/Plugin_API/Action_Reference. Alternatively when looking for an action or … Read more
Welcome, either use edit_user_profile_update which is passed user_id add_action(‘edit_user_profile_update’, ‘save_extra_fields_country_institution_user_form’ ); function save_extra_fields_country_institution_user_form($user_id){ # again do this only if you can if(!current_user_can(‘manage_options’) || !current_user_can( ‘edit_user’ )) return false; # save my custom field $result = update_user_meta($user_id, ‘verifier_assign_country’, ‘test3′); } OR when I tested on ‘edit_user_profile’, the whole user object is being passed, not just the … Read more
It need not be very complicated. You can simply create a pattern like 2018-09-07-ABC (suffix of ABC) for the date 2018-09-07. Set up the password creation/validation logic like password = md5(‘2018-09-07-ABC’). An administrator if they know the pattern, they can anytime goto any online md5 utility such as http://www.md5.cz and enter the pattern for current … Read more
There is no way around uniqueness being necessary, with the effects you described. Personally I wouldn’t remove the part that makes ensuring uniqueness of the slug much easier, like the author part, in my mind it is just a sign of a well structured site. Anyhow, there is validate_username() function with the validate_username hook. You … Read more
But the trick seems to be when to fire it. This is correct! When remove_user_from_blog fires, the removal has not happened yet, rather it’s about to happen and this is your chance to step in and do things beforehand, e.g. cleanup. The wpmu_delete_user function should be the one to go i guess. Yes, that would … Read more
The data you are looking should not, by default, be located in “C:\Documents and Settings\Default User”. That is the location of the default user profile, which is the template for new user profiles. Its only function is to be copied to a new folder for use as a user profile when a user logs onto … Read more
The first thing you have to do is create the shortcode you need: function wpusers_shortcode( $atts ) { // Attributes $atts = shortcode_atts( array( ‘group’ => ‘logistics’, ), $atts ); // code here } add_shortcode( ‘wpusers’, ‘wpusers_shortcode’ ); Now you have a self-closing shortcode. Now it’s time to consult the database to get all registered … Read more
You’re handling the request incorrectly, load-users.php is not the correct hook Instead, use handle_bulk_actions-users add_filter( ‘handle_bulk_actions-users’, ‘sanzeeb_bulk_action_handler_user’, 10, 3 ); function sanzeeb_bulk_action_handler_user( $redirect, $action, $object_ids ) { // let’s remove query args first $redirect = remove_query_arg( array( ‘assign’ ), $redirect ); // do something for “Assign” bulk action if ( $doaction == ‘assign’ ) { … Read more
Here’s a basic concept how I’d do the word counting and showing the count. Hopefully this serves as a starting point. I think it would be a good idea to store the word count in a transient, so it isn’t calculated on each and every author archive page load. function author_word_count() { // get current … Read more