Skip to content

Stores the custom CSS and, for callers allowed to post unfiltered HTML, the custom JavaScript injected into the portal.

CSS is sanitised before storage. Custom JavaScript is only written when the caller holds the WordPress unfiltered_html capability; otherwise the previously stored script is silently retained, so the save appears to succeed while the JS field is ignored.

Endpoint

  • Method: POST

  • Path: /settings/snippets-settings

  • Edition: PRO

  • Controller: ProAdminController@updateSnippetsSettings

  • Route source: fluent-community-pro/app/Http/Routes/api.php:34

  • Controller source: fluent-community-pro/app/Http/Controllers/ProAdminController.php

  • Requires the FluentCommunity community-admin permission (or a WordPress super admin).

  • Requires FluentCommunity Pro; the stored snippets run on every portal page.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

POST Save Snippets Settings

POST
/settings/snippets-settings

Stores the custom CSS and, for callers allowed to post unfiltered HTML, the custom JavaScript injected into the portal.

Controller: ProAdminController@updateSnippetsSettings
Route source: fluent-community-pro/app/Http/Routes/api.php:34

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Request Body

application/json
JSON
{
  
"snippets": {
  
  
"custom_css": "string",
  
  
"custom_js": "string"
  
}
}

Responses

Successful response

application/json
JSON
{
  
"message": "string"
}

Playground

Authorization
Body

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation