'ids', 'post_type' => Charitable::CAMPAIGN_POST_TYPE, 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( 'key' => '_campaign_end_date', 'value' => array( $yesterday, date( 'Y-m-d H:i:s' ) ), // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date 'compare' => 'BETWEEN', 'type' => 'datetime' ) ) ); $campaigns = get_posts( $args ); if ( empty( $campaigns ) ) { return; } foreach ( $campaigns as $campaign_id ) { do_action( 'charitable_campaign_end', $campaign_id ); } } /** * Cleanup old log records based on retention setting. * * @since 1.8.11 * * @return void */ public function cleanup_old_logs() { if ( ! class_exists( 'Charitable_Log' ) ) { return; } $days = Charitable_Log::get_retention_days(); /** * Filter the number of days to retain log records. * * @since 1.8.11 * * @param int $days Number of days to retain. */ $days = apply_filters( 'charitable_logs_retention_days', $days ); $db = Charitable_Log::get_instance()->get_db(); if ( $db->table_exists() ) { $db->delete_older_than( $days ); } } } endif;