I want to declare a series of functions and name them using the elements of an array. I do not want to put the functions into an array as anonymous functions, but want them declared and accessible by calling them directly with their unique names from the elements of the array.
I want something like the following but that actually works:
for ($i=0;$i<count($tables);$i++) {
function $tables[$i][form]() {
}
// do something;
}
The purpose of these functions is to add submenu pages to my wordpress plugin's admin page. The number of submenus and their names depends on records in a table in the DB.
Perhaps there is a better way to do this altogether. Please help. When I tried using anonymous functions in an array and referencing the array elements in the function parameter in the add_submenu function, I kept getting permission problems when going to the submenu pages.