Rest API code to get ID of current user not working: get_current_user_id() gives 0
Rest API code to get ID of current user not working: get_current_user_id() gives 0
Rest API code to get ID of current user not working: get_current_user_id() gives 0
Parent User and Child User – relate users
Create membership number for existing/new users
Not really. Deep down such functions are essentially writes to database. So either database write fails (which doesn’t produce meaningful message to return) or data is somehow wrong and function just returns false to escape. Your best bet is probably to control data user inputs, not result of WP trying to process that data. PS … Read more
You won’t get a proper sort on the meta_value column because the values stored there aren’t treated as integer values, but you can use a method similar to how it was done it WordPress back when we were using meta_value_num to do sorting, which basically involved adding a number onto the front of the data. … Read more
Your query is wrong that’s way noting is returned because there is no row in the database that holds more then one meta_key. What you can do instead is create a Sub Query to get all user id’s of users who live in London as a Sub Query and the use that to filter users … Read more
The User Query Class There’s a class to query users. This makes a) more easy and b) more future proof as mostly the internals will change, but not the way you access it. $the_authors = new WP_User_Query( array( ‘role’ => ‘author’ ) ); foreach ( $the_authors as $author ) { // Show what we got: … Read more
When a user changes their admin settings; like the screen options, posts per page or moves metaboxes around or ‘hides’ them, it is saved in their user settings. So if user settings are blank – the user has never tailored their admin environment. Aside: (I use this to great advantage in one of my plugins … Read more
You just need to write a delete avatar function that gets the location of the file and deletes it using the php unlink function. The following code can be used as an example of how it’s done. I use this to delete the old user avatars when a user uploads a new one. It is … Read more
I haven’t touched user functions so far, but according to the codex, should look something like this. $args = array( ‘meta_key’ => ‘g300’, ‘meta_value’ => ‘,’ ); $users = get_users( $args ); EDIT This assumes that all the users with the field unchecked have a comma value ( for example, it won’t work if the … Read more