WP_Query filter by custom meta

You can do a meta query using OR relation. After that you use get_users() function to get all the users you selected in the query. Then output their nicename in a list with using foreach. $your_url=”https://www.yoururl.com”; $your_description = ‘your description’; $args = array( ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘user_url’, ‘value’ => … Read more

Can you Recover a WordPress User from a Backup

I just did a test on WordPress 5.4.2. I made a new user, and then made a post and a page from that user, then deleted the user and chose not to reassign content to another user. I looked in the database and found that the data in wp_users for the user was completely deleted, … Read more

how to create user profile pages and display them based on users roles

Try this to get you started. This creates a shortcode [alldevelopers] that displays a list of all developers. Pretty basic but can be heavily extended and duplicted. (Not tested) add_shortcode( ‘alldevelopers’, ‘show_all_developers’ ); function show_all_developers(){ $users = get_users( [ ‘role__in’ => [ ‘developers’ ] ] ); foreach ( $users as $user ) { echo $user->first_name … Read more

wp_get_current_user return ID = 0 when used outside of wordpress, such as webhook / fulfillment dialogflow

I dont understand where are you calling from. I can give you an alternative solution that may or may not work in your case (since I don’t fully understand your case): This is your ajax-url on your site: echo admin_url( ‘admin-ajax.php’ ); Usually we attach it to the JS to run AJAX calls: wp_localize_script( ‘THE_JS_THAT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)