Adding 'other' template page for admin panel
This commit is contained in:
parent
85f7d28a0f
commit
bcb3b06bc3
@ -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.
|
||||
*
|
||||
|
5
templates/admin/other.blade.php
Normal file
5
templates/admin/other.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('content')
|
||||
<p>PluginNamespace Plugin {{ __( 'Admin Other Page', 'nmsp-plugin-name-text-domain' ) }}</p>
|
||||
@endsection
|
Loading…
x
Reference in New Issue
Block a user