How can I create admin page where I can pass GET variable?
This page works, its URL is http://localhost/web/wp-admin/admin.php?page=osobe-stranica
But I can’t pass a variable to it like this http://localhost/web/wp-admin/admin.php?page=osobe-stranica?user_id=10 cause I get “Sorry, you are not allowed to access this page.” I am admin.
add_menu_page(
‘Osobe’,
‘Osobe’,
‘manage_options’,
‘osobe-stranica’,
‘prikazi_osobe_stranicu’,
‘dashicons-admin-users’,
1
);
function prikazi_osobe_stranicu() {
var_dump($_GET);
}
I’ve tried this already:
add_filter( ‘query_vars’, ‘dodaj_user_id_query_var’ );
function dodaj_user_id_query_var( $vars ) {
$vars[] = ‘user_id’;
return $vars;
}

It’s already passing a parameter. ?someparam=something&someotherparam=something the issue is you haven’t accounted for the existing. Param, and then used an improper character. Use & instead where a param already exists.