Make WordPress Core

Ticket #29274: 29274.diff

File 29274.diff, 1.9 KB (added by nacin, 11 years ago)
  • src/wp-admin/includes/plugin-install.php

     
    324324        $api = plugins_api( 'plugin_information', array(
    325325                'slug' => wp_unslash( $_REQUEST['plugin'] ),
    326326                'is_ssl' => is_ssl(),
    327                 'fields' => array( 'banners' => true, 'reviews' => true )
     327                'fields' => array( 'banners' => true, 'reviews' => true, 'contributors' => true )
    328328        ) );
    329329
    330330        if ( is_wp_error( $api ) ) {
     
    470470                        <h3><?php _e( 'Contributors' ); ?></h3>
    471471                        <ul class="contributors">
    472472                                <?php
    473                                 foreach ( (array) $api->contributors as $contrib_username => $contrib_profile ) {
    474                                         if ( empty( $contrib_username ) && empty( $contrib_profile ) ) {
    475                                                 continue;
     473                                foreach ( (array) $api->contributors as $contrib_username => $contrib ) {
     474                                        $contrib_username = sanitize_user( $contrib_username );
     475                                        echo '<li>';
     476                                        if ( $contrib['profile'] ) {
     477                                                echo '<a href="' . esc_url( $contrib['profile'] ) . '" target="_blank">';
    476478                                        }
    477                                         if ( empty( $contrib_username ) ) {
    478                                                 $contrib_username = preg_replace( '/^.+\/(.+)\/?$/', '\1', $contrib_profile );
     479                                        echo "<img src='" . esc_url( $contrib['avatar'] . '&s=36' ) . "' width='18' height='18' />{$contrib_username}";
     480                                        if ( $contrib['profile'] ) {
     481                                                echo '</a>';
    479482                                        }
    480                                         $contrib_username = sanitize_user( $contrib_username );
    481                                         if ( empty( $contrib_profile ) ) {
    482                                                 echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
    483                                         } else {
    484                                                 echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
    485                                         }
     483                                        echo '</li>';
    486484                                }
    487485                                ?>
    488486                        </ul>