Changeset 8699 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-invoices/includes/class-camptix-addon-invoices.php
- Timestamp:
- 04/26/2019 06:21:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-invoices/includes/class-camptix-addon-invoices.php
r8670 r8699 273 273 */ 274 274 public static function create_invoice( $attendee, $order, $metas ) { 275 $number = self::create_invoice_number(); 275 276 $invoice = array( 277 'post_type' => 'tix_invoice', 278 'post_status' => 'draft', 279 ); 280 281 $invoice_id = wp_insert_post( $invoice ); 282 if ( ! $invoice_id || is_wp_error( $invoice_id ) ) { 283 return; 284 }//end if 285 286 $number = get_post_meta( $invoice_id, 'invoice_number', true ); 276 287 $attendee_email = get_post_meta( $attendee->ID, 'tix_email', true ); 277 288 $txn_id = get_post_meta( $attendee->ID, 'tix_transaction_id', true ); … … 300 311 }//end if 301 312 302 $invoice = array(303 'post_type' => 'tix_invoice',304 'post_status' => 'draft',305 'post_title' => $invoice_title,306 'post_name' => sprintf( 'invoice-%s', $number ),307 );308 309 $invoice_id = wp_insert_post( $invoice );310 if ( ! $invoice_id || is_wp_error( $invoice_id ) ) {311 return;312 }//end if313 update_post_meta( $invoice_id, 'invoice_number', $number );314 313 update_post_meta( $invoice_id, 'invoice_metas', $metas ); 315 314 update_post_meta( $invoice_id, 'original_order', $order ); … … 320 319 'ID' => $invoice_id, 321 320 'post_status' => 'publish', 321 'post_title' => $invoice_title, 322 'post_name' => sprintf( 'invoice-%s', $number ), 322 323 ) 323 324 );
Note: See TracChangeset
for help on using the changeset viewer.