Making WordPress.org


Ignore:
Timestamp:
09/16/2020 10:19:42 PM (6 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

​https://github.com/WordPress/learn/commit/078146d2be1cadea501a2132d5cfc7c964f7647f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php

    r10237 r10273  
    44
    55use Error;
     6use function WordPressdotorg\Locales\get_locale_name_from_code;
    67use function WPOrg_Learn\Post_Meta\get_workshop_duration;
    78
    … …  
    7475
    7576        foreach ( $fields as $key => $value ) {
    76                 $output .= sprintf( '<li><b>%1$s</b><span>%2$s</span></li>', $key, $value );
     77                $output .= sprintf(
     78                        '<li><b>%1$s</b><span>%2$s</span></li>',
     79                        $key,
     80                        $value
     81                );
    7782        }
    7883
    … …  
    99104                __( 'Topic', 'wporg-learn' )    => implode( ', ', array_map( 'esc_html', $topics ) ),
    100105                __( 'Level', 'wporg-learn' )    => implode( ', ', array_map( 'esc_html', $level ) ),
    101                 __( 'Language', 'wporg-learn' ) => esc_html( $post->video_language ),
    102                 __( 'Captions', 'wporg-learn' ) => implode( ', ', array_map( 'esc_html', $captions ) ),
     106                __( 'Language', 'wporg-learn' ) => esc_html( get_locale_name_from_code( $post->video_language, 'native' ) ),
     107                __( 'Captions', 'wporg-learn' ) => implode(
     108                        ', ',
     109                        array_map(
     110                                function( $caption_lang ) {
     111                                        return esc_html( get_locale_name_from_code( $caption_lang, 'native' ) );
     112                                },
     113                                $captions
     114                        )
     115                ),
    103116        );
    104117
Note: See TracChangeset for help on using the changeset viewer.