Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter pimo

    (@pimo)

    Ok, I did it by myself and i use something like:
    URL/wp-json/posts?filter[name]==this-post-slug
    It works but is a bit different than
    URL/wp-json/posts/id
    because it retrieves not a single post but a collection (array) of a single item.
    so in my case, working with Angular.js, I just added the index on my data object to reach the data,
    something like project[0].data instead of project.data as usual.
    I hope this could help someone else.

    Just wanted to thank Pimo – this worked like a charm for me!

    Thread Starter pimo

    (@pimo)

    Happy to hear I have been useful!

    Can’t create new post by language
    URL/es/wp-json/wp/v2/posts when I am posting in this way, it doesn’t set language to spanish, instead it creates new post by default language english. What am I doing wrong?

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    @goharika I’m not sure I follow. Can you share more details about the request you’re making, and how your WordPress instance is configured?

    Ok, For example I am get all armenian posts in this way with rest api
    link
    Now I want to create new armenian post, so I need POST my data which is json there.
    It creates new post but in admin panel says, that Languages are not set

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Filtering for slug (post slug)’ is closed to new replies.