[wp-trac] [WordPress Trac] #31964: Use a replaceable function for the beforeupload handler with shiny updates

WordPress Trac noreply at wordpress.org
Wed Apr 15 12:17:01 UTC 2015


#31964: Use a replaceable function for the beforeupload handler with shiny updates
-----------------------------+---------------------------------------------
 Reporter:  DavidAnderson    |       Owner:  jorbin
     Type:  enhancement      |      Status:  reopened
 Priority:  low              |   Milestone:  4.2
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  ui, javascript, administration
  shiny-updates              |
-----------------------------+---------------------------------------------

Comment (by DavidAnderson):

 Snippet used for testing:

 {{{
 add_action('admin_footer', 'my_admin_footer');
 function my_admin_footer() {
         ?>
         <script>
                 jQuery(document).ready(function() {
                         wp.updates.beforeunload = function() {
 console.log("HI!"); return true; }
                 });
         </script>
         <?php
 }
 }}}

 Note that testing with alert() may not work at all - Firefox, at least,
 doesn't seem to process an alert() firing during this event.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31964#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list