jigneshkaila

Untitled

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