GhostManSec
Server: Apache
System: Linux webm019.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: exhehbu (1008962)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/exhehbu/wp/wp-content/plugins/complianz-terms-conditions/rest-api/rest-api.php
<?php defined( 'ABSPATH' ) or die( "you do not have acces to this page!" );
/**
 *
 * API for Gutenberg blocks
 *
 * @return array documents (id, title, content)
 *
 */

add_action( 'rest_api_init', 'cmplz_tc_documents_rest_route' );
function cmplz_tc_documents_rest_route() {
	register_rest_route( 'complianz_tc/v1', 'document/', array(
		'methods'  => 'GET',
		'callback' => 'cmplz_tc_rest_api_documents',
		'permission_callback' => '__return_true',
	) );
}

/**
 * @param WP_REST_Request $request
 *
 * @return array
 */
function cmplz_tc_rest_api_documents( WP_REST_Request $request ) {

	$html       = COMPLIANZ_TC::$document->get_document_html('terms-conditions');
	return array(
		'id'      => 'terms',
		'title'   => __("Terms and Conditions", "complianz-terms-conditions"),
		'content' => $html,
	);
}