WordPress.org

Making WordPress.org

Changeset 5707


Ignore:
Timestamp:
07/20/2017 07:55:53 PM (3 years ago)
Author:
coffee2code
Message:

Plugin Directory: Add custom email subject for rejections and improve translatability of email subjects.

Props Ipstenu, SergeyBiryukov.
Fixes #2677.

File:
1 edited

Legend:

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

    r5643 r5707  
    3232        }
    3333
    34         if ( 'pending' != $post->post_status && 'new' != $post->post_status ) {
     34        if ( 'new' !== $post->post_status && 'pending' !== $post->post_status ) {
    3535            echo "<ul>
    3636                <li><a href='https://plugins.trac.wordpress.org/log/{$post->post_name}/'>" . __( 'Development Log', 'wporg-plugins' ) . "</a></li>
     
    4545        add_filter( 'wp_comment_reply', function( $string ) use ( $post ) {
    4646            $author = get_user_by( 'id', $post->post_author );
    47            
    48             $type   = 'Notice';
    49             if ( $post->post_status == 'new' || $post->post_status == 'pending' ) {
    50                 $type = 'Request';
     47
     48            if ( 'new' === $post->post_status || 'pending' === $post->post_status ) {
     49                /* translators: %s: plugin title */
     50                $subject = sprintf( __( '[WordPress Plugin Directory] Request: %s', 'wporg-plugins' ), $post->post_title );
     51            } elseif ( 'rejected' === $post->post_status ) {
     52                /* translators: %s: plugin title */
     53                $subject = sprintf( __( '[WordPress Plugin Directory] Rejection Explanation: %s', 'wporg-plugins' ), $post->post_title );
     54            } else {
     55                /* translators: %s: plugin title */
     56                $subject = sprintf( __( '[WordPress Plugin Directory] Notice: %s', 'wporg-plugins' ), $post->post_title );
    5157            }
    5258           
     
    5561                <input type="hidden" name="to_email" value="<?php echo esc_attr( $author->user_email ); ?>" />
    5662                <input type="hidden" name="to_name" value="<?php echo esc_attr( $author->display_name ); ?>" />
    57                 <input type="hidden" name="subject" value="<?php printf( esc_attr__( '[WordPress Plugin Directory] %s: %s', 'wporg-plugins' ), $type, $post->post_title ); ?>" />
     63                <input type="hidden" name="subject" value="<?php echo esc_attr( $subject ); ?>" />
    5864                <button class="button button-primary" type="submit"><?php _e( 'Contact plugin author', 'wporg-plugins' ); ?></button>
    5965            </form>
Note: See TracChangeset for help on using the changeset viewer.