Last active
August 29, 2015 14:19
-
-
Save aaronjorbin/5644934946c05ad08b9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( window ).off( 'beforeunload', wp.updates.beforeunload ); | |
jQuery( window ).on( 'beforeunload', function(){ | |
return 'always prompt' | |
}); | |
~ | |
~ | |
~ | |
~ | |
~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Replace wp-plugin beforeunload | |
Plugin URI: http://wordpress.org/plugins/hello-dolly/ | |
Description: This is not just a plugin, It is a pipe | |
Author: Aaron Jorbin | |
Version: 0.1 | |
Author URI: http://aaron.jorb.in | |
*/ | |
function jorbin_beforeunload_add_admin_scripts( $hook ) { | |
if ( $hook == 'plugins.php' || $hook == 'plugins-install.php' ) { | |
wp_enqueue_script( 'myscript', plugins_url( 'js.js', __FILE__ ), array( 'updates' ) ); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'jorbin_beforeunload_add_admin_scripts', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment