• Resolved j0w0

    (@j0w0)


    Is there a way to add gd_place_tags to the Places endpoint results, similar to the post_category array (id, name, slug)?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Stiofan

    (@stiofansisland)

    Hi @j0w0,

    It adds tags to post_tags in similar format to post_category already. Please make sure the post you are checking has tags attached. If you still have issues please open a ticket here https://wpgeodirectory.com/support/ and we can assist further.

    Thanks,

    Stiofan

    Thread Starter j0w0

    (@j0w0)

    Hi Stiofan,

    The JSON results do not include the tags like it does the categories. I would have to make a separate API call request for each post ID. Is there a way to list the tags in an array inside of the Places results (not a separate API endpoint), like the post_categories are?

    • This reply was modified 1 year, 2 months ago by j0w0.
    Thread Starter j0w0

    (@j0w0)

    For reference, I am using your documentation here: https://wpgeodirectory.com/docs-v2/api/posts/

    As you can see, your documentation shows “post_categories” in the results in an array format. However, you do not include the post_tags in the same results and instead have another endpoint in the “_links” object. I would like to get the tags with all the other data and not have to make another API request.

    I’ve verified the post I’m using has tags attached added it to it.

    • This reply was modified 1 year, 2 months ago by j0w0.
    • This reply was modified 1 year, 2 months ago by j0w0.
    Plugin Author Stiofan

    (@stiofansisland)

    The example does not show tags but they are there:
     "post_category": [
          {
            "id": 594,
            "name": "feature",
            "slug": "feature"
          },
          {
            "id": 598,
            "name": "restaurants",
            "slug": "restaurants"
          }
        ],
        "post_tags": [
          {
            "id": 22,
            "name": "America",
            "slug": "america"
          }
        ],
    

    https://demos.ayecode.io/starter/wp-json/geodir/v2/places

    Thread Starter j0w0

    (@j0w0)

    Does this work out of the box or is this an additional add-on?

    I’ve verified several posts have multiple tags attached to them, but am not seeing post tags anywhere in the results like I’m seeing the categories.

    https://keepitlocalcc.com/wp-json/geodir/v2/places

    Plugin Support alexrollin

    (@alexrollin)

    Hello,

    It looks like you have setup Post Tags field for Admin Use Only.

    To show post_tags in places API results Go to

    WP Admin > Places > Settings > Custom Fields > Edit Post Tags > Untick Admin Use Only.

    Thread Starter j0w0

    (@j0w0)

    Thanks, @alexrollin!! I see the post tags in the JSON results now ??

    Plugin Support alexrollin

    (@alexrollin)

    Excellent!

    Next time consider putting your ticket directly into our support desk here:

    https://wpgeodirectory.com/support/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to add gd_place_tags to Places endpoint’ is closed to new replies.