From b2784f4bcb9724786dde19b31304f86918f6fb95 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 23 Feb 2021 11:58:20 +0100 Subject: Add a sub page for importing gigs in admin. Just an emtpy placeholder for now. --- giglogadmin.php | 13 +++++++++++-- includes/admin/views/giglog_import_gigs.php | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 includes/admin/views/giglog_import_gigs.php diff --git a/giglogadmin.php b/giglogadmin.php index 091cdcf..0ebaa99 100644 --- a/giglogadmin.php +++ b/giglogadmin.php @@ -25,6 +25,7 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) { require_once __DIR__ . '/includes/public/shortcodes/giglog_photographers.php'; require_once __DIR__ . '/includes/public/shortcodes/giglog_process_files.php'; require_once __DIR__ . '/includes/admin/views/giglog_admin_page.php'; + require_once __DIR__ . '/includes/admin/views/giglog_import_gigs.php'; class GiglogAdmin_Plugin { @@ -51,14 +52,22 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) { * menu. Other subpages will come later. */ static function add_admin_pages() { - add_menu_page( - "Giglog", // Page title + $top = add_menu_page( + "Giglog admin", // Page title "Giglog", // Menu title "upload_files", // Will show for users with this capability "giglog", // menu slug array( 'GiglogAdmin_AdminPage', 'render_html' ), // callable 'dashicons-tickets-alt', // Icon url 11); // Position, just below 'Media' + + add_submenu_page( + "giglog", // parent slug + "Import gigs", // page title + "Import gigs", // menu title + "upload_files", // required capability + "giglog_import", // menu slug + array( 'GiglogAdmin_ImportGigsPage', 'render_html' )); // callable } /* diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php new file mode 100644 index 0000000..953fa62 --- /dev/null +++ b/includes/admin/views/giglog_import_gigs.php @@ -0,0 +1,25 @@ +. + */ + +if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { + class GiglogAdmin_ImportGigsPage { + static function render_html() { + echo '

Let\'s import some gigs!

'; + } + } +} -- cgit v1.2.3