As above, I created a custom post type but when I access the API at the location /wp-json/wp/v2/custom-post-type, I get a critical error. Of course flushing permalinks doesnt’ work.
By investigating, I tried to create a new post type and the API works correctly there. Then, I remember what may cause this issue. Initially I created a post type. Later I deleted this post type, after working a bit on it. And now I created the same custom post type with the same name as before. I think this may be the issue because I’m only getting the critical error by using this same name that I used before, If I edit it or if I create a totally new post type, the API works. But possibly I need to use this one. What should I do?
[ad_2]