Horje

Wrong approach. $print_submenu_navigation will be filled in local scope when function is called with arguments, it'st a matter of global variables.

You want something like this when function is called (not defined):



load_view( 'name', array(), current_user_can('administrator') ) {

Alternatively you can add your snippet inside the function, then input value for $print_submenu_navigation will overwritten with result of your check.

And it's shorter to write it like this, function returns boolean:



$print_submenu_navigation = current_user_can('administrator');


More Solution
Reffered: https://wordpress.org/