Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

marklimmage@gmail.com on "permissions in submenu admin pages"

$
0
0

I have some submenu admin pages generated by code in an array of anonymous functions generated with a loop:

for ($i = 0; $i < count($tables); $i++) {
    $funcs[$i] = function() {
// do stuff..
}

when I add my submenu pages by referencing the elements of my funcs array, I get the permissions error:

for ($i=0;$i<count($tables);$i++) {

add_submenu_page( 'bilby_bo', $tables[$i][form], $tables[$i][form], 'manage_options', 'admin.php?page=bilby_bo_'.$tables[$i][form], $funcs[$i] );}

Can you see what I'm doing wrong?


Viewing all articles
Browse latest Browse all 8245

Trending Articles