From 024c4809e2d6b903f884e3b6419552f2f30c2b0a Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 5 Nov 2018 07:42:02 -0500 Subject: [PATCH] [WIP] Start implementing admin page and settings --- includes/admin/admin.php | 33 +++++++++++++++++++++++++++++++++ includes/admin/icon.php | 7 +++++++ includes/admin/settings.php | 27 +++++++++++++++++++++++++++ includes/init.php | 8 ++++++++ 4 files changed, 75 insertions(+) create mode 100644 includes/admin/admin.php create mode 100644 includes/admin/icon.php create mode 100644 includes/admin/settings.php diff --git a/includes/admin/admin.php b/includes/admin/admin.php new file mode 100644 index 0000000..61d3144 --- /dev/null +++ b/includes/admin/admin.php @@ -0,0 +1,33 @@ + +
+

+
+ +
+
+ diff --git a/includes/admin/settings.php b/includes/admin/settings.php new file mode 100644 index 0000000..9227c33 --- /dev/null +++ b/includes/admin/settings.php @@ -0,0 +1,27 @@ + + + diff --git a/includes/init.php b/includes/init.php index b02d0c9..f2e8c77 100644 --- a/includes/init.php +++ b/includes/init.php @@ -11,6 +11,8 @@ require_once plugin_dir_path( __FILE__ ) . 'client/comments.php'; require_once plugin_dir_path( __FILE__ ) . 'client/identity.php'; require_once plugin_dir_path( __FILE__ ) . 'server/async.php'; require_once plugin_dir_path( __FILE__ ) . 'pgp.php'; +require_once plugin_dir_path( __FILE__ ) . 'admin/admin.php'; +require_once plugin_dir_path( __FILE__ ) . 'admin/settings.php'; add_action( 'rest_api_init', function() { \pterotype\api\register_routes(); @@ -78,4 +80,10 @@ $theme = \get_option( 'stylesheet' ); add_action( "update_option_theme_mods_$theme", function() { \pterotype\identity\update_identity( PTEROTYPE_BLOG_ACTOR_SLUG ); } ); + +add_action( 'admin_menu', function() { + \pterotype\admin\register_admin_page(); + \pterotype\settings\register_settings_sections(); + \pterotype\settings\register_settings_fields(); +} ); ?>