Delete Current Author Frontend user while delete custom post type

I don’t think $post will be defined where you are using it. Try relying on the post ID that is passed to your function instead: add_action(‘before_delete_post’, ‘my_deleted_post’); function my_deleted_post($post_id){ if ( “agency” == get_post_type( $post_id ) ) { require_once(ABSPATH.’wp-admin/includes/user.php’ ); wp_delete_user( intval( get_post_field( ‘post_author’, $post_id ) ) ); } } Be aware that wp_delete_user() will … Read more

Create user with author role but no login information

In a plugin, you can create the users with whatever information you want them to have (First name, last name, etc). The only required user fields are username, email and password, which you can specify. https://codex.wordpress.org/Function_Reference/wp_create_user As Ahmed Mahdi stated above, you can create the users but not send them the login information.

Updating User Profile with AJAX not working

This whole thing works as far as I can tell. In the future it may be easier to debug things by using PHP error_log() to write to the debug.log at certain points, like inside your ajax callback. If you’re only wanting to run this ajax for logged in users, you can drop the wp_ajax_nopriv hook … Read more

New user notification doesn’t include activation link

WordPress 4.9.0 introduced 2 filters into the new user notification mail function (wp_new_user_notification): wp_new_user_notification_email – to customise the email sent to User wp_new_user_notification_email_admin – to customise the email email sent to Admin We can ignore the second as this is the email sent to the admin the format is different from that in your question. … Read more

How can I add data to a custom column in the Users section of the wordpress backend?

manage_users_custom_column is a filter hook, so you should use add_filter() and not add_action(). Which also means you should return the output instead of echoing it. The column name is the second parameter and not the first one — which is the current value for the current column. So try with: function last_name_value($output, $column_name, $user_id) { … Read more