Making WordPress.org


Ignore:
Timestamp:
03/08/2016 01:46:55 PM (10 years ago)
Author:
kovshenin
Message:

WordCamp Budgets: Add a paid_date field to reimbursement requests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php

    r2683 r2705  
    322322    $selected_reason   = get_post_meta( $post->ID, '_wcbrr_reason',         true );
    323323    $other_reason      = get_post_meta( $post->ID, '_wcbrr_reason_other',   true );
     324    $date_paid         = get_post_meta( $post->ID, '_wcbrr_date_paid',      true );
    324325
    325326    if ( empty ( $name_of_payer ) ) {
     
    453454        validate_and_save_text_fields( $post_id, $text_fields, $_POST );
    454455
     456        // Save payment date
     457        if ( isset( $_POST['_wcbrr_date_paid'] ) && current_user_can( 'manage_network' ) ) {
     458            $date_paid = sanitize_text_field( $_POST['_wcbrr_date_paid'] );
     459            $date_paid = absint( strtotime( $date_paid ) );
     460            update_post_meta( $post->ID, '_wcbrr_date_paid', $date_paid );
     461        }
     462
    455463        \WordCamp_Budgets::validate_save_payment_method_fields( $post_id, 'wcbrr' );
    456464
Note: See TracChangeset for help on using the changeset viewer.