Make WordPress Core


Ignore:
Timestamp:
11/27/2013 01:55:59 AM (12 years ago)
Author:
azaozz
Message:

Heartbeat: introduce "suspend" functionality and enable it after 20 min. of inactivity, see #25073.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/misc.php

    r26406 r26428  
    740740}
    741741add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
     742
     743/**
     744 * Disable suspending of Heartbeat on the Add/Edit Post screens
     745 *
     746 * @since 3.8
     747 */
     748function wp_disable_heartbeat_suspend( $settings ) {
     749    global $pagenow;
     750
     751    if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
     752        $settings['suspend'] = 'disable';
     753    }
     754
     755    return $settings;
     756}
     757add_filter( 'heartbeat_settings', 'wp_disable_heartbeat_suspend' );
Note: See TracChangeset for help on using the changeset viewer.