-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed:The recovery_mode_clean_expired_keys
cron event is orphaned after converting to Multisite
#6835
base: trunk
Are you sure you want to change the base?
Conversation
…er converting to Multisite
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
@@ -95,6 +95,7 @@ public function initialize() { | |||
add_action( 'wp_logout', array( $this, 'exit_recovery_mode' ) ); | |||
add_action( 'login_form_' . self::EXIT_ACTION, array( $this, 'handle_exit_recovery_mode' ) ); | |||
add_action( 'recovery_mode_clean_expired_keys', array( $this, 'clean_expired_keys' ) ); | |||
add_action( 'wp_install', array( $this, 'remove_orphaned_recovery_mode_cron_event' ), 10, 1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function don't have argument 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry my bad 😞 Fixed now.
// Check if we are in a Multisite installation. | ||
if ( is_multisite() ) { | ||
// Check if the cron event is scheduled. | ||
$timestamp = wp_next_scheduled( 'recovery_mode_clean_expired_keys' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @narenin,
I think it is better to use the wp_clear_scheduled_hook
function instead of the wp_unschedule_event
.
@mukeshpanchal27 Please share your opinions as well.
Thanks
Trac ticket: https://core.trac.wordpress.org/ticket/61450
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.