Making WordPress.org

Changeset 3314


Ignore:
Timestamp:
06/07/2016 06:51:00 PM (9 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Permit fallback to commenter-submitted fields when comment is not submitted by logged-in user.

Primarily for theme-flexibility, though it applies to a few early user notes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r3282 r3314  
    112112                                    $url = 'https://profiles.wordpress.org/' . esc_attr( $commenter->user_nicename ) . '/';
    113113                                    $author = get_the_author_meta( 'display_name', $comment->user_id );
    114                                     $comment_author_link = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
    115114                                } else {
    116                                     $comment_author_link = '';
     115                                    $url = $comment->comment_author_url;
     116                                    $author = $comment->comment_author;
    117117                                }
     118
     119                                $comment_author_link = '';
     120                                if ( $url ) {
     121                                    $comment_author_link = "<a href='$url' rel='external nofollow' class='url'>";
     122                                }
     123                                $comment_author_link .= $author;
     124                                if ( $url ) {
     125                                    $comment_author_link .= '</a>';
     126                                }
     127
    118128                                printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) );
    119129                            ?>
Note: See TracChangeset for help on using the changeset viewer.