Tag Info

New answers tagged

0

I would highly recommend Daniel's much simpler solution over the one currently selected as correct: $user = get_userdata( $user_id ); if ( $user === false ) { //user id does not exist } else { //user id exists }


0

As indicated by @David Gard, this can easily be done: <?php remove_action( 'add_option_new_admin_email', 'update_option_new_admin_email' ); remove_action( 'update_option_new_admin_email', 'update_option_new_admin_email' ); /** * Disable the confirmation notices when an administrator * changes their email address. * * @see ...


0

The QA that you have linked to is related but not needed here. meta_value_num is still not part of the user_query core and so, your meta_value_num parameter has no effect on the query. Just use meta_value as described on codex and you'll get what you want.


0

You could try something like this. DELETE FROM wp_users WHERE ID in ( 5506, 5507,... ); Make sure to try it on a staging area first and backup your database.


0

Have you tried the Stop Spammers plugin? https://wordpress.org/plugins/stop-spammer-registrations-plugin/ I have found that can be pretty effective - not 100% - but good at stopping spam registrations - you can add various APIs. I don't think you can do the CSV thing you need specifically, but I'm pretty sure you can cut into your existing db - and ...


0

I think, that's generally not that good idea, but however: 1) this way you can disable errors with not filled in email, add to your functions.php add_action( 'user_profile_update_errors', 'remove_empty_email_error' ); function remove_empty_email_error( $arg ) { if ( !empty( $arg->errors['empty_email'] ) ) unset( $arg->errors['empty_email'] ); } ...


0

In the DB, the wp_user_roles option in wp_options was empty. I copied the value from the same option in wp_2_options, as I had already added another blog. Also, every user from the original blog (it was up and running before being changed to a network) had nothing listed against both the wp_capabilities and wp_user_level options in wp_usermeta. Because of ...


0

When sharing wp_users and wp_meta there is another problem, other wordpress installation does recognize the users but it does not recognize the roles of users coming from the other website. The role shows up as undefined. So, you edited your wp-config.php as required: define('CUSTOM_USER_TABLE', 'someprefix_users'); define('CUSTOM_USER_META_TABLE', ...


0

A bit late to answer this, but since its coming up for relevant search, this will be of use to somebody : Wordpress uses EAV database schema for part of its database implementation. Along with the directly accessible post related details in wp_posts, numerous meta is posted to wp_postmeta table for each post. Tags and whatnot. Problem with that is, if ...


1

Two options. The first will keep you away from custom SQL, and should be a lot more efficient than what you currently have. It runs two queries, one to get the user ID with the highest hourly rate, and then again to get the lowest. You need one more query to update the user meta cache & then you're home free: $query = new WP_User_Query; $users = array( ...


0

I think the wp_signon() function is unable to set the login cookies because you are calling it after the page headers have being sent. Try moving your auth code out of dlf_process() and into a separate function like this: function dlf_login() { if ( isset( $_POST['dlf_submit'] ) ) { dlf_auth( $_POST['login_name'], $_POST['login_password'] ); ...


0

If you know something about databases, and have access to the back end SQL database (most likely through Cpanel/phpMyAdmin, you can see the structure of the database, including the columns (fields) and their attributes. Knowing this, you can export an Access query into an Excel file with the same fields and attributes as the BuddyPress SQL table, save the ...


0

Have you tried including the wp-load.php file in your external script ? require_once("/path/to/wordpress/wp-load.php");


0

There is various approach you could take. All you need to do essentially is to get the author's role and put it in a statement of sort. For example, let's get the author role first by: // inside the loop $author_role = get_the_author_meta('roles', $post->post_author); Then just use do a if statement like: if ($author_role == 'contributor') { echo ...


0

Thanks the the replies. I solved my problem with jQuery. Here is the code: jQuery(document).ready(function ($) { $("#category-tabs li.hide-if-no-js").hide(); //Hides Most Used tab $("#category-all input:checkbox").change(function () { var max = 2; // Max allowed cats var count = $("#category-all input:checked").length; //counts selected cats ...


2

Sometimes it is more useful to look at the task outside of the WordPress field, but from true programming. You can use custom SQL query to get your users ids and then do what you want with them. Place the code below into functions.php function wpse_177536_get_user_ids(){ global $wpdb; $sql = "SELECT user_id FROM $wpdb->usermeta WHERE ...



Top 50 recent answers are included