File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -693,12 +693,21 @@ function action_handle_posts() {
693693 }
694694 }
695695
696- $ redirect = array (
697- 'page ' => 'wp-crontrol ' ,
698- 'crontrol_name ' => $ deleted ,
699- 'crontrol_message ' => MESSAGE_EVENT_DELETED_SELECTED ,
696+ $ redirect_url = wp_get_referer ();
697+
698+ if ( ! $ redirect_url ) {
699+ $ redirect_url = admin_url ( 'tools.php?page=wp-crontrol ' );
700+ }
701+
702+ $ redirect_url = remove_query_arg ( array ( 'crontrol_message ' , 'crontrol_name ' ), $ redirect_url );
703+ $ redirect_url = add_query_arg (
704+ array (
705+ 'crontrol_name ' => $ deleted ,
706+ 'crontrol_message ' => MESSAGE_EVENT_DELETED_SELECTED ,
707+ ),
708+ $ redirect_url
700709 );
701- wp_safe_redirect ( add_query_arg ( $ redirect , admin_url ( ' tools.php ' ) ) );
710+ wp_safe_redirect ( $ redirect_url );
702711 exit ;
703712
704713 } elseif ( isset ( $ _GET ['crontrol_action ' ] ) && 'delete-cron ' === $ _GET ['crontrol_action ' ] ) {
You can’t perform that action at this time.
0 commit comments