| @@ 746-761 (lines=16) @@ | ||
| 743 | * @param mixed $key |
|
| 744 | * @return string |
|
| 745 | */ |
|
| 746 | public function validate_price_field( $key ) { |
|
| 747 | $text = $this->get_option( $key ); |
|
| 748 | $field = $this->get_field_key( $key ); |
|
| 749 | ||
| 750 | if ( isset( $_POST[ $field ] ) ) { |
|
| 751 | ||
| 752 | if ( $_POST[ $field ] !== '' ) { |
|
| 753 | $text = wc_format_decimal( trim( stripslashes( $_POST[ $field ] ) ) ); |
|
| 754 | } else { |
|
| 755 | $text = ''; |
|
| 756 | } |
|
| 757 | } |
|
| 758 | ||
| 759 | return $text; |
|
| 760 | } |
|
| 761 | ||
| 762 | /** |
|
| 763 | * Validate Decimal Field. |
|
| 764 | * |
|
| @@ 770-785 (lines=16) @@ | ||
| 767 | * @param mixed $key |
|
| 768 | * @return string |
|
| 769 | */ |
|
| 770 | public function validate_decimal_field( $key ) { |
|
| 771 | ||
| 772 | $text = $this->get_option( $key ); |
|
| 773 | $field = $this->get_field_key( $key ); |
|
| 774 | ||
| 775 | if ( isset( $_POST[ $field ] ) ) { |
|
| 776 | ||
| 777 | if ( $_POST[ $field ] !== '' ) { |
|
| 778 | $text = wc_format_decimal( trim( stripslashes( $_POST[ $field ] ) ) ); |
|
| 779 | } else { |
|
| 780 | $text = ''; |
|
| 781 | } |
|
| 782 | } |
|
| 783 | ||
| 784 | return $text; |
|
| 785 | } |
|
| 786 | ||
| 787 | /** |
|
| 788 | * Validate Password Field. |
|