REST API list_user
REST API list_user
REST API list_user
How do I add profile fields in specific section?
It is most likely that your server is running out of resources. It happens randomly. I would recommend you contact the hosting provider and show them that error. Also ask them to increase the PHP memory limit on your server and look into the server error log files. The 502 error is too generic, it … Read more
How do I set a maximum upload size for a specific user role (Editor)
You can use the add_post_meta and update_post_meta filters to accomplish this. If you return anything other than null in these filters the post meta will not be saved. add_filter(‘add_post_metadata’, ‘check_metadata’, 10, 5); function check_metadata($check, $object_id, $meta_key, $meta_value, $prev_value){ /*** Check if the metadata exists via sql ***/ if($exists) { /*** Notify you or something ***/ … Read more
I ended up just adding a second hook to remove_user_role using the same function add_action( ‘remove_user_role’, ‘update_user_department’, 10, 1 );
I’d suggest editing your single template, instead of functions.php. So, in a child theme, edit single.php and whatever other templates your theme uses for the CPTs, at the location where it outputs the author’s name. Where the author’s name is being displayed, you can then also grab their user meta (gender and country) and output … Read more
Is there a reason why you don’t just want to make the “author archive” a page and list them all on the page with a shortcode ? If that’s an option, simply put your single author template in author.php Author templates – Template hierarchy If not, you could take your current template (that you’ve put … Read more
It’s an weird one. Go to the database and check users table to see if the deleted users are there or not. If they are there, delete the unwanted users except the admin.
You should be able to use get_current_user_id(). Note that it will return ‘0’ if the user isn’t logged in. <a href=”https://example.com/?user_id=<?php echo get_current_user_id(); ?>”>Link</a> Update 2: Got bored, made a plugin: https://github.com/AndyMardell/append-user-id/releases/tag/v1.0.0-alpha Download the zip and install 🙂 Submitted to WordPress but it’s still under review. Installation and Usage: https://github.com/AndyMardell/append-user-id#installation Update: you won’t be able … Read more