• Hello!

    I use WP API to add new posts. When i try to add a new link using

    /wp-json/wp/v2/link_library_links/?title=API&slug=link-api-test&status=publish&link_url=api.com&link_description=test

    only default fields like Title, Slug and Status are saved. Link library fields are empty. Don’t get any error.

    Does it even work with api? Maybe its possible to set up it?

    • This topic was modified 5 years, 6 months ago by isnulled.
Viewing 1 replies (of 1 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    Well, links in Link Library use Custom Post Types. A lot of the data fields are stored as post meta fields. For example, the link URL is posted in a field called link_url. The image in a field called link_image. You could quickly do a query on your postmeta table for distinct keys that start with link_ to get a full list of all links.

    You would then need to use the WP API to create meta fields. I think this article might point you in the right direction, but I am not well versed in the WP API: https://torquemag.io/2015/07/working-with-post-meta-data-using-the-wordpress-rest-api/

    Let me know if this helps and please consider donating to support this plugin’s development.

Viewing 1 replies (of 1 total)
  • The topic ‘Create links using api?’ is closed to new replies.