I'm working on a plugin and I created a class to display the option in the side menu and the content of the page related to this plugin, but I do not know how I can do to display the content inside it.
Before I did it this way;
function add_birthday_to_menu() {
add_menu_page('Clientes',
'Clientes',
'manage_options',
'birthday-celebrate',
'birthday_celebrate_page', // A função de callback
'dashicons-universal-access',
6);
}
function birthday_celebrate_page() { ...
In this way the callback would look for a function with the same name passed and would execute, however these 2 functions are now inside a class ...
class Birthday_celebrate
{
public function add_birthday_to_menu()
{
add_menu_page('Clientes',
'Clientes',
'manage_options',
'birthday-celebrate',
'birthday_celebrate_page', // (?)
'dashicons-universal-access',
6);
}
public function birthday_celebrate_page() { ...
To add the menu using the class I did;
add_action('admin_menu', array('Birthday_celebrate', 'add_birthday_to_menu'));
But how do I make the add_menu_page
function look for the callback within the class itself?