Making WordPress.org

Ticket #3286: 3286.diff

File 3286.diff, 2.0 KB (added by sippis, 7 years ago)
  • wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php
    index 0cd5f6c2..d6064f32 100644
    add_action( 'transition_post_status', __NAMESPACE__ . '\transition_post_status', 
    2626// Miscellaneous
    2727add_filter( 'map_meta_cap',        __NAMESPACE__ . '\modify_capabilities', 10, 4 );
    2828add_filter( 'display_post_states', __NAMESPACE__ . '\display_post_states'        );
     29add_action( 'admin_init',          __NAMESPACE__ . '\maybe_display_admin_notices'   );
    2930
    3031/**
    3132 * Register the custom post type
    function display_post_states( $states ) { 
    404405}
    405406
    406407/**
     408 * Maybe display admin notices
     409 */
     410function maybe_display_admin_notices() {
     411  // Display notice when viewing listing of reimbursement requests or creating new
     412  if ( isset( $_GET['post_type'] ) && POST_TYPE === $_GET['post_type'] ) {
     413    add_action( 'admin_notices', __NAMESPACE__ . '\display_notice_group_expenses' );
     414  }
     415}
     416
     417/**
     418 *  Display admin notice reminding about grouping expenses
     419 */
     420function display_notice_group_expenses() {
     421  $class = 'notice notice-warning';
     422  $message = esc_html__( 'Each wire transfer and check costs us processing fees, so if you have multiple out-of-pocket expenses, please try to group them into one reimbursement request.', 'wordcamporg' );
     423
     424  printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message );
     425}
     426
     427/**
    407428 * Set the status when reimbursements are submitted.
    408429 *
    409430 * @param array $post_data
    function _generate_payment_report_jpm_wires( $args ) { 
    15521573        // JPM chokes on accents and non-latin characters.
    15531574        $results = remove_accents( $results );
    15541575        return $results;
    1555 }
    1556  No newline at end of file
     1576}