Set a minimal number for next user_id

You can access via phpMyAdmin and change the Auto Increment number to be your next user ID number. Open phpMyAdmin Go to SQL tab at the top. Enter the following: ALTER TABLE ‘wp_users’ AUTO_INCREMENT=32200906; Now create a new user and the ID should be 32200906

Send email to user if their role is changed to Author

Check for the value of $new_role before sending the email, if it isn’t author then do nothing function user_role_update( $user_id, $new_role ) { if ( $new_role == ‘author’ ) { $site_url = get_bloginfo( ‘wpurl’ ); $user_info = get_userdata( $user_id ); $to = $user_info->user_email; $subject=”Role changed: ” . $site_url . ”; $message=”Hello ” . $user_info->display_name . … Read more

Email Subscribe for Downloads in WordPress

The following is not the best solution. It is a simple solution that can be / should be improved and it is intended only to give you a direction. Create a CPT ‘resource’. register_post_type(‘resource’, $args); For args refer here. Under your WP root folder (the one where you have /wp-admin, /wp-includes and /wp-content), via FTP … Read more

How to create a specific role to manage users

The following capabilities are needed to fully manage users: create_users edit_users promote_users delete_users remove_users list_users Remove role, you’ve created with Members plugin. Add the following code to functions.php of your active theme: add_role( ‘users_manager’, __( ‘Users Manager’ ), array( ‘read’ => true, ‘list_users’ => true, ‘promote_users’ => true, ‘remove_users’ => true, ‘edit_users’ => true, ‘create_users’ … Read more

get Discussion setting in wordpress

this code may help you $status = get_option(‘comment_registration’); // 1 : Yes , user must be registered and logged in for commenting // 0 : No (default) You can use the following code for the comment section if (comments_open($postId)) { if (get_option(‘comment_registration’) == 0 || is_user_logged_in() ){ //render comments section }else{ echo “You must login … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)