Making WordPress.org

Changeset 721


Ignore:
Timestamp:
06/24/2014 08:42:32 PM (10 years ago)
Author:
samuelsidler
Message:

Trac notifications plugin: Fix tabs vs spaces; make code more consistent and readable. Props SergeyBiryukov. Fixes #332

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php

    r643 r721  
    237237        echo '<h3>Help maintain this component</h3>';
    238238
    239         if ( $maintainers = get_post_meta( $post->ID, '_active_maintainers', true ) ) {
     239        $maintainers = get_post_meta( $post->ID, '_active_maintainers', true );
     240        if ( $maintainers ) {
     241            $maintainers = array_map( 'trim', explode( ',', $maintainers ) );
    240242            echo 'Component maintainers: ';
    241243            echo '<ul class="maintainers">';
    242             foreach ( array_map( 'trim', explode( ',', $maintainers ) ) as $maintainer ) {
    243                 echo '<li><a href="//profiles.wordpress.org/' . esc_attr( $maintainer ) . '"><img width="36" height="36" src="//wordpress.org/grav-redirect.php?user=' . esc_attr( $maintainer ) . '&amp;s=36" /></a> ' . $maintainer . '</li>';
     244            foreach ( $maintainers as $maintainer ) {
     245                echo '<li><a href="//profiles.wordpress.org/' . esc_attr( $maintainer ) . '">';
     246                echo '<img width="36" height="36" src="//wordpress.org/grav-redirect.php?user=' . esc_attr( $maintainer ) . '&amp;s=36" /></a> ' . $maintainer . '</li>';
    244247            }
    245248            echo "</ul>\n\n";
     
    251254        $followers = $this->trac->get_col( $this->trac->prepare( "SELECT username FROM _notifications WHERE type = 'component' AND value = %s", $post->post_title ) );
    252255        if ( $followers ) {
    253             echo 'Contributors following this component:';
    254       echo '<ul class="followers">';
     256            echo 'Contributors following this component: ';
     257            echo '<ul class="followers">';
    255258            foreach ( $followers as $follower ) {
    256259                $follower = esc_attr( $follower );
     
    258261                echo '<img width="36" height="36" src="//wordpress.org/grav-redirect.php?user=' . $follower . '&amp;s=36" /></a></li>';
    259262            }
    260       echo '</ul>';
     263            echo '</ul>';
    261264        }
    262265
Note: See TracChangeset for help on using the changeset viewer.