| @@ 491-518 (lines=28) @@ | ||
| 488 | * |
|
| 489 | * @return float Price. |
|
| 490 | */ |
|
| 491 | public function get_price() { |
|
| 492 | ||
| 493 | if ( ! isset( $this->price ) ) { |
|
| 494 | ||
| 495 | $this->price = give_maybe_sanitize_amount( |
|
| 496 | give_get_meta( |
|
| 497 | $this->ID, |
|
| 498 | '_give_set_price', |
|
| 499 | true |
|
| 500 | ) |
|
| 501 | ); |
|
| 502 | ||
| 503 | if ( ! $this->price ) { |
|
| 504 | $this->price = 0; |
|
| 505 | } |
|
| 506 | ||
| 507 | } |
|
| 508 | ||
| 509 | /** |
|
| 510 | * Override the donation form set price. |
|
| 511 | * |
|
| 512 | * @since 1.0 |
|
| 513 | * |
|
| 514 | * @param string $price The donation form price. |
|
| 515 | * @param string|int $id The form ID. |
|
| 516 | */ |
|
| 517 | return apply_filters( 'give_get_set_price', $this->price, $this->ID ); |
|
| 518 | } |
|
| 519 | ||
| 520 | /** |
|
| 521 | * Retrieve the minimum price. |
|
| @@ 764-778 (lines=15) @@ | ||
| 761 | * |
|
| 762 | * @return string Type of donation form, either 'set' or 'multi'. |
|
| 763 | */ |
|
| 764 | public function get_type() { |
|
| 765 | ||
| 766 | if ( ! isset( $this->type ) ) { |
|
| 767 | ||
| 768 | $this->type = give_get_meta( $this->ID, '_give_price_option', true ); |
|
| 769 | ||
| 770 | if ( empty( $this->type ) ) { |
|
| 771 | $this->type = 'set'; |
|
| 772 | } |
|
| 773 | ||
| 774 | } |
|
| 775 | ||
| 776 | return apply_filters( 'give_get_form_type', $this->type, $this->ID ); |
|
| 777 | ||
| 778 | } |
|
| 779 | ||
| 780 | /** |
|
| 781 | * Get form tag classes. |
|