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?