id, $course->coming_soon_flags, $course->available_from, $now ); } public static function closed( int $course_id, int $flags, ?string $launch, string $now ): bool { if ( 0 === ( $flags & ComingSoonFlag::ON->value ) || ( null !== $launch && '' !== $launch && $launch <= $now ) ) { return false; } if ( 0 !== ( $flags & ComingSoonFlag::PRE_ORDER->value ) ) { return ! (bool) apply_filters( 'rooster_lms_coming_soon_preorder', false, $course_id ); } return true; } public static function grant_closed( int $course_id, int $flags, ?string $launch, string $now, GrantSource $source, Actor $actor ): bool { if ( GrantSource::STAFF === $source || GrantSource::IMPORT === $source || $actor->is_import() ) { return false; } return self::closed( $course_id, $flags, $launch, $now ) && ! $actor->is_site_admin(); } }