I've the following folder structure:

```
root/wordpress/* // all wordpress related files
root/myApp/test.php

```

Under `test.php`, I've the following code

```
<?php
require('../wordpress/wp-blog-header.php');
$userid = get_current_user_id();
echo $userid; // prints 0 on the page
?>

```

So to play around and experiment, I went ahead and did the following in `root/wordpress/wp-includes/user.php`

```
function get_current_user_id() {
    if ( ! function_exists( 'wp_get_current_user' ) )
        return 1;
    $user = wp_get_current_user();
    return ( isset( $user->ID ) ? (int) $user->ID : 2 );
}

```

But the output on `test.php` still prints 0. What am I missing here?

Also

* I'm very well aware one should not directly include `wp-blog-header.php` in an external app and rather should use the recommended approach while passing the user session
* One should not edit the core files

I'll undo them as soon as I figure out why the update in the core file (`user.php`) isn't reflecting the change

FWIW, WP version `4.9.3` is what is being used.

Update
------

I'm not really looking for a solution where the user session will be passed onto the external app. Rather, I'm trying to figure out why isn't the edit to `user.php` not taking effect?