Tag Info

Hot answers tagged

5

Here's one way to add this feature using the following flowline : The admin updates the user option page: -> edit_user_profile_update or personal_options_update hooks activated -> edit_user() function is called -> wp_update_user() function is called within edit_user() -> wp_insert_user() function is called within wp_update_user() ...


2

I believe Crazycoolcam spelled the table incorrectly, user_meta vs usermeta. You may also want to define the else case, what happens if the table is not user. Try this: <?php $wpdb->add_database(array( //Connect to Users Database 'host' => DB_HOST, // I am using the same host for my two DBs 'user' => DB_USER, ...


1

You can include this code by creating a new custom plugin which help you to stop this when you deactivate the plugin. wp_schedule_event(time(), 'daily', 'my_dailyClearOut'); function my_clearOldUsers() { global $wpdb; $query = $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE datediff(now(), user_registered) > 7"); if ($oldUsers = ...


1

Well, it's not going to work because you won't always have the post value on each page (only when they have just logged in). So as soon as wp serves up the next page it won't have a the POST variable anymore. Why do you feel a need to do this? (Personally I cannot think of a good reason) If they need different capabilties, then You could simply create ...


1

This can be done easily with $wpdb, here's my approach: function GetTop2CategoryByUser($user_id, $taxonomy){ global $wpdb; $results=$wpdb->get_results( $wpdb->prepare( " SELECT tt.term_id as category, COUNT(p.ID) as count FROM $wpdb->posts p JOIN $wpdb->term_relationships tr ...


1

There are a few ways to accomplish this; 1) [easy] Send your user to the login screen and have them initiate the forgot password process 2) [moderate] Plugins (there are a few) free WordPress plugins, this looks useful, or you could search http://wordpress.org/plugins/search.php?q=reset+password and probably lots of commercial ones, but here is one 3) ...


1

I think you will require to custom develop some part of it but most of it can be done with Contact Form 7 plugin. You can create forms with upload fields very easily in Contact Form 7. And you can make it visible for loggenin users only like this. <?php if ( is_user_logged_in() ) { echo do_shortcode('[contact-form-7 id="91" title="Form"]'); ...


1

You can use jQuery to disable the display name select. function disable_display_name() { global $pagenow; if ( $pagenow == 'profile.php' ) { ?> <script> jQuery( document ).ready(function() { jQuery('#display_name').prop('disabled', 'disabled'); }); </script> <?php ...



Only top voted, non community-wiki answers of a minimum length are eligible