Every thread prefix in an API result now includes
colors: the text, background and border color its label has in your default style. This includes the prefixes in
forums/{id} and needs no extra scope.
- Colors as visitors see them: they're read from your default style's compiled label CSS, including edited label styles, dark styles and custom CSS classes. Only plain color values are sent.
- No slower API requests: a background job works the colors out when your default style or a prefix's CSS class changes, and API requests only read the saved result. Until it first runs, prefixes have no
colors field.
- Changed:
GET thread-prefixes/ now returns {"prefixes": [...]}, like XenForo's own list endpoints. If you read the old bare list, update your code before upgrading.
To see a real-world use of thread prefixes over the API, see the enhancements made in
the XFtoWP 1.7.3 plugin.