Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

najubudeen on "Passing parameter in add_menu_page's page slug."

$
0
0

hi, i want pass parameter in page slug of an admin page. how do i do that? what i want is,

function my_test_menu(){
   add_menu_page('test var' , 'Passing vars', 'manage_options', 'test-vars&var1=one', 'my_page');
}
add_action('admin_menu', 'my_test_menu');
function my_page(){
    if(isset($_GET['var1'])){
          print $_GET['var1'];
     }else{
          print 'print default here.';
     }
}

Please help some one to fix this problem.


Viewing all articles
Browse latest Browse all 26892

Trending Articles