jigneshkaila

Untitled

Jun 10th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. add_filter('angelleye_paypal_plus_shipping_line1', 'th_angelleye_paypal_plus_shipping_line1', 10, 2);
  2.  
  3. function th_angelleye_paypal_plus_shipping_line1($shipping_address_1, $order_id) {
  4.     $house_no = get_post_meta($order_id, 'hausnummer', true);
  5.  
  6.     if (!empty($house_no)) {
  7.         $shipping_address_1 = th_limit_length($shipping_address_1 . ' ' . $house_no, 100);
  8.     }
  9.     return $shipping_address_1;
  10. }
  11.  
  12. function th_limit_length($string, $limit = 127) {
  13.     if (strlen($string) > $limit) {
  14.         $string = substr($string, 0, $limit - 3) . '...';
  15.     }
  16.     return $string;
  17. }
Add Comment
Please, Sign In to add comment