-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathapi-for-htmx.php
More file actions
52 lines (45 loc) · 2.22 KB
/
api-for-htmx.php
File metadata and controls
52 lines (45 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Plugin Name: HyperPress: Modern Hypermedia for WordPress
* Plugin URI: https://github.com/EstebanForge/HyperPress
* Description: Supercharge WordPress with the power of hypermedia. Use HTMX, Alpine Ajax, and Datastar to create rich, interactive blocks and pages—all with the simplicity of PHP.
* Version: 3.2.0
* Author: Esteban Cuevas
* Author URI: https://actitud.xyz
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: hyperpress
* Domain Path: /languages
* Requires at least: 6.5
* Tested up to: 6.9
* Requires PHP: 8.2
*/
// Exit if accessed directly.
defined('ABSPATH') || exit;
// Version of the WordPress plugin adapter. Always reflects the installed plugin version,
// regardless of which HyperPress-Core library version is active underneath.
if (!defined('HYPERPRESS_PLUGIN_VERSION')) {
if (function_exists('get_file_data')) {
$hyperpress_file_data = get_file_data(__FILE__, ['Version' => 'Version'], false);
define('HYPERPRESS_PLUGIN_VERSION', $hyperpress_file_data['Version'] ?? '0.0.0');
} else {
define('HYPERPRESS_PLUGIN_VERSION', '0.0.0');
}
unset($hyperpress_file_data);
}
// Load the shared bootstrap file.
require_once __DIR__ . '/bootstrap.php';
// Ensure the initialization hook is registered.
// This handles the case where bootstrap.php was loaded early (e.g., via Composer)
// and couldn't register the hook because WordPress wasn't ready.
if (function_exists('hyperpress_select_and_load_latest') && !has_action('after_setup_theme', 'hyperpress_select_and_load_latest')) {
add_action('after_setup_theme', 'hyperpress_select_and_load_latest', 0);
}
// Ensure HyperFields is also initialized if it's being used as a library
if (function_exists('hyperfields_select_and_load_latest') && !has_action('after_setup_theme', 'hyperfields_select_and_load_latest')) {
add_action('after_setup_theme', 'hyperfields_select_and_load_latest', 0);
}
// Ensure HyperBlocks is also initialized if it's being used as a library
if (function_exists('hyperblocks_select_and_load_latest') && !has_action('after_setup_theme', 'hyperblocks_select_and_load_latest')) {
add_action('after_setup_theme', 'hyperblocks_select_and_load_latest', 0);
}