Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CookieCookson/4b0e41671cc999576c136c4419164576 to your computer and use it in GitHub Desktop.
Save CookieCookson/4b0e41671cc999576c136c4419164576 to your computer and use it in GitHub Desktop.

Submit Feedback on Location

Takes a feedback object and adds it to the WordPress comments.
  • URL

    https://plymouthoutdoors.conjured.co.uk/wp-json/wp/v2/comments

  • Method:

    POST

  • URL Params

    None

  • Data Params

    author_email: string (Email of the author)
    author_name: string (Name of the author)
    content: string (The feedback message)
    post: integer (Location ID)
  • Success Response:

    [{
        id: 1
        ...
    }]
  • Sample Call:

    $.ajax({
        url: "https://plymouthoutdoors.conjured.co.uk/wp-json/wp/v2/comments",
        dataType: "json",
        type: "POST",
        data: {
            author_email: "[email protected]",
            author_name: "author name",
            content: "test",
            post: 1
        }
        success: function(r) {
            console.log(r);
        }
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment