This is my first transition to OOP in a WordPress plugin.
I am trying to create a submenu in Settings and the associated function to drive an admin screen.
The code below creates the menu item successfully but when I select the menu item, I receive the following error:
call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "aa_admin_nsp_signoff_nav" not found or invalid function name.
Any insight to what I'm doing wrong is greatly appreciated!
class AaSignTheForm {
public function __construct() {
add_action( 'admin_menu', array( $this, 'aa_nsp_signoff_submenu' ) );
}
public function aa_nsp_signoff_submenu() {
add_submenu_page(
'options-general.php',
'Nominal Sale Price Signoff',
'NSP Signoff',
'administrator',
'aa-signoff',
'aa_admin_nsp_signoff_nav' );
}
}
new AaSignTheForm();
I just added
$thisin an array for the callable function: