MySQL query to mass change role of users
MySQL query to mass change role of users
MySQL query to mass change role of users
Best way to find if a code works or not is to actually try it 😉 On the face of it, it doesn’t look like you are trying to handle storing the user ids in an array or any serialized way at all.
I recommend backing up the database before making any major/bulk changes to it. First you need to get all users with the role “contributors”, then update their roles to “author”. $contributors = get_users(array(‘role’=>’contributor’)); foreach($contributors as $contributor){ wp_update_user(array( ‘ID’ => $contributor->ID, ‘role’ => “author”) ); } echo “done updating contributors to authors”; You could have this … Read more
I have found a great tutorial here that have helped me to developing a custom user search. This is my solution: <?php /* Plugin Name: Simple User Listing Description: Create a simple shortcode to list our WordPress users. Author: Damiano Fossa Version: 1.6.3 */ function sul_user_listing($atts, $content = null) { global $post; global $wpdb; extract(shortcode_atts(array( … Read more
I didn’t test it but I think you could use this plugin https://wordpress.org/plugins/wp-ban/ that should solve these issues
What about putting the city/regions/whatever into an array you can loop through? Something like this: $cities = array( ‘Richmond’, ‘Chicago’, ‘New York’ ); foreach ( $cities as $city ) { ?> <h2><?php echo $city; ?></h2> <ul><?php foreach ( get_users_by_meta_data( ‘school_division’, $city ) as $user ) { ?> <li><?php echo $user->first_name; ?> <?php echo $user->last_name; ?></li> … Read more
Accessing current users data within a plugin
Where are $current_user->allcaps set?
WordPress registration without wp-login.php and wp-admin folder, is it possible?
You can try to inject an autocomplete attribute into the form element on that page. There is a dedicated action for that: user_edit_form_tag. add_action( ‘user_edit_form_tag’, function() { print ‘ autocomplete=”off”‘; }); If that doesn’t help – and it looks like the new IE has a bug here – you could try the solution from this … Read more