|
@@ -7,6 +7,31 @@ add_action( 'wp_enqueue_scripts', 'lps24_enqueue_assets' );
|
|
|
|
|
|
remove_theme_support( 'core-block-patterns' );
|
|
remove_theme_support( 'core-block-patterns' );
|
|
|
|
|
|
|
|
+/***********************************************************
|
|
|
|
+###################### BrowserSync #########################
|
|
|
|
+************************************************************/
|
|
|
|
+
|
|
|
|
+function add_cors_http_header(){
|
|
|
|
+ header('Access-Control-Allow-Origin: https://lps.ovid:333');
|
|
|
|
+ header('Access-Control-Allow-Credentials: true');
|
|
|
|
+ header('Access-Control-Allow-Headers: X-WP-Nonce', false );
|
|
|
|
+}
|
|
|
|
+add_action('init','add_cors_http_header');
|
|
|
|
+
|
|
|
|
+function lps24_browsersync_save() {
|
|
|
|
+ $args = [
|
|
|
|
+ 'blocking' => false,
|
|
|
|
+ 'sslverify' => false
|
|
|
|
+ ];
|
|
|
|
+ $request = wp_remote_get('https://gwp.ovid:333/__browser_sync__?method=reload', $args);
|
|
|
|
+}
|
|
|
|
+add_action('rest_after_insert_page', 'lps24_browsersync_save', 10, 3);
|
|
|
|
+add_action('rest_after_insert_post', 'lps24_browsersync_save', 10, 3);
|
|
|
|
+add_action('save_post', 'lps24_browsersync_save', 10, 3);
|
|
|
|
+add_action('customize_save_after', 'lps24_browsersync_save', 10, 3);
|
|
|
|
+add_action('wp_update_nav_menu', 'lps24_browsersync_save', 10, 3);
|
|
|
|
+add_action('updated_option', 'lps24_browsersync_save', 10, 3);
|
|
|
|
+
|
|
/***********************************************************
|
|
/***********************************************************
|
|
######################### Admin ############################
|
|
######################### Admin ############################
|
|
************************************************************/
|
|
************************************************************/
|