@@ -48,7 +48,6 @@ |
||
48 | 48 | /** |
49 | 49 | * Retrieve the current session instance. |
50 | 50 | * |
51 | - * @param bool $session_id Session ID from which to populate data. |
|
52 | 51 | * |
53 | 52 | * @return bool|WP_Session |
54 | 53 | */ |
@@ -407,6 +407,10 @@ discard block |
||
407 | 407 | exit; |
408 | 408 | } |
409 | 409 | |
410 | + /** |
|
411 | + * @param string $source_url |
|
412 | + * @param string $destination_file |
|
413 | + */ |
|
410 | 414 | public static function geoip2_download_file( $source_url, $destination_file ) { |
411 | 415 | $success = false; |
412 | 416 | $message = ''; |
@@ -1192,6 +1196,9 @@ discard block |
||
1192 | 1196 | return apply_filters( 'wpinv_response_euvatrates', $response, $group ); |
1193 | 1197 | } |
1194 | 1198 | |
1199 | + /** |
|
1200 | + * @param boolean $is_digital |
|
1201 | + */ |
|
1195 | 1202 | public static function requires_vat( $requires_vat = false, $user_id = 0, $is_digital = null ) { |
1196 | 1203 | global $wpi_item_id, $wpi_country; |
1197 | 1204 | |
@@ -1412,6 +1419,9 @@ discard block |
||
1412 | 1419 | return apply_filters( 'wpinv_item_is_taxable', $is_taxable, $item_id, $country , $state ); |
1413 | 1420 | } |
1414 | 1421 | |
1422 | + /** |
|
1423 | + * @param string|null $state |
|
1424 | + */ |
|
1415 | 1425 | public static function find_rate( $country, $state, $rate, $class ) { |
1416 | 1426 | global $wpi_zero_tax; |
1417 | 1427 |
@@ -324,12 +324,18 @@ discard block |
||
324 | 324 | return apply_filters( 'wpinv_get_discount_code', $code, $code_id ); |
325 | 325 | } |
326 | 326 | |
327 | +/** |
|
328 | + * @return string |
|
329 | + */ |
|
327 | 330 | function wpinv_get_discount_start_date( $code_id = null ) { |
328 | 331 | $start_date = get_post_meta( $code_id, '_wpi_discount_start', true ); |
329 | 332 | |
330 | 333 | return apply_filters( 'wpinv_get_discount_start_date', $start_date, $code_id ); |
331 | 334 | } |
332 | 335 | |
336 | +/** |
|
337 | + * @return string |
|
338 | + */ |
|
333 | 339 | function wpinv_get_discount_expiration( $code_id = null ) { |
334 | 340 | $expiration = get_post_meta( $code_id, '_wpi_discount_expiration', true ); |
335 | 341 | |
@@ -652,6 +658,9 @@ discard block |
||
652 | 658 | return (bool) apply_filters( 'wpinv_is_discount_item_req_met', $ret, $code_id, $condition ); |
653 | 659 | } |
654 | 660 | |
661 | +/** |
|
662 | + * @param string $code |
|
663 | + */ |
|
655 | 664 | function wpinv_is_discount_used( $code = null, $user = '', $code_id = 0 ) { |
656 | 665 | global $wpi_checkout_id; |
657 | 666 | |
@@ -817,6 +826,9 @@ discard block |
||
817 | 826 | |
818 | 827 | } |
819 | 828 | |
829 | +/** |
|
830 | + * @param double $amount |
|
831 | + */ |
|
820 | 832 | function wpinv_format_discount_rate( $type, $amount ) { |
821 | 833 | if ( $type == 'flat' ) { |
822 | 834 | return wpinv_price( wpinv_format_amount( $amount ) ); |
@@ -861,6 +873,9 @@ discard block |
||
861 | 873 | return $discounts; |
862 | 874 | } |
863 | 875 | |
876 | +/** |
|
877 | + * @return boolean |
|
878 | + */ |
|
864 | 879 | function wpinv_unset_cart_discount( $code = '' ) { |
865 | 880 | $discounts = wpinv_get_cart_discounts(); |
866 | 881 | |
@@ -1175,6 +1190,9 @@ discard block |
||
1175 | 1190 | } |
1176 | 1191 | //add_action( 'init', 'wpinv_apply_preset_discount', 999 ); |
1177 | 1192 | |
1193 | +/** |
|
1194 | + * @param integer $code |
|
1195 | + */ |
|
1178 | 1196 | function wpinv_get_discount_label( $code, $echo = true ) { |
1179 | 1197 | $label = wp_sprintf( __( 'Discount%1$s', 'invoicing' ), ( $code != '' && $code != 'none' ? ' (<code>' . $code . '</code>)': '' ) ); |
1180 | 1198 | $label = apply_filters( 'wpinv_get_discount_label', $label, $code ); |
@@ -176,6 +176,9 @@ discard block |
||
176 | 176 | return $date_created; |
177 | 177 | } |
178 | 178 | |
179 | +/** |
|
180 | + * @return string |
|
181 | + */ |
|
179 | 182 | function wpinv_get_invoice_date( $invoice_id = 0, $format = '' ) { |
180 | 183 | $invoice = new WPInv_Invoice( $invoice_id ); |
181 | 184 | |
@@ -1375,6 +1378,9 @@ discard block |
||
1375 | 1378 | return $display; |
1376 | 1379 | } |
1377 | 1380 | |
1381 | +/** |
|
1382 | + * @return integer |
|
1383 | + */ |
|
1378 | 1384 | function wpinv_get_invoice_id_by_key( $key ) { |
1379 | 1385 | global $wpdb; |
1380 | 1386 |
@@ -529,6 +529,9 @@ |
||
529 | 529 | return apply_filters( 'wpinv_get_cart_item_price_name', $name, $item['id'], $price_id, $item ); |
530 | 530 | } |
531 | 531 | |
532 | +/** |
|
533 | + * @return string |
|
534 | + */ |
|
532 | 535 | function wpinv_get_cart_item_name( $item = array() ) { |
533 | 536 | $item_title = !empty( $item['name'] ) ? $item['name'] : get_the_title( $item['id'] ); |
534 | 537 |
@@ -194,6 +194,9 @@ |
||
194 | 194 | return apply_filters( 'wpinv_is_tax_exclusive', $ret, $item_id ); |
195 | 195 | } |
196 | 196 | |
197 | +/** |
|
198 | + * @return integer |
|
199 | + */ |
|
197 | 200 | function wpinv_currency_decimal_filter( $decimals = 2 ) { |
198 | 201 | $currency = wpinv_get_currency(); |
199 | 202 |
@@ -136,6 +136,9 @@ discard block |
||
136 | 136 | do_action( 'wpinv_after_template_part', $template_name, $template_path, $located, $args ); |
137 | 137 | } |
138 | 138 | |
139 | +/** |
|
140 | + * @param string $template_name |
|
141 | + */ |
|
139 | 142 | function wpinv_get_template_html( $template_name, $args = array(), $template_path = '', $default_path = '' ) { |
140 | 143 | ob_start(); |
141 | 144 | wpinv_get_template( $template_name, $args, $template_path, $default_path ); |
@@ -168,6 +171,10 @@ discard block |
||
168 | 171 | return apply_filters( 'wpinv_locate_template', $template, $template_name, $template_path ); |
169 | 172 | } |
170 | 173 | |
174 | +/** |
|
175 | + * @param string $slug |
|
176 | + * @param boolean $name |
|
177 | + */ |
|
171 | 178 | function wpinv_get_template_part( $slug, $name = null, $load = true ) { |
172 | 179 | do_action( 'get_template_part_' . $slug, $slug, $name ); |
173 | 180 | |
@@ -867,6 +874,9 @@ discard block |
||
867 | 874 | return apply_filters( 'wpinv_get_watermark', $output, $id ); |
868 | 875 | } |
869 | 876 | |
877 | +/** |
|
878 | + * @param integer $id |
|
879 | + */ |
|
870 | 880 | function wpinv_get_watermark( $id ) { |
871 | 881 | if ( !$id > 0 ) { |
872 | 882 | return NULL; |
@@ -161,6 +161,9 @@ |
||
161 | 161 | wp_redirect( $redirect_to ); |
162 | 162 | } |
163 | 163 | |
164 | +/** |
|
165 | + * @param integer $user_id |
|
166 | + */ |
|
164 | 167 | function wpinv_login_user( $user_id ) { |
165 | 168 | if ( is_user_logged_in() ) { |
166 | 169 | return true; |
@@ -47,6 +47,9 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param integer $code |
|
52 | + */ |
|
50 | 53 | public function send_status( $code ) { |
51 | 54 | status_header( $code ); |
52 | 55 | } |
@@ -195,6 +198,11 @@ discard block |
||
195 | 198 | class WPInv_API_Exception extends Exception { |
196 | 199 | protected $error_code; |
197 | 200 | |
201 | + /** |
|
202 | + * @param string $error_code |
|
203 | + * @param string $error_message |
|
204 | + * @param integer $http_status_code |
|
205 | + */ |
|
198 | 206 | public function __construct( $error_code, $error_message, $http_status_code ) { |
199 | 207 | $this->error_code = $error_code; |
200 | 208 | parent::__construct( $error_message, $http_status_code ); |