User registration add user ID?

You can’t add the ID at registration because there is no ID until after the user has registered. (See a possible way around this near the bottom). You could tack on the ID after the registration with the user_register hook. function add_ID_wpse_99390($a) { global $wpdb; $user = new WP_User($a); $wpdb->query(“UPDATE {$wpdb->users} SET user_login = CONCAT(user_login,’_’,ID) … Read more

Delete old post with new post

If i understand the question correctly, you want that whenever a user adds a new post, all his/her previous posts should be deleted. I wonder why would you do that!! 🙂 But anyway, you can use this code. add_action(‘save_post’, ‘delete_prev_posts_by_user’, 10, 2 ); function delete_prev_posts_by_user( $post_id, $post ){ if( ‘publish’ == $post->post_status ){ $the_special_category_id = … Read more

delete user not working

WordPress should give this option below Attribute all posts to: Anyhow, I wrote a post on this (Clean Comments Table After User Deleted) Edit Also, you can move your all posts from deleted users to admin user. global $wpdb; $admin_id = 1; // Assign admin user id here $posts_table = $wpdb->prefix . ‘posts’; $users_table = … Read more

Custom search by several options send on form not works

put value of keys and check results.(use get_users function to query users) $args=array( ‘relation’=>’AND’ ); if(isset($_GET[“nome_of_city”])){ $arg[]=array( ‘key’ => ‘your_key_name_1’, ‘value’ => $_GET[“nome_of_city”] ); } if(isset($_GET[‘name_of_neighborhood’])){ $arg[]=array( ‘key’ => ‘your_key_name_2’, ‘value’=>$_GET[‘name_of_neighborhood’], ‘compare’=>’IN’ ); } if(isset($_GET[‘name_of_course’])){ $arg[]=array( ‘key’ => ‘your_key_name_3’, ‘value’=> $_GET[‘name_of_course’], ‘compare’=>’IN’ ); } $users=get_users($args); foreach ($users as $user) { echo ‘<li>’ . $user->user_email . … Read more

Permalink structure as code in back-end?

Your code works to create links, and WordPress should make a valiant effort to find the correct post, but it doesn’t get complete permalinks. To do that you will need to query the database for the post and construct a permalink if one is found. function transform_pseudo_anchor_wpse_101201($match) { global $wpdb; if (isset($match[1])) { $name = … Read more

Privacy in WordPress

You can combine these features by using the free versions of two plugins, Profile Builder that allows you to create a register form, the option of an admin approval and email confimation, login options; and Members that gives you control over which users (by role) have access to post content.

Show Custom Post From Logged In Author

I fixed the issue myself. What i was doing wrong was the query_posts line i had read query_posts( array( ‘post_author’ => $current_user->ID,’post_status’ => ‘publish’ , ‘post_type’ => array( ‘user_lists’ ) ) ); And the correct way should be query_posts( array( ‘author’ => $current_user->ID,’post_status’ => ‘publish’ , ‘post_type’ => array( ‘user_lists’ ) ) );