ZGoPmtList/assets/class-submenu.php

45 lines
976 B
PHP
Raw Normal View History

2022-12-26 22:12:23 +00:00
<?php
/**
* Creates the submenu item for the plugin.
*
* Registers a new menu item under 'Admin' group and uses the dependency passed into
* the constructor in order to display the page corresponding to this menu item.
**/
class Submenu {
/**
* A reference the class responsible for rendering the submenu page.
**/
private $submenu_page;
/**
* Initializes all of the partial classes.
**/
public function __construct( $submenu_page ) {
$this->submenu_page = $submenu_page;
}
/**
* Adds a submenu for this plugin to the 'Tools' menu.
**/
public function init() {
add_action( 'admin_menu', array( $this, 'add_options_page' ) );
}
/**
* Creates the submenu item and calls on the Submenu Page object to render
* the actual contents of the page.
**/
public function add_options_page() {
add_options_page(
'ZGo Payment Gateway Support',
'ZGo Payments',
'manage_options',
'zgopmtlist',
array( $this->submenu_page, 'render' )
);
}
}