mirror of
https://gh.wpcy.net/https://github.com/aspirepress/aspirecloud-plugin.git
synced 2026-07-16 11:37:01 +08:00
Convert the site into a headless instance, attach the REST API at the root of the site and pass through all requests to the end point defines as source API.
25 lines
508 B
PHP
25 lines
508 B
PHP
<?php
|
|
/**
|
|
* Default template for headless WordPress.
|
|
* This should rarely be used as most requests are handled by the API passthrough.
|
|
*
|
|
* @package aspire-cloud
|
|
*/
|
|
|
|
// Prevent direct access
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
// Set JSON header
|
|
header( 'Content-Type: application/json' );
|
|
|
|
// Return a simple JSON response indicating this is a headless WordPress
|
|
echo wp_json_encode(
|
|
[
|
|
'message' => 'WordPress Core Services API',
|
|
'version' => AC_VERSION,
|
|
'status' => 'active',
|
|
]
|
|
);
|
|
exit;
|