mirror of
https://ghproxy.net/https://github.com/abhijitb/helix.git
synced 2025-08-28 02:52:20 +08:00
Initial commit
This commit is contained in:
commit
153a4e9fd7
345 changed files with 359185 additions and 0 deletions
7
admin/disable-wp-admin.php
Normal file
7
admin/disable-wp-admin.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
add_action('admin_init', function () {
|
||||
$screen = get_current_screen();
|
||||
if (!is_admin() || $screen->id === 'toplevel_page_helix') return;
|
||||
wp_redirect(admin_url('admin.php?page=helix'));
|
||||
exit;
|
||||
});
|
6
admin/init.php
Normal file
6
admin/init.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
add_action('admin_menu', function () {
|
||||
add_menu_page('Helix', 'Helix', 'read', 'helix', function () {
|
||||
echo '<div id="helix-root"></div>';
|
||||
}, 'dashicons-admin-generic', 2);
|
||||
});
|
13
admin/rest-routes.php
Normal file
13
admin/rest-routes.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
add_action('rest_api_init', function () {
|
||||
register_rest_route('helix/v1', '/settings', [
|
||||
'methods' => 'GET',
|
||||
'permission_callback' => '__return_true',
|
||||
'callback' => function () {
|
||||
return [
|
||||
'siteTitle' => get_option('blogname'),
|
||||
'language' => get_option('WPLANG'),
|
||||
];
|
||||
}
|
||||
]);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue