Changeset 48056
- Timestamp:
- 06/16/2020 07:07:54 AM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/lib/auth-check.js
r47122 r48056 7 7 /* global adminpage */ 8 8 (function($){ 9 var wrap , next;9 var wrap; 10 10 11 11 /** … … 112 112 113 113 /** 114 * Schedules when the next time the authentication check will be done.115 *116 * @since 3.6.0117 * @private118 */119 function schedule() {120 // In seconds, default 3 min.121 var interval = parseInt( window.authcheckL10n.interval, 10 ) || 180;122 next = ( new Date() ).getTime() + ( interval * 1000 );123 }124 125 /**126 114 * Binds to the Heartbeat Tick event. 127 115 * … … 139 127 $( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) { 140 128 if ( 'wp-auth-check' in data ) { 141 schedule();142 129 if ( ! data['wp-auth-check'] && wrap.hasClass('hidden') ) { 143 130 show(); … … 146 133 } 147 134 } 148 149 /**150 * Binds to the Heartbeat Send event.151 *152 * @ignore153 *154 * @since 3.6.0155 *156 * @param {Object} e The heartbeat-send event that has been triggered.157 * @param {Object} data Response data.158 */159 }).on( 'heartbeat-send.wp-auth-check', function( e, data ) {160 if ( ( new Date() ).getTime() > next ) {161 data['wp-auth-check'] = true;162 }163 164 135 }).ready( function() { 165 schedule();166 136 167 137 /** -
trunk/src/wp-includes/script-loader.php
r48038 r48056 720 720 array( 721 721 'beforeunload' => __( 'Your session has expired. You can log in again from this page or go to the login page.' ), 722 723 /**724 * Filters the authentication check interval.725 *726 * @since 3.6.0727 *728 * @param int $interval The interval in which to check a user's authentication.729 * Default 3 minutes in seconds, or 180.730 */731 'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ),732 722 ) 733 723 );
Note: See TracChangeset
for help on using the changeset viewer.