Skip to content

Commit

Permalink
Prevent Preview and Resend spawning in cron
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyrob committed Jun 16, 2019
1 parent fd30bbb commit 3f0d9e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= 10.30 =

* Code efficiency enhancements
* Avoid duplication of preview and resend emails due to cron spawning of browser requests

= 10.29 =

Expand Down
6 changes: 6 additions & 0 deletions classes/class-s2-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ public function s2_preview_meta() {
*/
public function s2_preview_handler() {
if ( isset( $_POST['s2_preview'] ) ) {
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
return;
}
global $post, $current_user;
$this->publish( $post, $current_user->user_email );
}
Expand All @@ -478,6 +481,9 @@ public function s2_resend_meta() {
*/
public function s2_resend_handler() {
if ( isset( $_POST['s2_resend'] ) ) {
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
return;
}
global $post;
$this->publish( $post );
}
Expand Down

0 comments on commit 3f0d9e5

Please sign in to comment.