@@ -740,6 +740,9 @@ |
||
| 740 | 740 | add_action( 'geodir_dashboard_links', 'wpinv_gdp_dashboard_invoice_history_link' ); |
| 741 | 741 | remove_action( 'geodir_dashboard_links', 'geodir_payment_invoices_list_page_link' ); |
| 742 | 742 | |
| 743 | +/** |
|
| 744 | + * @param string $new_status |
|
| 745 | + */ |
|
| 743 | 746 | function wpinv_wpi_to_gdp_update_status( $invoice_id, $new_status, $old_status ) { |
| 744 | 747 | if (!defined('GEODIRPAYMENT_VERSION')) { |
| 745 | 748 | return false; |
@@ -31,6 +31,9 @@ discard block |
||
| 31 | 31 | return apply_filters( 'wpinv_get_ip', $ip ); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | +/** |
|
| 35 | + * @return string |
|
| 36 | + */ |
|
| 34 | 37 | function wpinv_get_user_agent() { |
| 35 | 38 | if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 36 | 39 | $user_agent = sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] ); |
@@ -41,6 +44,9 @@ discard block |
||
| 41 | 44 | return apply_filters( 'wpinv_get_user_agent', $user_agent ); |
| 42 | 45 | } |
| 43 | 46 | |
| 47 | +/** |
|
| 48 | + * @param integer $decimals |
|
| 49 | + */ |
|
| 44 | 50 | function wpinv_sanitize_amount( $amount, $decimals = NULL ) { |
| 45 | 51 | $is_negative = false; |
| 46 | 52 | $thousands_sep = wpinv_thousands_separator(); |
@@ -79,6 +85,9 @@ discard block |
||
| 79 | 85 | } |
| 80 | 86 | add_filter( 'wpinv_sanitize_amount_decimals', 'wpinv_currency_decimal_filter', 10, 1 ); |
| 81 | 87 | |
| 88 | +/** |
|
| 89 | + * @param integer $decimals |
|
| 90 | + */ |
|
| 82 | 91 | function wpinv_round_amount( $amount, $decimals = NULL ) { |
| 83 | 92 | if ( $decimals === NULL ) { |
| 84 | 93 | $decimals = wpinv_decimals(); |
@@ -117,6 +126,9 @@ discard block |
||
| 117 | 126 | return $status; |
| 118 | 127 | } |
| 119 | 128 | |
| 129 | +/** |
|
| 130 | + * @return string |
|
| 131 | + */ |
|
| 120 | 132 | function wpinv_get_currency() { |
| 121 | 133 | $currency = wpinv_get_option( 'currency', 'USD' ); |
| 122 | 134 | |
@@ -187,6 +199,9 @@ discard block |
||
| 187 | 199 | return apply_filters( 'wpinv_currency_symbol', $currency_symbol, $currency ); |
| 188 | 200 | } |
| 189 | 201 | |
| 202 | +/** |
|
| 203 | + * @return string |
|
| 204 | + */ |
|
| 190 | 205 | function wpinv_currency_position() { |
| 191 | 206 | $position = wpinv_get_option( 'currency_position', 'left' ); |
| 192 | 207 | |
@@ -315,6 +330,9 @@ discard block |
||
| 315 | 330 | return $price; |
| 316 | 331 | } |
| 317 | 332 | |
| 333 | +/** |
|
| 334 | + * @return string |
|
| 335 | + */ |
|
| 318 | 336 | function wpinv_format_amount( $amount, $decimals = NULL, $calculate = false ) { |
| 319 | 337 | $thousands_sep = wpinv_thousands_separator(); |
| 320 | 338 | $decimal_sep = wpinv_decimal_separator(); |
@@ -365,6 +383,9 @@ discard block |
||
| 365 | 383 | return apply_filters( 'wpinv_sanitize_key', $key, $raw_key ); |
| 366 | 384 | } |
| 367 | 385 | |
| 386 | +/** |
|
| 387 | + * @return string |
|
| 388 | + */ |
|
| 368 | 389 | function wpinv_get_file_extension( $str ) { |
| 369 | 390 | $parts = explode( '.', $str ); |
| 370 | 391 | return end( $parts ); |
@@ -569,6 +590,9 @@ discard block |
||
| 569 | 590 | return strlen( $str ); |
| 570 | 591 | } |
| 571 | 592 | |
| 593 | +/** |
|
| 594 | + * @param string $str |
|
| 595 | + */ |
|
| 572 | 596 | function wpinv_utf8_strtolower( $str, $encoding = 'UTF-8' ) { |
| 573 | 597 | if ( function_exists( 'mb_strtolower' ) ) { |
| 574 | 598 | return mb_strtolower( $str, $encoding ); |
@@ -577,6 +601,9 @@ discard block |
||
| 577 | 601 | return strtolower( $str ); |
| 578 | 602 | } |
| 579 | 603 | |
| 604 | +/** |
|
| 605 | + * @param string $str |
|
| 606 | + */ |
|
| 580 | 607 | function wpinv_utf8_strtoupper( $str, $encoding = 'UTF-8' ) { |
| 581 | 608 | if ( function_exists( 'mb_strtoupper' ) ) { |
| 582 | 609 | return mb_strtoupper( $str, $encoding ); |
@@ -654,7 +681,7 @@ discard block |
||
| 654 | 681 | * |
| 655 | 682 | * @param string $str The string being decoded. |
| 656 | 683 | * @param string $encoding The encoding parameter is the character encoding. Default "UTF-8". |
| 657 | - * @return string The width of string. |
|
| 684 | + * @return integer The width of string. |
|
| 658 | 685 | */ |
| 659 | 686 | function wpinv_utf8_strwidth( $str, $encoding = 'UTF-8' ) { |
| 660 | 687 | if ( function_exists( 'mb_strwidth' ) ) { |
@@ -664,6 +664,9 @@ discard block |
||
| 664 | 664 | return $sent; |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | +/** |
|
| 668 | + * @return string |
|
| 669 | + */ |
|
| 667 | 670 | function wpinv_mail_get_from_address() { |
| 668 | 671 | $from_address = apply_filters( 'wpinv_mail_from_address', wpinv_get_option( 'email_from' ) ); |
| 669 | 672 | return sanitize_email( $from_address ); |
@@ -1123,6 +1126,9 @@ discard block |
||
| 1123 | 1126 | } |
| 1124 | 1127 | add_filter( 'wpinv_settings_sections_emails', 'wpinv_settings_sections_emails', 10, 1 ); |
| 1125 | 1128 | |
| 1129 | +/** |
|
| 1130 | + * @param string $email_type |
|
| 1131 | + */ |
|
| 1126 | 1132 | function wpinv_email_is_enabled( $email_type ) { |
| 1127 | 1133 | $emails = wpinv_get_emails(); |
| 1128 | 1134 | $enabled = isset( $emails[$email_type] ) && wpinv_get_option( 'email_'. $email_type . '_active', 0 ) ? true : false; |