Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit 5a44d6d

Browse files
committed
#215 - You're welcome.
Signed-off-by: Kevin Provance <kevin.provance@gmail.com>
1 parent a586a21 commit 5a44d6d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

redux-core/class-redux-core.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,10 @@ public function admin_init() {
457457
*
458458
* @return bool
459459
*/
460-
public static function is_heartbeat() {
460+
public static function is_heartbeat(): bool {
461461
// Disregard WP AJAX 'heartbeat'call. Why waste resources?
462462
if ( isset( $_POST ) && isset( $_POST['_nonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_nonce'] ) ), 'heartbeat-nonce' ) ) {
463+
463464
if ( isset( $_POST['action'] ) && 'heartbeat' === sanitize_text_field( wp_unslash( $_POST['action'] ) ) ) {
464465

465466
// Hook, for purists.

redux-core/framework.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,13 @@ public function __wakeup() {
408408
* @param array $args Class constructor arguments.
409409
*/
410410
public function __construct( $sections = array(), $args = array() ) {
411+
global $pagenow;
412+
411413
if ( Redux_Core::is_heartbeat() ) {
412-
exit;
414+
return;
413415
}
414416

415-
if ( empty( $args ) || ! isset( $args['opt_name'] ) || ( isset( $args['opt_name'] ) && empty( $args['opt_name'] ) ) ) {
417+
if ( 'wp-cron.php' === $pagenow || empty( $args ) || ! isset( $args['opt_name'] ) || ( isset( $args['opt_name'] ) && empty( $args['opt_name'] ) ) ) {
416418
return;
417419
}
418420

0 commit comments

Comments
 (0)