Cookbook
Each recipe here is a single route file: one problem, one package, one file pushed with lps api push. They all build on two Loopress Full features, Custom API Routes and Composer dependency management, and on the mechanism connecting them, covered in Composer Packages in a WordPress REST API Route. Read that first if verb methods, permission(), Composer autoloading, or failure isolation are new.
Browse by category in the sidebar.
Documents & Files
- Exporting WooCommerce Orders to XLSX with PhpSpreadsheet
A Custom API Route that turns a WooCommerce orders query into a downloadable Excel file, using PhpSpreadsheet, for the client who just wants "the numbers in a spreadsheet."
- Rendering a WordPress Post as a Downloadable PDF
A Custom API Route that turns any published post's rendered content into a PDF on request, using dompdf, for a "Download as PDF" button that doesn't need a plugin.
Search & Data Services
- A Curated GraphQL Layer Over WordPress Data, in One Route File
A Custom API Route that answers GraphQL queries against a couple of WordPress types, using webonyx/graphql-php, without installing a full GraphQL plugin.