WordPress.org

Make WordPress Core

Ticket #19784: 19784.diff

File 19784.diff, 1.6 KB (added by collinsinternet, 8 years ago)

Update to plugin-install.php that extracts the contributor usernames (array keys) and profile urls then displays them below the author info.

  • plugin-install.php

     
    314314
    315315        if ( is_wp_error( $api ) )
    316316                wp_die( $api );
    317 
     317        //Loop the contributor array, create link tags similar to $api->author and then implode the array into a string.
     318        if ( ! empty( $api->contributors ) && ( is_array( $api->contributors )) ):
     319            $contributors=array();
     320            foreach ($api->contributors as $contributor=>$url):
     321                $contributors[]='<a href="' . $url . '">' . $contributor . '</a>';
     322            endforeach;
     323            $api->contributors=implode(", ",$contributors);
     324        endif;
    318325        $plugins_allowedtags = array(
    319326                'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ),
    320327                'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ),
     
    380387                        <li><strong><?php _e('Version:') ?></strong> <?php echo $api->version ?></li>
    381388<?php endif; if ( ! empty( $api->author ) ) : ?>
    382389                        <li><strong><?php _e('Author:') ?></strong> <?php echo links_add_target($api->author, '_blank') ?></li>
     390                        <?php endif; if ( ! empty( $api->contributors ) ) : ?>
     391                        <li><strong><?php _e('Contributors:') ?></strong> <?php echo links_add_target($api->contributors, '_blank') ?></li>
    383392<?php endif; if ( ! empty( $api->last_updated ) ) : ?>
    384393                        <li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php
    385394                                                        printf( __('%s ago'), human_time_diff(strtotime($api->last_updated)) ) ?></span></li>