Update a Snippet

Estimated reading: 2 minutes 291 views
  • To update your existing snippet in Post Snippets Rest API Settings, enter the Snippet Endpoint Title in the Update Snippet field.

Note: Do not enter any Special Characters [!@#$%^&*_()+-=] into the title.

  • Click on the Save Changes button.
  • You will get the URL under the Update Snippet field.
  • Here, you have to use the following URI parameters and replace the following parameters same as in the Create Snippet.
    • {token} : replace with your 16 digit generated token.
    • {snippet-title}: replace with a new title.
    • {var}: use for empty or enter comma separated values like, username,email etc.
    • {shortcode} : use for enable and for disable.
    • {php} : use to make it php or for empty.
    • {wptexturize} :  use to enable wptexturize or to disable.
    • {snippet-code} : write simple/plain text, HTMLPHP etc.
    • {snippet-description} : enter a short description for your snippet.
  • After replacing the parameters with new URI parameters, the URL will look like this:
  • https://wordpress-444586-2318562.cloudwaysapps.com/wp-json/post-snippets/newSnippet/A2DjNM62Igvkr4AM/newSnippet/fname/0/1/0/snippet?snippet_code=$fname = {fname}; echo $fname; &description=this rest api snippet is Updated
  • Now, go to your browser search tab and paste the URL.
  • Or go to the Postman, paste the URL in the Enter request URL tab.
  • Click on the Send button.
  • Your Snippet will be updated.
  • Go to the All Snippets section to check your updated snippet.
  • Open your updated snippet.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

Update a Snippet

Or copy link

CONTENTS
Scroll to Top