Changeset 4278 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-committers.php
- Timestamp:
- 10/21/2016 05:57:46 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-committers.php
r4263 r4278 2 2 namespace WordPressdotorg\Plugin_Directory\Widgets; 3 3 use WordPressdotorg\Plugin_Directory\Template; 4 use WordPressdotorg\Plugin_Directory\Tools; 4 5 5 6 /** … … 29 30 $post = get_post(); 30 31 32 $committers = Tools::get_plugin_committers( $post->post_name ); 33 $committers = array_map( function( $user_login ) { 34 return get_user_by( 'login', $user_login ); 35 }, $committers ); 36 31 37 echo $args['before_widget']; 32 38 ?> 39 <style> 40 <?php // TODO: Yes, these need to be moved into the CSS somewhere. ?> 41 h3 a.addnew:before { 42 content: '+'; 43 } 44 ul.committer-list { 45 list-style: none; 46 margin: 0; 47 font-size: 0.9em; 48 } 49 ul.committer-list li { 50 clear: both; 51 padding-bottom: 0.5em; 52 } 53 ul.committer-list a.remove { 54 color: red; 55 visibility: hidden; 56 } 57 ul.committer-list li:hover a.remove { 58 visibility: visible; 59 } 60 </style> 61 <h3><?php _e( 'Committers', 'wporg-plugins' ); ?> <a href="#" class="addnew"><?php _e( 'Add', 'wporg-plugins' ); ?></button></h3> 33 62 34 <h3 class="screen-reader-text"><?php echo apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Committers', 'wporg-plugins' ) : $instance['title'], $instance, $this->id_base ); ?></h3> 63 <ul class="committer-list"> 64 <?php foreach ( $committers as $committer ) { 65 echo '<li>' . 66 get_avatar( $committer->ID, 32 ) . 67 '<a href="' . esc_url( 'https://profiles.wordpress.org/' . $committer->user_nicename ) . '">' . Template::encode( $committer->display_name ) . '</a>' . 68 '<br><small>' . esc_html( $committer->user_email ) . ' ' . 69 '<a href="#" class="remove">' . __( 'Remove', 'wporg-plugins' ) . '</a>' . 70 '</small>' . 71 '</li>'; 72 } ?> 73 </ul> 35 74 36 75
Note: See TracChangeset
for help on using the changeset viewer.