WordPress.org

Making WordPress.org

Changeset 6028


Ignore:
Timestamp:
10/14/2017 12:33:55 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: When clicking "Contact plugin author", include all plugin committers in a CC field.

Fixes #2855.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php

    r5707 r6028  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory\Admin\Metabox;
     3use WordPressdotorg\Plugin_Directory\Tools;
    34
    45/**
     
    4647            $author = get_user_by( 'id', $post->post_author );
    4748
     49            $committers = Tools::get_plugin_committers( $post->post_name );
     50            $committers = array_map( function ( $user_login ) {
     51                return get_user_by( 'login', $user_login );
     52            }, $committers );
     53
     54            $cc_emails = wp_list_pluck( $committers, 'user_email' );
     55            $cc_emails = implode( ', ', array_diff( $cc_emails, array( $author->user_email ) ) );
     56
    4857            if ( 'new' === $post->post_status || 'pending' === $post->post_status ) {
    4958                /* translators: %s: plugin title */
     
    6170                <input type="hidden" name="to_email" value="<?php echo esc_attr( $author->user_email ); ?>" />
    6271                <input type="hidden" name="to_name" value="<?php echo esc_attr( $author->display_name ); ?>" />
     72                <input type="hidden" name="cc" value="<?php echo esc_attr( $cc_emails ); ?>" />
    6373                <input type="hidden" name="subject" value="<?php echo esc_attr( $subject ); ?>" />
    6474                <button class="button button-primary" type="submit"><?php _e( 'Contact plugin author', 'wporg-plugins' ); ?></button>
Note: See TracChangeset for help on using the changeset viewer.