HEX
Server: LiteSpeed
System: Linux venus 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: axxoncom (1007)
PHP: 8.3.19
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/axxoncom/domains/adrap.click/public_html/wp-content/plugins/kubio/lib/api/page-templates.php
<?php

function kubio_page_template_get() {

	$pages     = array();
	$pages_tmp = get_pages();

	foreach ( $pages_tmp as $page ) {
		$pages[] = array(
			'label'   => $page->post_title,
			'value'   => $page->ID,
			'content' => $page->post_content,
		);
	}

	return $pages;
}



add_action(
	'rest_api_init',
	function () {
		$namespace = 'kubio/v1';

		register_rest_route(
			$namespace,
			'/page-templates/get',
			array(
				'methods'             => 'GET',
				'callback'            => 'kubio_page_template_get',
				'permission_callback' => function () {
					return current_user_can( 'edit_theme_options' );
				},

			)
		);
	}
);