No ‘Access-Control-Allow-Origin’ when call rest API

just write this on your function.php

add_filter( 'allowed_http_origin', '__return_true' );

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