enabled = give_is_setting_enabled($enabled); $this->heading = $heading; $this->location = $location; } public static function make($settings) { return new self( $settings['donation_summary_enabled'], $settings['donation_summary_enabled'], $settings['donation_summary_location'] ); } public function getHeading(): string { return $this->heading ?: __('Donation Summary', 'give'); } public function isEnabled(): bool { return $this->enabled; } /** * @since 3.0.0 * * @note `give_donation_form_user_info` is presented as "Before payment fields". * @note `give_donation_form_before_submit` is the default location, presented as "After payment fields". */ public function isBeforePaymentFields(): bool { return 'give_donation_form_user_info' === $this->location; } }