JavaScript Behavior
Front-end and admin JavaScript behavior included in Epiktetos.
Epiktetos enqueues JavaScript conditionally from functions.php and feature classes.
Front-end scripts
| Handle | File | Condition |
|---|---|---|
epiktetos-header | assets/js/header.js | Loaded on the front end. |
epiktetos-categories | assets/js/categories.js | Loaded on the front page except the saved route. |
epiktetos-single | assets/js/single.js | Loaded on singular posts. |
epiktetos-reader | assets/js/reader.js | Loaded on saved route, front page, single posts, archives, and search. |
The header script receives localized strings for controls such as dark mode, light mode, and search.
Admin scripts
Admin classes enqueue scripts for settings screens, wizard behavior, category ordering, and admin tooling where needed. The category order screen uses jQuery UI Sortable.
REST behavior
The search feature registers a public REST endpoint:
/wp-json/epiktetos/v1/search
It accepts a search query argument, requires at least two characters, and returns up to five post results with title, category, excerpt, permalink, date, and reading-time data.
Public endpoint
The search endpoint intentionally uses a public permission callback. Keep the response limited to public post data if extending it.