Search user metadata with checkboxes via ajax (almost working)
Search user metadata with checkboxes via ajax (almost working)
Search user metadata with checkboxes via ajax (almost working)
WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
Indeed, get_usermeta() behaves differently from get_user_meta() and all the other get_*_meta() functions. That’s why it was deprecated. Unfortunately, the subtle differences couldn’t be explained properly in a deprecation notice.
To get the ID of the user that was created last, you could run the following query: SELECT id FROM wp_users ORDER BY user_registered DESC LIMIT 1 To do this within the context of your code, do this: global $wpdb; $last_user_id = $wpdb->get_results(“SELECT id FROM $wpdb->users ORDER BY user_registered DESC LIMIT 1”); That will give … Read more
Think of them as array key/value pairs (kinda). These tables are used to store additional data about particular posts, comments, or users. The meta_key is the name by which the meta_value is retrieved, plus you have associations with particular posts, comments, or users by means of IDs. As far as structure goes, that is about … Read more
First You can get rid of nasty globals in your AJAX call. I’m not sure what the $st variable that you were output is all about so I’ve excluded, but you can include as you wish – add_action(‘wp_ajax_change_subscription’, ‘change_subscription’); function change_subscription(){ if(!empty($_POST[‘term_id’]) && !empty($_POST[‘type’])) : $user_id = get_current_user_id(); update_user_meta( $user_id, ‘hannit_meta’, ‘My Value’ ); endif; … Read more
Taken directly form the wp_delete_user documentation: if(is_user_logged_in() && !empty($_GET[‘DeleteMyAccount’])) { add_action(‘init’, ‘remove_logged_in_user’); } function remove_logged_in_user() { require_once(ABSPATH.’wp-admin/includes/user.php’ ); $current_user = wp_get_current_user(); wp_delete_user( $current_user->ID ); } Things to note: Your code didn’t check if the user was logged in or not by the time you’re printing the remove user link, the init action has already happened … Read more
If anyone should be faced with this problem, check if you have defined a callback function to set the user_login on pre_user_login. This filter is applied inside the wp_insert_user()-function and produced a same username again. Therefore the nicename was changed by adding a “-2”. So, my problem was that I reset the user_logins again and … Read more
I could only find the following core code references for the meta-box-order_ string: /wp-admin/includes/ajax-actions.php: update_user_option($user->ID, “meta-box-order_$page”, $order, true); and /wp-admin/includes/template.php: … get_user_option( “meta-box-order_$page” ) … that’s related to the ordering of meta-boxes. I doubt your $page value is post_hash, so my first guess is that this comes from a plugin/theme? If not then the user … Read more
Maybe this will answer your question: (Note: Due to bug #23268, value was required for NOT EXISTS comparisons to work correctly prior to 3.9. You had to supply some string for the value parameter. An empty string or NULL will NOT work. However, any other string will do the trick and will NOT show up … Read more