Changeset 5371 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-developers.php
- Timestamp:
- 04/19/2017 07:08:37 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-developers.php
r5361 r5371 31 31 $output .= '</div>'; 32 32 33 $output .= '<div class="plugin-development">'; 34 33 35 $locales = Plugin_I18n::instance()->get_locales(); 34 $output .= '<div class="plugin-development"><p>'; 36 if ( ! empty( $locales ) ) { 37 $output .= '<p>'; 35 38 36 if ( ! empty( $locales ) ) { 37 $locales_list = implode( ', ', array_map( function( $locale ) use ( $slug ) { 38 return sprintf( '<a href="%1$s">%2$s</a>', esc_url( "{$locale->locale}.wordpress.org/plugins/{$slug}/" ), $locale->name ); 39 }, $locales ) ); 39 $locale_names = wp_list_pluck( $locales, 'name', 'wp_locale' ); 40 $wp_locales = wp_list_pluck( $locales,'wp_locale' ); 41 42 $sites = get_sites( [ 43 'network_id' => WPORG_GLOBAL_NETWORK_ID, 44 'public' => 1, 45 'path' => '/', 46 'locale__in' => $wp_locales, 47 'number' => '', 48 ] ); 49 50 $locales_list = implode( ', ', array_map( function( $site ) use ( $slug, $locale_names ) { 51 return sprintf( '<a href="%1$s">%2$s</a>', esc_url( "{$site->home}/plugins/{$slug}/" ), $locale_names[ $site->locale ] ); 52 }, $sites ) ); 53 40 54 /* Translators: 1: Plugin name; 2: Number of locales; 3: List of locales; */ 41 55 $output .= sprintf( '%1$s has been translated into these %2$d locales: %3$s.', $title, count( $locales ), $locales_list ) . ' '; … … 45 59 esc_url( "https://translate.wordpress.org/projects/wp-plugins/{$slug}/contributors" ) 46 60 ); 47 $output .= '< br />';61 $output .= '</p>'; 48 62 } 49 $output .= '</p>';50 63 51 64 /* Translators: 1: GlotPress URL; 2: Plugin name; */
Note: See TracChangeset
for help on using the changeset viewer.