Making WordPress.org


Ignore:
Timestamp:
01/14/2016 03:21:54 PM (10 years ago)
Author:
iandunn
Message:

WordCamp Budgets: Centralize get_requester_formatted_email() for all modules.

File:
1 edited

Legend:

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

    r2292 r2296  
    435435
    436436            case 'requester':
    437                 $value = $this->get_requester_formatted_email( $post->post_author );
     437                $value = WordCamp_Budgets::get_requester_formatted_email( $post->post_author );
    438438                break;
    439439
     
    477477
    478478        return $value;
    479     }
    480 
    481     /**
    482      * Get the e-mail address of the requester in `Name <address>` format
    483      *
    484      * @param int $post_author_id
    485      *
    486      * @return false|string
    487      */
    488     protected function get_requester_formatted_email( $post_author_id ) {
    489         $address   = false;
    490         $requester = get_user_by( 'id', $post_author_id );
    491 
    492         if ( is_a( $requester, 'WP_User' ) ) {
    493             $address = sprintf( '%s <%s>', $requester->get( 'display_name' ), $requester->get( 'user_email' ) );
    494         }
    495 
    496         return $address;
    497479    }
    498480
     
    599581     */
    600582    protected function notify_requester_payment_made( $request_id, $post_data ) {
    601         if ( ! $to = $this->get_requester_formatted_email( $post_data['post_author'] ) ) {
     583        if ( ! $to = WordCamp_Budgets::get_requester_formatted_email( $post_data['post_author'] ) ) {
    602584            return;
    603585        }
     
    630612     */
    631613    protected function notify_requester_request_incomplete( $request_id, $post_data, $post_data_raw ) {
    632         if ( ! $to = $this->get_requester_formatted_email( $post_data['post_author'] ) ) {
     614        if ( ! $to = WordCamp_Budgets::get_requester_formatted_email( $post_data['post_author'] ) ) {
    633615            return;
    634616        }
Note: See TracChangeset for help on using the changeset viewer.