wecodemore / wpstarter

Easily bootstrap whole site Composer packages for WordPress.
https://wecodemore.github.io/wpstarter/
MIT License
244 stars 34 forks source link

How to access wp-json (REST API)? #120

Closed supagu closed 1 year ago

supagu commented 1 year ago

Describe the bug

I've gone into word press to set my Permalinks as "Post name" and I'm trying to find the URL where wp-json might be accessible.

I have admin available here: http://localhost.dev/wp/wp-admin So I would expect wp-json to be here: http://localhost.dev/wp/wp-json

I have also unsuccessfully tried: http://localhost.dev/wp-json

To Reproduce

I'm just using composer.json file from here: https://wecodemore.github.io/wpstarter/docs/complete-example.html

Expected behavior

I would expect wp-json to be accessible somehow

System (please complete the following information):

MacOS

gmazzap commented 1 year ago

The JSON should be available at http://localhost.dev/wp-json, but it depends on your WP_HOME constant. Try to print the result of get_rest_url(), that's the URL WP expects you to call.