Changeset 3179
- Timestamp:
- 05/19/2016 04:45:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-tags.php
r3009 r3179 32 32 33 33 function wporg_plugins_download_link() { 34 return esc_url( sprintf( "https://downloads.wordpress.org/plugin/%s.%s.zip", get_post()->post_name, wporg_plugins_the_version() ) );34 return esc_url( Template::download_link( get_the_id() ) ); 35 35 } 36 36 37 37 function wporg_plugins_template_authors() { 38 $authors = get_post_meta( get_the_id(), 'contributors', true ); 38 $contributors = get_post_meta( get_the_id(), 'contributors', true ); 39 40 $authors = array(); 41 foreach ( $contributors as $contributor ) { 42 $user = get_user_by( 'login', $contributor ); 43 if ( $user ) { 44 $authors[] = $user; 45 } 46 } 47 48 if ( ! $authors ) { 49 $authors[] = new \WP_User( get_post()->post_author ); 50 } 39 51 40 52 $author_links = array(); 41 53 $and_more = false; 42 foreach ( $authors as $author ) { 43 $user = get_user_by( 'login', $author ); 44 if ( ! $user ) { 45 continue; 46 } 54 foreach ( $authors as $user ) { 47 55 $author_links[] = sprintf( '<a href="%s">%s</a>', 'https://profiles.wordpress.org/' . $user->user_nicename . '/', $user->display_name ); 48 56 if ( count( $author_links ) > 5 ) {
Note: See TracChangeset
for help on using the changeset viewer.