Skip to content

Cookbook

Each recipe solves one problem with as few files as possible, committed and pushed like the rest of your project. The recipes built on a Composer package come in three shapes:

  • most recipes are a Custom API Route, one PHP file pushed with lps api push;
  • a few are a snippet, when the code reacts to a WordPress event instead of answering a URL, pushed with lps snippet push;
  • one pairs hooks with a single-page app, pushed with lps hook push and lps app push.

Every recipe states which kind it is at the top. The Site as Code recipes need no Composer package: they build a feature from several Loopress resources, such as a post type, a taxonomy, post meta and a route, pushed together with lps push.

The other recipes rely on Composer dependency management, a Loopress Full feature, to install their package on the site. If verb methods, permission(), Composer autoloading or failure isolation are new to you, start with Writing Route Files, in particular using your own Composer dependencies.

Browse by category below or in the sidebar.

Documents & Files

Content & Data

Search & Data Services

Auth & Security

Site as Code