Sage 9 - Triggering a reload on post save

Hi there, I got the manual for Sage 9. There was an interesting section named “Triggering a reload on post save”. I followed the instructions but can’t get it to work.

I added the following code to app/filters.php (using Bedrock and WP_ENV = development):

/**
* Browsersync reload on post save
*/
add_action('save_post', function () {
// WP_ENV must be set on your development environment in order for this to work
// This is already defined if you are using Bedrock
if (WP_ENV === 'development') {
$args = ['blocking' => false];
wp_remote_get('http://localhost:3000/__browser_sync__?method=reload', $args);
}
});

Nothing is working. Who can help me?

Is http://localhost:3000 the URL of your running Browsersync session?

x-ref original thread: BrowserSync reload on WP save_post

Yes! It looks like the add_action is not triggering.