Get User_id outside wordpress,

AJAX requests (which you imply you are using but do not explain/demonstrate) do not load your active theme, which is where functions.php resides (unless you were referring to a functions.php file that you created in your plugin’s directory). As such, your call_user_func() is likely failing as the function that you are attempting to call is not loaded.

Note that it’s considered poor form to mix plugin functionality with theme functionality.

I strongly recommend that you simply invoke get_current_user_id( ) in your plugin’s files rather than this strange run-around you’ve currently established.

Furthermore, if your plugin needs to insert code or functionality in/near the loading of the themes you should be utilizing the WordPress Plugin API‘s action hooks and filters to load and execute code where needed rather than inserting it into your theme directory.

If you wish to continue down your current path, you could try to explicitly require() your functions.php file when you first begin processing an AJAX request; know that this may have adverse side effects and I strongly recommend against it.