• Hello,

    I’m developing a simple plugin that requests data to an API that returns a JSON data.
    I have much information that already set in custom fields in new post, but I’m having trouble with the following features I would like to have:

    With the result of Ajax Call I would like to set the page title, the text (as HTML in jSON), choose the category, tags upload an image and set it as featured image. I also have some other data likes prices, descriptions, reviews that already filled in custom fields (that have their own id/name).

    I’m getting trouble in inserting data in the editor (title, text, category, tags, etc).
    Already searched in docs but couldn’t find anything that would help me. Any solution for this?

Viewing 1 replies (of 1 total)
  • Thread Starter Invizion

    (@invizion)

    So I guess I made some progress, but got stucked again.

    With the code:
    wp.data.dispatch('core/editor').editPost({tags: [id]})

    Where ID is the post tag ID, it adds the post tag to the input, but I have my tags as text, so I have two problems:

      If post tag doesnt exist, create it by text;
      Get post tag id by name and add it to post;
Viewing 1 replies (of 1 total)
  • The topic ‘Ajax answer as json to editor [taxonomies, image, title, etc]’ is closed to new replies.