Changeset 2416
- Timestamp:
- 01/28/2016 11:43:02 PM (10 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Files:
-
- 1 deleted
- 3 edited
-
includes/payment-request.php (modified) (6 diffs)
-
views/payment-request/input-textarea.php (modified) (1 diff)
-
views/payment-request/metabox-files.php (deleted)
-
views/payment-request/metabox-general.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php
r2415 r2416 163 163 ); 164 164 165 add_meta_box(166 'wcp_files',167 __( 'Attach Supporting Documentation', 'wordcamporg' ),168 array( $this, 'render_files_metabox' ),169 self::POST_TYPE,170 'normal',171 'high'172 );173 174 165 add_meta_box( 'wcp_log', __( 'Log', 'wordcamporg' ), array( $this, 'render_log_metabox' ), 175 166 self::POST_TYPE, 'normal', 'high' ); … … 289 280 290 281 /** 291 * Render the Vendor Details metabox292 *293 * @param WP_Post $post294 */295 public function render_files_metabox( $post ) {296 wp_nonce_field( 'wcp_files', 'wcp_files_nonce' );297 298 require_once( dirname( __DIR__ ) . '/views/payment-request/metabox-files.php' );299 }300 301 /**302 282 * Render the Log metabox 303 283 * … … 331 311 */ 332 312 protected function render_textarea_input( $post, $label, $name, $description = '' ) { 333 $ date = get_post_meta( $post->ID, '_camppayments_' . $name, true);313 $text = $this->get_field_value( $name, $post ); 334 314 335 315 require( dirname( __DIR__ ) . '/views/payment-request/input-textarea.php' ); … … 442 422 break; 443 423 424 case 'general_notes': 425 // The files_notes field was removed from the UI, so combine its value with general notes 426 $file_notes = get_post_meta( $post->ID, "_{$this->meta_key_prefix}_" . 'file_notes', true ); 427 $general_notes = get_post_meta( $post->ID, "_{$this->meta_key_prefix}_" . 'general_notes', true ); 428 429 if ( $file_notes ) { 430 $general_notes .= ' ' . $file_notes; 431 update_post_meta( $post->ID, "_{$this->meta_key_prefix}_" . 'general_notes', $general_notes ); 432 delete_post_meta( $post->ID, "_{$this->meta_key_prefix}_" . 'file_notes' ); 433 } 434 435 $value = $general_notes; 436 break; 437 444 438 default: 445 439 $value = get_post_meta( $post->ID, "_{$this->meta_key_prefix}_" . $name, true ); … … 603 597 604 598 // Verify nonces 605 $nonces = array( 'status_nonce', 'general_info_nonce', 'payment_details_nonce', 'vendor_details_nonce' , 'wcp_files_nonce'); // todo add prefix to all of these599 $nonces = array( 'status_nonce', 'general_info_nonce', 'payment_details_nonce', 'vendor_details_nonce' ); // todo add prefix to all of these 606 600 607 601 foreach ( $nonces as $nonce ) { … … 629 623 case 'description': 630 624 case 'general_notes': 631 case 'file_notes':632 625 case 'vendor_requested_payment_method': 633 626 $safe_value = wp_kses( $unsafe_value, wp_kses_allowed_html( 'strip' ) ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/input-textarea.php
r995 r2416 7 7 8 8 <td> 9 <textarea id="<?php echo esc_attr( $name ); ?>" name="<?php echo esc_attr( $name ); ?>" class="large-text"><?php echo esc_html( $date ); ?></textarea> 9 <textarea id="<?php echo esc_attr( $name ); ?>" name="<?php echo esc_attr( $name ); ?>" class="large-text"><?php 10 echo esc_html( $text ); 11 ?></textarea> 10 12 11 13 <?php if ( ! empty( $description ) ) : ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/metabox-general.php
r2413 r2416 32 32 ?> 33 33 34 <?php $this->render_files_input( $post, 'Files', 'files', __( 'Attach supporting documentation including invoices, contracts, or other vendor correspondence. If no supporting documentation is available, please indicate the reason in the notes below.', 'wordcamporg' ) ); ?> 34 35 <?php $this->render_textarea_input( $post, 'Notes', 'general_notes', 'Any other details you want to share.' ); ?> 35 36 </table>
Note: See TracChangeset
for help on using the changeset viewer.