WordPress.org

Making WordPress.org

Changeset 3176


Ignore:
Timestamp:
05/18/2016 09:56:54 PM (6 years ago)
Author:
obenland
Message:

Plugin Directory: Let Plugin Admins contact authors.

Unfortunately Support Press only accepts filler arguments through POST so we
can't use a link here. Froms within form are also not allowed, hence the hack
with moving the button into the review tools metabox after the DOM is ready.

See #1690.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r3034 r3176  
    2525        </ul>';
    2626
     27        add_filter( 'wp_comment_reply', function( $string ) use ( $post ) {
     28            $author = get_user_by( 'id', $post->post_author );
     29            ?>
     30            <form id="contact-author" class="contact-author" method="POST" action="https://supportpress.wordpress.org/plugins/thread-new.php">
     31                <input type="hidden" name="to_email" value="<?php echo esc_attr( $author->user_email ); ?>" />
     32                <input type="hidden" name="to_name" value="<?php echo esc_attr( $author->display_name ); ?>" />
     33                <input type="hidden" name="subject" value="<?php printf( esc_attr__( 'Feedback for %s' ), $post->post_title ); ?>" />
     34                <button class="button button-secondary" type="submit"><?php _e( 'Contact plugin author', 'wporg-plugins' ); ?></button>
     35            </form>
     36            <?php
     37            return $string;
     38        } );
    2739    }
    2840}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/js/edit-form.js

    r2977 r3176  
    3939                $( 'input[name="add_committer"]', '#add-committer' ).val( '' ).focus();
    4040            } );
     41
     42            $( '#contact-author' ).appendTo( '#plugin-review .inside' );
    4143        },
    4244
Note: See TracChangeset for help on using the changeset viewer.