function checkApiAuth( $result ){
// if user and token from app match user meta in wp, continue
$app_token = $_GET['app_token'];
$user_id = $check_user_id;
$wp_token = get_user_meta( $user_id, 'app_token', true);
if( empty( $app_token ) )
$result = false;
if( $wp_token === $app_token )
$result = true;
return $result;
}
add_filter('json_authentication_errors', 'checkApiAuth');
iOS & Android app builder for WordPress
Ready to build your app?
Turn your WordPress site into iOS and Android apps with push notifications on every plan.



