• Resolved gabyrau

    (@gabyrau)


    On websites with woocommerce WP Crontol is showing a job called ‘wc_admin_unsnooze_admin_notes’ with no action but a schedule of ‘once hourly’. When I try to delete this action I get a success message, but the action is still showing up in the list of cron events. To get rid of it, I deleted it with wp_clear_scheduled_hook and tested with wp_next_scheduled. But it still appears in WP Crontol events list. How can I remove it there?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    If you take a look through the plugin FAQ you’ll see a couple of answers relating to events that reappear after you delete them. It’s almost certain that WooCommerce is simply rescheduling the event once it sees that it’s missing.

    If you don’t want this to run, you can use WP Crontrol to pause it instead of deleting it.

    Thread Starter gabyrau

    (@gabyrau)

    I definitely deleted the event in functions.php with

    function remove_wc_admin_unsnooze_cron() {
    wp_clear_scheduled_hook( 'wc_admin_unsnooze_admin_notes' );}
    add_action( 'init', 'remove_wc_admin_unsnooze_cron' );

    I checked this with

    $timestamp = wp_next_scheduled( 'wc_admin_unsnooze_admin_notes' );

    and this returns false, so the event has not been rescheduled.

    When I try to delete it – again – with WP Crontrol, I get the message “The cron event wc_admin_unsnooze_admin_notes could not be found”.

    But it is still listed unter WP Crontrol Events with Action “None”.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    I suspect there might be priorities at play here, for example WooCommerce reschedules the event after you unschedule it but before WP Crontrol displays its list of events.

    This isn’t anything specific to WP Crontrol so your best bet is to get in touch with WooCommerce support, or, as I mentioned, use the Pause feature in WP Crontrol to prevent this event from doing anything.

    Thread Starter gabyrau

    (@gabyrau)

    Sorry, but if wp_next_scheduled returns false, how can the event be scheduled at all? Do I miss something?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hook with no action can not be deleted’ is closed to new replies.