• Resolved generosus

    (@generosus)


    Reference: Log Cleanup Cron | Need to Disable or Change Interval

    The code snippet shown below (provided by TEC) does not work.

    remove_action( Tribe__Log::CLEANUP, [ tribe( 'logger' ), 'do_cleanup' ] );
    // or more aggressively
    remove_all_actions( Tribe__Log::CLEANUP );

    The code snippet is supposed to delete TEC’s cron: tribe_common_log_cleanup

    Can you kindly review it and provide a code snippet that works?

    Also, after installing WP Crontrol, I noticed the above cron does not have an Action assigned to it. It only shows an exclamation mark (click here for details). What does this mean? Is their something wrong with your code?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter generosus

    (@generosus)

    Solution:

    I’ll be darned. Soon after posting this topic, I found a code snippet that works:

    add_action("init", "remove_cron_job"); 
    
    function remove_cron_job() {
     wp_clear_scheduled_hook("tribe_common_log_cleanup"); 
    
    }

    Above code snippet can be used for any cron job. Simply replace “tribe_common_log_cleanup” with the cron job hook you’d like to delete (you can obtain the cron job hook via the plugin, WP Crontrol)

    Credit: https://w3guy.com/remove-wordpress-plugin-cron-job/

    Hi there,

    Thank you so much for the update and for letting us know about this. This is excellent!!

    I will make sure our team knows.

    Thanks, again.
    Chad

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Code Snippet Not Working | Need to Delete Log Cleanup Cron’ is closed to new replies.