WordPress Rest API Create Post

Your JS is sending the request directly, so abc_add_post() appears to be entirely unnecessary. The issue with your JavaScript is that this part it still within the string started with “: xhr.setRequestHeader( ‘Authentication’, ‘Basic ‘ + btoa( ‘saurab:saurav123’ ) ); To use a function and concatenate it you need to close the already open string: … Read more

Calling an API to do authentication / user login

It’s better not to do so. And I’m completely against overriding the default authentication mechanism simply because of WordPress and it’s plugins usually are depended on the website’s database. But if you’re really into this situation WordPress provides a filter called authenticate: add_filter( ‘authenticate’, ‘wpse75679_auth’, 30, 3 ); function wpse75679_auth( $user, $username, $password ) { … Read more

Access WordPress data from external PHP application.

After a lot of reading it appears that JWT Authentication is the best way to go. grazianodev has a good explanation of implementation at: How to: Make JWT-authenticated requests to the WordPress API Thank you. My biggest concern is this answer requires the “JTW Authentication for WP REST API” plugin. I was looking for an … Read more

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