Changeset 3111 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php
- Timestamp:
- 05/10/2016 08:43:48 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php
r2645 r3111 308 308 $invoice_meta = get_post_custom( $invoice_id ); 309 309 $sponsor_meta = get_post_custom( $invoice_meta['_wcbsi_sponsor_id'][0] ); 310 $sponsorship_level = self::get_sponsorship_level( $invoice_meta['_wcbsi_sponsor_id'][0] ); 311 // todo realign 310 312 311 313 $payload = array( 312 314 'wordcamp_name' => sanitize_text_field( get_wordcamp_name() ), 313 ' invoice_title' => sanitize_text_field( $invoice->post_title),315 'sponsorship_level' => sanitize_text_field( $sponsorship_level ), 314 316 'currency_code' => sanitize_text_field( $invoice_meta['_wcbsi_currency' ][0] ), 315 317 'qbo_class_id' => sanitize_text_field( $invoice_meta['_wcbsi_qbo_class_id' ][0] ), 316 318 'amount' => floatval( $invoice_meta['_wcbsi_amount' ][0] ), 317 319 'description' => sanitize_text_field( $invoice_meta['_wcbsi_description' ][0] ), 320 // todo realign 318 321 319 322 'statement_memo' => sprintf( … … 360 363 361 364 /** 365 * Get the sponsorship level name assigned to a sponsor 366 * 367 * @param int $sponsor_id 368 * 369 * @return false|string 370 */ 371 public static function get_sponsorship_level( $sponsor_id ) { 372 $sponsorship_level = false; 373 $sponsorship_levels = wp_get_object_terms( $sponsor_id, 'wcb_sponsor_level' ); 374 375 if ( isset( $sponsorship_levels[0]->name ) ) { 376 $sponsorship_level = $sponsorship_levels[0]->name; 377 } 378 379 return $sponsorship_level; 380 } 381 382 /** 362 383 * Get the paid invoices from the given set of sent invoices 363 384 *
Note: See TracChangeset
for help on using the changeset viewer.