0
I am working on a plugin and created a class to display the option in the side menu and the content of the page related to this plugin, however I do not know how to display the content within it.
I used to do 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() { ...
This way the callback would search for a function with the same name passed and run, but these 2 functions are now within 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 made;
add_action('admin_menu', array('Birthday_celebrate', 'add_birthday_to_menu'));
But how do I make for that function add_menu_page
look for the callback within the class itself?