Changeset 3215313
- Timestamp:
- 12/31/2024 11:52:39 AM (15 months ago)
- Location:
- wp360-invoice
- Files:
-
- 1 added
- 4 edited
-
assets/banner-772x250.png (added)
-
tags/1.0.1/front/view_invoice.php (modified) (1 diff)
-
tags/1.0.1/suite/index.php (modified) (2 diffs)
-
trunk/front/view_invoice.php (modified) (1 diff)
-
trunk/suite/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp360-invoice/tags/1.0.1/front/view_invoice.php
r3214839 r3215313 94 94 $addressParts = []; 95 95 if (!empty($custLine1)) { 96 $addressParts[] = $custLine1 ;96 $addressParts[] = $custLine1 . ','; 97 97 } 98 98 if (!empty($custLine2)) { 99 $addressParts[] = (!empty($custLine1) ? "<br>" : "") . $custLine2; 100 } 99 $addressParts[] = $custLine2 . ','; 100 } 101 102 // Combine city, postcode, state, and country into a single line. 103 $locationParts = []; 101 104 if (!empty($custCity)) { 102 $ addressParts[] = $custCity;105 $locationParts[] = $custCity; 103 106 } 104 107 if (!empty($custPostCode)) { 105 $ addressParts[] = $custPostCode;108 $locationParts[] = $custPostCode; 106 109 } 107 110 if (!empty($custState)) { 108 $ addressParts[] = $custState;111 $locationParts[] = $custState; 109 112 } 110 113 if (!empty($custCountry)) { 111 $addressParts[] = $custCountry; 112 } 113 $custAddress = esc_html(implode(', ', $addressParts)); 114 $custAddress = $custLine1.' <br> '.$custCity.', '.$custPostCode.', '.$custState.', '.$custCountry; 114 $locationParts[] = $custCountry; 115 } 116 117 // Add location line to address parts, if present. 118 if (!empty($locationParts)) { 119 $addressParts[] = implode(', ', $locationParts); 120 } 121 122 // Format the final address with line breaks. 123 $custAddress = wp_kses_post(implode('<br>', $addressParts)); 124 115 125 $invoiceItems = get_post_meta($invoiceID, 'invoice_items', true); 116 126 $invoicetype = esc_html(get_post_meta($invoiceID, 'invoice_type', true)); -
wp360-invoice/tags/1.0.1/suite/index.php
r3214839 r3215313 12 12 add_action('wp_ajax_generate_invoice_pdf', array($this, 'wp360_invoice_generate_pdf')); 13 13 add_action('wp_ajax_nopriv_generate_invoice_pdf', array($this, 'wp360_invoice_generate_pdf')); 14 register_activation_hook(__FILE__, array($this, 'wp360invoice_refresh_permalinks')); 15 add_action('upgrader_process_complete', array($this, 'wp360invoice_handle_plugin_update'), 10, 2); 14 16 } 15 17 public function wp360_invoice_generate_pdf() { … … 160 162 } 161 163 } 164 public function wp360invoice_refresh_permalinks() { 165 flush_rewrite_rules(); 166 } 167 public function wp360invoice_handle_plugin_update($upgrader_object, $options) { 168 // Ensure this is for a plugin update 169 if ($options['action'] === 'update' && $options['type'] === 'plugin') { 170 $current_plugin_path = plugin_basename(__FILE__); 171 if (in_array($current_plugin_path, $options['plugins'])) { 172 $this->wp360invoice_refresh_permalinks(); 173 } 174 } 175 } 162 176 } 163 177 // Instantiate the class -
wp360-invoice/trunk/front/view_invoice.php
r3214855 r3215313 94 94 $addressParts = []; 95 95 if (!empty($custLine1)) { 96 $addressParts[] = $custLine1 ;96 $addressParts[] = $custLine1 . ','; 97 97 } 98 98 if (!empty($custLine2)) { 99 $addressParts[] = (!empty($custLine1) ? "<br>" : "") . $custLine2; 100 } 99 $addressParts[] = $custLine2 . ','; 100 } 101 102 // Combine city, postcode, state, and country into a single line. 103 $locationParts = []; 101 104 if (!empty($custCity)) { 102 $ addressParts[] = $custCity;105 $locationParts[] = $custCity; 103 106 } 104 107 if (!empty($custPostCode)) { 105 $ addressParts[] = $custPostCode;108 $locationParts[] = $custPostCode; 106 109 } 107 110 if (!empty($custState)) { 108 $ addressParts[] = $custState;111 $locationParts[] = $custState; 109 112 } 110 113 if (!empty($custCountry)) { 111 $addressParts[] = $custCountry; 112 } 113 $custAddress = esc_html(implode(', ', $addressParts)); 114 $custAddress = $custLine1.' <br> '.$custCity.', '.$custPostCode.', '.$custState.', '.$custCountry; 114 $locationParts[] = $custCountry; 115 } 116 117 // Add location line to address parts, if present. 118 if (!empty($locationParts)) { 119 $addressParts[] = implode(', ', $locationParts); 120 } 121 122 // Format the final address with line breaks. 123 $custAddress = wp_kses_post(implode('<br>', $addressParts)); 124 115 125 $invoiceItems = get_post_meta($invoiceID, 'invoice_items', true); 116 126 $invoicetype = esc_html(get_post_meta($invoiceID, 'invoice_type', true)); -
wp360-invoice/trunk/suite/index.php
r3214855 r3215313 12 12 add_action('wp_ajax_generate_invoice_pdf', array($this, 'wp360_invoice_generate_pdf')); 13 13 add_action('wp_ajax_nopriv_generate_invoice_pdf', array($this, 'wp360_invoice_generate_pdf')); 14 register_activation_hook(__FILE__, array($this, 'wp360invoice_refresh_permalinks')); 15 add_action('upgrader_process_complete', array($this, 'wp360invoice_handle_plugin_update'), 10, 2); 14 16 } 15 17 public function wp360_invoice_generate_pdf() { … … 160 162 } 161 163 } 164 public function wp360invoice_refresh_permalinks() { 165 flush_rewrite_rules(); 166 } 167 public function wp360invoice_handle_plugin_update($upgrader_object, $options) { 168 // Ensure this is for a plugin update 169 if ($options['action'] === 'update' && $options['type'] === 'plugin') { 170 $current_plugin_path = plugin_basename(__FILE__); 171 if (in_array($current_plugin_path, $options['plugins'])) { 172 $this->wp360invoice_refresh_permalinks(); 173 } 174 } 175 } 162 176 } 163 177 // Instantiate the class
Note: See TracChangeset
for help on using the changeset viewer.