Ticket #31897: customizer-nonce-heartbeat.diff
File customizer-nonce-heartbeat.diff, 1.1 KB (added by , 9 years ago) |
---|
-
wp-admin/customize.php
52 52 */ 53 53 do_action( 'customize_controls_init' ); 54 54 55 //setup heartbeat to keep nonces up to date 56 wp_enqueue_script( 'heartbeat' ); 57 55 58 wp_enqueue_script( 'customize-controls' ); 56 59 wp_enqueue_style( 'customize-controls' ); 57 60 -
wp-admin/js/customize-controls.js
2947 2947 }; 2948 2948 2949 2949 /* 2950 * Set up heartbeat to refresh the nonces so that if a user leaves 2951 * a customizer window open beyond the nonce expiration 2952 * saving and previewing will continue to work 2953 */ 2954 $(document ).on('heartbeat-send', $.proxy( function( e ) { 2955 this.refreshNonces(); 2956 }, this )); 2957 2958 /* 2950 2959 * Wrap this.refresh to prevent it from hammering the servers: 2951 2960 * 2952 2961 * If refresh is called once and no other refresh requests are