location lock wordpress website

There are open/free APIs that allow geolocation based on the IP address. IP address of a mobile should be geo-correct. I use this site, with a CURL function to return the Geo information. Go to the URL in the code to get details on the return values. function grabIpInfo($ip) { //$ip = ‘185.164.57.189’; // france … 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

$_POST field value gets altered after “init”

Yes, it’s the expected behaviour. There’s information on why it works like this here, and this function which can help in removing slashes from larger data structures: https://developer.wordpress.org/reference/functions/stripslashes_deep/ In the short term, if you can live without JSON for this field, why not just remove it, and if you need multiple hidden fields add them … Read more