diff --git a/admin/class-adminsettings.php b/admin/class-adminsettings.php index 25a335b..5bd69cc 100644 --- a/admin/class-adminsettings.php +++ b/admin/class-adminsettings.php @@ -53,11 +53,11 @@ class AdminSettings { */ public function add_submenu_items(): void { $parent_menu_slug = 'nmsp-plugin-name-menu-slug'; - $page_title = __( 'Namespace Plugin Name - Settings', 'nmsp_plugin_name_settings_title' ); - $menu_title = __( 'Settings', 'nmsp_plugin_name_settings_title' ); - $menu_slug = $parent_menu_slug; + $page_title = __( 'Namespace Plugin Name - Other', 'nmsp_plugin_name_settings_title' ); + $menu_title = __( 'Other', 'nmsp_plugin_name_settings_title' ); + $menu_slug = 'nmsp-plugin-name-menu-other-slug'; $capability = 'manage_options'; - $callback = ''; + $callback = array( $this, 'show_other_page' ); add_submenu_page( $parent_menu_slug, $page_title, $menu_title, $capability, $menu_slug, $callback ); } @@ -79,6 +79,23 @@ class AdminSettings { echo wp_kses_post( $output ); } + /** + * Show the "other" page. + * + * @since 1.0.0 + * + * @return void + */ + public function show_other_page(): void { + $data = array(); + $this->localize_script(); + + ob_start(); + echo nmsp_plugin_app()->blade->run( 'admin.other', $data ); + $output = ob_get_clean(); + echo wp_kses_post( $output ); + } + /** * Register and enqueue stylesheets and javascript files. * diff --git a/templates/admin/other.blade.php b/templates/admin/other.blade.php new file mode 100644 index 0000000..594baa0 --- /dev/null +++ b/templates/admin/other.blade.php @@ -0,0 +1,5 @@ +@extends('layouts.admin') + +@section('content') +
PluginNamespace Plugin {{ __( 'Admin Other Page', 'nmsp-plugin-name-text-domain' ) }}
+@endsection