| 开发者 | |
|---|---|
| 更新时间 | 2026年9月14日 02:37 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.0.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv3 |
GET https://example.com/wp-json/easy-pdf-restaurant-menu/v1/menu-types
Replace https://example.com with your WordPress installation URL, including its subdirectory if applicable. The Help tab displays the endpoint for your website.
The endpoint is public and read-only. No login, API key, nonce, or query parameters are required. It does not provide upload, update, or delete actions.
Example request:
curl "https://example.com/wp-json/easy-pdf-restaurant-menu/v1/menu-types"
A successful request returns HTTP 200 with a JSON array, for example:
[
{
"menutype": "lunch",
"menutypename": "Lunch",
"available": true,
"downloadurl": "https://example.com/easy-pdf-restaurant-menu/menu-files/menu-lunch.pdf"
},
{
"menutype": "general",
"menutypename": "General",
"available": false,
"downloadurl": ""
}
]
menutype (string): the menu identifier, such as lunch or general.menutypename (string): the menu's display name.available (boolean): whether an uploaded file exists for this menu.downloadurl (string): the public file URL, or an empty string when the menu is unavailable.menutype. A menu without an uploaded file remains in the response with available: false. If no menu types are configured, the response is [].
Display a download link only when available is true and downloadurl is nonempty. Use the returned URL, which reflects the filename setting and file extension.
If /wp-json/ returns 404, save Settings > Permalinks and check the web server's rewrite rules. The alternative REST URL is:
https://example.com/?rest_route=/easy-pdf-restaurant-menu/v1/menu-types
New user role
This Plugin also adds a new role: Restaurant Menu Uploader. User with this role can only upload the restaurant menu and see the dashboard, so perfect for any employee.New uploads are limited to 10 MiB (10,485,760 bytes), or your host's lower upload limit. An oversized upload leaves the current menu unchanged. Existing larger menus can still be downloaded using bounded streaming.
Uploads and downloads run without locking. A download may be interrupted or corrupted if its file is overwritten. Download it again after the upload finishes.
The plugin streams GET responses in 64 KiB chunks and supports HEAD without a body. Clients can use the quoted ETag with If-None-Match for a bodyless 304 response. An upload changes the validator even for same-size replacements within one second. Last-Modified is provided as metadata; If-Modified-Since alone does not trigger a 304 because filesystem timestamps cannot distinguish all rapid replacements. Direct static upload URLs remain subject to the web server's delivery settings.
Custom Gutenberg menu blocks are no longer supported. Replace each existing menu block with a WordPress Shortcode block containing the appropriate shortcode from the Installation section. Existing saved HTML may still display, but it no longer receives menu availability checks.