Making WordPress.org

Changeset 10169


Ignore:
Timestamp:
08/13/2020 11:43:14 PM (4 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

https://github.com/WordPress/learn/compare/1accd3db38a60230689bdc157f9e82081d35d163...38e7793fd20434d72ca898988d017ba2009fb677

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
2 deleted
56 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/style-block-styles.css

    r10146 r10169  
    1 .is-style-primary .wp-block-button__link,.is-style-primary .wp-block-button__link:visited,.is-style-primary-full-width .wp-block-button__link,.is-style-primary-full-width .wp-block-button__link:visited,.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#0085ba;color:#fff;text-align:center;font-size:13px;font-weight:bold;padding:0.9rem;margin:32px 0}.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#f8f9f9;color:#555;border:1px solid #d9dcdf;box-shadow:0 1px 0 #d9dcdf}.is-style-primary-full-width,.is-style-secondary-full-width{width:100%}.is-style-primary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link{width:100%}
     1.is-style-primary .wp-block-button__link,.is-style-primary .wp-block-button__link:visited,.is-style-primary-full-width .wp-block-button__link,.is-style-primary-full-width .wp-block-button__link:visited,.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#0085ba;color:#fff;text-align:center;font-size:13px;font-weight:600;padding:0.9rem;margin:32px 0}.is-style-secondary .wp-block-button__link,.is-style-secondary .wp-block-button__link:visited,.is-style-secondary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link:visited{background:#f8f9f9;color:#555;border:1px solid #d9dcdf;box-shadow:0 1px 0 #d9dcdf}.is-style-primary-full-width,.is-style-secondary-full-width{width:100%}.is-style-primary-full-width .wp-block-button__link,.is-style-secondary-full-width .wp-block-button__link{width:100%}
    22
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/style-workshop-details.css

    r10146 r10169  
    1 .wp-block-wporg-learn-workshop-details{list-style:none;margin:0;padding:0;color:#555d66}.wp-block-wporg-learn-workshop-details li{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid #E2E4E7}.wp-block-wporg-learn-workshop-details li:last-child{border-bottom:1px solid #E2E4E7}.wp-block-wporg-learn-workshop-details li>span{text-align:right;flex-basis:50%;word-break:normal}
     1.wp-block-wporg-learn-workshop-details{list-style:none;margin:0;padding:0;color:#555d66}.wp-block-wporg-learn-workshop-details li{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid #e2e4e7}.wp-block-wporg-learn-workshop-details li:last-child{border-bottom:1px solid #e2e4e7}.wp-block-wporg-learn-workshop-details li>span{text-align:right;flex-basis:50%;word-break:normal}
    22
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php

    r10147 r10169  
    1212 *
    1313 * @see https://developer.wordpress.org/block-editor/tutorials/block-tutorial/applying-styles-with-stylesheets/
     14 * @throws Error If the build files are not found.
    1415 */
    1516function workshop_details_init() {
     
    2324    }
    2425
    25     $script_asset = require( $script_asset_path );
     26    $script_asset = require $script_asset_path;
    2627    wp_register_script(
    2728        'workshop-details-editor-script',
     
    5152        'editor_style'    => 'workshop-details-editor-style',
    5253        'style'           => 'workshop-details-style',
    53         'render_callback' => __NAMESPACE__ . '\workshop_details_render_callback'
     54        'render_callback' => __NAMESPACE__ . '\workshop_details_render_callback',
    5455    ) );
    5556}
    56 
    57 
    5857
    5958/**
    6059 * Build the html output based on input fields
    6160 *
    62  * @param array   $fields
     61 * @param array $fields
    6362 * @return string HTML output.
    6463 */
     
    6665    $output = '<ul class="wp-block-wporg-learn-workshop-details">';
    6766
    68     foreach( $fields as $key => $value ) {
     67    foreach ( $fields as $key => $value ) {
    6968        $output .= sprintf( '<li><b>%1$s</b><span>%2$s</span></li>', $key, $value );
    7069    }
     
    8382 */
    8483function workshop_details_render_callback( $attributes, $content ) {
    85     $post = get_post();
    86     $topics = wp_get_post_terms( $post->ID, 'topic', array( 'fields' => 'names' ) );
    87     $level = wp_get_post_terms( $post->ID, 'level', array( 'fields' => 'names' ) );
     84    $post     = get_post();
     85    $topics   = wp_get_post_terms( $post->ID, 'topic', array( 'fields' => 'names' ) );
     86    $level    = wp_get_post_terms( $post->ID, 'level', array( 'fields' => 'names' ) );
    8887    $captions = get_post_meta( $post->ID, 'video_caption_language' );
    8988
    9089    $fields = array(
    91         __( 'Length' , 'wporg-learn') => get_workshop_duration( $post, 'string' ),
    92         __( 'Topic' , 'wporg-learn') => implode( ', ', array_map( 'esc_html', $topics ) ),
    93         __( 'Level' , 'wporg-learn') => implode( ', ', array_map( 'esc_html', $level ) ),
    94         __( 'Language' , 'wporg-learn') => esc_html( $post->video_language ),
    95         __( 'Captions' , 'wporg-learn') => implode( ', ', array_map( 'esc_html', $captions ) ),
     90        __( 'Length', 'wporg-learn' )  => get_workshop_duration( $post, 'string' ),
     91        __( 'Topic', 'wporg-learn' )    => implode( ', ', array_map( 'esc_html', $topics ) ),
     92        __( 'Level', 'wporg-learn' )    => implode( ', ', array_map( 'esc_html', $level ) ),
     93        __( 'Language', 'wporg-learn' ) => esc_html( $post->video_language ),
     94        __( 'Captions', 'wporg-learn' ) => implode( ', ', array_map( 'esc_html', $captions ) ),
    9695    );
    9796
    98     // Remove empty fields
     97    // Remove empty fields.
    9998    $fields_to_output = array_filter( $fields );
    10099
     
    104103/**
    105104 * Enqueue scripts and stylesheets for custom block styles.
     105 *
     106 * @throws Error If the build files are not found.
    106107 */
    107108function enqueue_block_style_assets() {
     
    116117        }
    117118
    118         $script_asset = require( $script_asset_path );
     119        $script_asset = require $script_asset_path;
    119120        wp_enqueue_script(
    120121            'wporg-learn-block-styles',
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-lesson-plan.php

    r10142 r10169  
    44class Lesson_Plan {
    55
    6 /**
    7   *  Register Lesson Plan Post Type
    8   */
    9 public static function lesson_plan_post_type() {
    10 
    11     $labels = array(
    12         'name'                  => _x( 'Lesson Plans', 'Post Type General Name', 'wporg_learn' ),
    13         'singular_name'         => _x( 'Lesson Plan', 'Post Type Singular Name', 'wporg_learn' ),
    14         'menu_name'             => __( 'Lesson Plans', 'wporg_learn' ),
    15         'name_admin_bar'        => __( 'Lesson Plan', 'wporg_learn' ),
    16         'archives'              => __( 'Lesson Archives', 'wporg_learn' ),
    17         'attributes'            => __( 'Lesson Attributes', 'wporg_learn' ),
    18         'parent_item_colon'     => __( 'Parent Lesson:', 'wporg_learn' ),
    19         'all_items'             => __( 'All Lessons', 'wporg_learn' ),
    20         'add_new_item'          => __( 'Add New Lesson', 'wporg_learn' ),
    21         'add_new'               => __( 'Add New', 'wporg_learn' ),
    22         'new_item'              => __( 'New Lesson Plan', 'wporg_learn' ),
    23         'edit_item'             => __( 'Edit Lesson Plan', 'wporg_learn' ),
    24         'update_item'           => __( 'Update Lesson Plan', 'wporg_learn' ),
    25         'view_item'             => __( 'View Lesson', 'wporg_learn' ),
    26         'view_items'            => __( 'View Lessons', 'wporg_learn' ),
    27         'search_items'          => __( 'Search Lesson', 'wporg_learn' ),
    28         'not_found'             => __( 'Not found', 'wporg_learn' ),
    29         'not_found_in_trash'    => __( 'Not found in Trash', 'wporg_learn' ),
    30         'featured_image'        => __( 'Featured Image', 'wporg_learn' ),
    31         'set_featured_image'    => __( 'Set featured image', 'wporg_learn' ),
    32         'remove_featured_image' => __( 'Remove featured image', 'wporg_learn' ),
    33         'use_featured_image'    => __( 'Use as featured image', 'wporg_learn' ),
    34         'insert_into_item'      => __( 'Insert into lesson', 'wporg_learn' ),
    35         'uploaded_to_this_item' => __( 'Uploaded to this lesson', 'wporg_learn' ),
    36         'items_list'            => __( 'Lessons list', 'wporg_learn' ),
    37         'items_list_navigation' => __( 'Lessons list navigation', 'wporg_learn' ),
    38         'filter_items_list'     => __( 'Filter Lessons list', 'wporg_learn' ),
    39     );
    40     $args = array(
    41         'label'                 => __( 'Lesson Plan', 'wporg_learn' ),
    42         'description'           => __( 'WordPress.org Training Lesson Plan', 'wporg_learn' ),
    43         'labels'                => $labels,
    44         'supports'              => array( 'title', 'editor', 'comments', 'revisions', 'custom-fields' ),
    45         'taxonomies'            => array( 'duration', 'level', 'audience', 'instruction_type' ),
    46         'hierarchical'          => true,
    47         'public'                => true,
    48         'show_ui'               => true,
    49         'show_in_menu'          => true,
    50         'menu_position'         => 5,
    51         'menu_icon'             => 'dashicons-welcome-learn-more',
    52         'show_in_admin_bar'     => true,
    53         'show_in_nav_menus'     => true,
    54         'can_export'            => true,
    55         'has_archive'           => 'lesson-plans',
    56         'exclude_from_search'  => false,
    57         'publicly_queryable'    => true,
    58         'capability_type'       => 'page',
    59         'show_in_rest'          => true,
    60     );
    61     register_post_type( 'lesson-plan', $args );
    62 }
    63 
    64 /**
    65   * Register duration Taxonomy
    66   */
    67 public static function lesson_duration_taxonomy() {
    68 
    69     $labels = array(
    70         'name'                       => _x( 'Duration', 'Taxonomy General Name', 'wporg_learn' ),
    71         'singular_name'              => _x( 'Duration', 'Taxonomy Singular Name', 'wporg_learn' ),
    72         'menu_name'                  => __( 'Duration', 'wporg_learn' ),
    73         'all_items'                  => __( 'All Durations', 'wporg_learn' ),
    74         'parent_item'                => __( 'Parent Duration', 'wporg_learn' ),
    75         'parent_item_colon'          => __( 'Parent Duration:', 'wporg_learn' ),
    76         'new_item_name'              => __( 'New Duration', 'wporg_learn' ),
    77         'add_new_item'               => __( 'Add New Duration', 'wporg_learn' ),
    78         'edit_item'                  => __( 'Edit Duration', 'wporg_learn' ),
    79         'update_item'                => __( 'Update Duration', 'wporg_learn' ),
    80         'view_item'                  => __( 'View Duration', 'wporg_learn' ),
    81         'separate_items_with_commas' => __( 'Separate durations with commas', 'wporg_learn' ),
    82         'add_or_remove_items'        => __( 'Add or remove durations', 'wporg_learn' ),
    83         'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
    84         'popular_items'              => __( 'Popular durations', 'wporg_learn' ),
    85         'search_items'               => __( 'Search durations', 'wporg_learn' ),
    86         'not_found'                  => __( 'Not Found', 'wporg_learn' ),
    87         'no_terms'                   => __( 'No durations', 'wporg_learn' ),
    88         'items_list'                 => __( 'Durations list', 'wporg_learn' ),
    89         'items_list_navigation'      => __( 'Durations list navigation', 'wporg_learn' ),
    90     );
    91     $args = array(
    92         'labels'                     => $labels,
    93         'hierarchical'               => false,
    94         'public'                     => true,
    95         'show_ui'                    => true,
    96         'show_admin_column'          => true,
    97         'show_in_nav_menus'          => false,
    98         'show_tagcloud'              => false,
    99         'show_in_rest'               => true,
    100     );
    101     register_taxonomy( 'duration', array( 'lesson-plan' ), $args );
    102 
    103 }
    104 
    105 /**
    106   * Register Lesson Experience Level Taxonomy
    107   */
    108 public static function lesson_level_taxonomy() {
    109 
    110     $labels = array(
    111         'name'                       => _x( 'Experience Levels', 'Taxonomy General Name', 'wporg_learn' ),
    112         'singular_name'              => _x( 'Experience Level', 'Taxonomy Singular Name', 'wporg_learn' ),
    113         'menu_name'                  => __( 'Experience Level', 'wporg_learn' ),
    114         'all_items'                  => __( 'All Experience Levels', 'wporg_learn' ),
    115         'parent_item'                => __( 'Parent Experience Level', 'wporg_learn' ),
    116         'parent_item_colon'          => __( 'Parent Experience Level:', 'wporg_learn' ),
    117         'new_item_name'              => __( 'New Experience Level Name', 'wporg_learn' ),
    118         'add_new_item'               => __( 'Add New Experience Level', 'wporg_learn' ),
    119         'edit_item'                  => __( 'Edit Experience Level', 'wporg_learn' ),
    120         'update_item'                => __( 'Update Experience Level', 'wporg_learn' ),
    121         'view_item'                  => __( 'View Experience Level', 'wporg_learn' ),
    122         'separate_items_with_commas' => __( 'Separate experience levels with commas', 'wporg_learn' ),
    123         'add_or_remove_items'        => __( 'Add or remove experience levels', 'wporg_learn' ),
    124         'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
    125         'popular_items'              => __( 'Popular Experience levels', 'wporg_learn' ),
    126         'search_items'               => __( 'Search Experience Levels', 'wporg_learn' ),
    127         'not_found'                  => __( 'Not Experience Found', 'wporg_learn' ),
    128         'no_terms'                   => __( 'No experience levels', 'wporg_learn' ),
    129         'items_list'                 => __( 'Experience Levels list', 'wporg_learn' ),
    130         'items_list_navigation'      => __( 'Experience Levels list navigation', 'wporg_learn' ),
    131     );
    132     $args = array(
    133         'labels'                     => $labels,
    134         'hierarchical'               => false,
    135         'public'                     => true,
    136         'show_ui'                    => true,
    137         'show_admin_column'          => true,
    138         'show_in_nav_menus'          => true,
    139         'show_tagcloud'              => false,
    140         'show_in_rest'               => true,
    141     );
    142     register_taxonomy( 'level', array( 'lesson-plan' ), $args );
    143 
    144 }
    145 
    146 /**
    147   * Register Lesson Audience Taxonomy
    148   */
    149 public static function lesson_audience_taxonomy() {
    150 
    151     $labels = array(
    152         'name'                       => _x( 'Audiences', 'Taxonomy General Name', 'wporg_learn' ),
    153         'singular_name'              => _x( 'Audience', 'Taxonomy Singular Name', 'wporg_learn' ),
    154         'menu_name'                  => __( 'Audience', 'wporg_learn' ),
    155         'all_items'                  => __( 'All Audiences', 'wporg_learn' ),
    156         'parent_item'                => __( 'Parent Audience', 'wporg_learn' ),
    157         'parent_item_colon'          => __( 'Parent Audience:', 'wporg_learn' ),
    158         'new_item_name'              => __( 'New Audience Name', 'wporg_learn' ),
    159         'add_new_item'               => __( 'Add Audience', 'wporg_learn' ),
    160         'edit_item'                  => __( 'Edit Audience', 'wporg_learn' ),
    161         'update_item'                => __( 'Update Audience', 'wporg_learn' ),
    162         'view_item'                  => __( 'View Audience', 'wporg_learn' ),
    163         'separate_items_with_commas' => __( 'Separate Audiences with commas', 'wporg_learn' ),
    164         'add_or_remove_items'        => __( 'Add or remove Audiences', 'wporg_learn' ),
    165         'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
    166         'popular_items'              => __( 'Popular Audiences', 'wporg_learn' ),
    167         'search_items'               => __( 'Search Audiences', 'wporg_learn' ),
    168         'not_found'                  => __( 'Not Found', 'wporg_learn' ),
    169         'no_terms'                   => __( 'No Audiences', 'wporg_learn' ),
    170         'items_list'                 => __( 'Audiences list', 'wporg_learn' ),
    171         'items_list_navigation'      => __( 'Audiences list navigation', 'wporg_learn' ),
    172     );
    173     $args = array(
    174         'labels'                     => $labels,
    175         'hierarchical'               => false,
    176         'public'                     => true,
    177         'show_ui'                    => true,
    178         'show_admin_column'          => true,
    179         'show_in_nav_menus'          => true,
    180         'show_tagcloud'              => false,
    181         'show_in_rest'               => true,
    182     );
    183     register_taxonomy( 'audience', array( 'lesson-plan' ), $args );
    184 
    185 }
    186 
    187 /**
    188   * Register Instruction Type Taxonomy
    189   */
    190 public static function lesson_instruction_type_taxonomy() {
    191 
    192     $labels = array(
    193         'name'                       => _x( 'Instruction Types', 'Taxonomy General Name', 'wporg_learn' ),
    194         'singular_name'              => _x( 'Instruction Type', 'Taxonomy Singular Name', 'wporg_learn' ),
    195         'menu_name'                  => __( 'Instruction Type', 'wporg_learn' ),
    196         'all_items'                  => __( 'All Instruction Types', 'wporg_learn' ),
    197         'parent_item'                => __( 'Parent Instruction Type', 'wporg_learn' ),
    198         'parent_item_colon'          => __( 'Parent Instruction Type:', 'wporg_learn' ),
    199         'new_item_name'              => __( 'New Instruction Type Name', 'wporg_learn' ),
    200         'add_new_item'               => __( 'Add Instruction Type', 'wporg_learn' ),
    201         'edit_item'                  => __( 'Edit Instruction Type', 'wporg_learn' ),
    202         'update_item'                => __( 'Update Instruction Type', 'wporg_learn' ),
    203         'view_item'                  => __( 'View Instruction Type', 'wporg_learn' ),
    204         'separate_items_with_commas' => __( 'Separate Instruction Types with commas', 'wporg_learn' ),
    205         'add_or_remove_items'        => __( 'Add or remove Instruction Types', 'wporg_learn' ),
    206         'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
    207         'popular_items'              => __( 'Popular Instruction Types', 'wporg_learn' ),
    208         'search_items'               => __( 'Search Instruction Types', 'wporg_learn' ),
    209         'not_found'                  => __( 'Not Found', 'wporg_learn' ),
    210         'no_terms'                   => __( 'No Instruction Types', 'wporg_learn' ),
    211         'items_list'                 => __( 'Instruction Types list', 'wporg_learn' ),
    212         'items_list_navigation'      => __( 'Instruction Types list navigation', 'wporg_learn' ),
    213     );
    214     $args = array(
    215         'labels'                     => $labels,
    216         'hierarchical'               => false,
    217         'public'                     => true,
    218         'show_ui'                    => true,
    219         'show_admin_column'          => true,
    220         'show_in_nav_menus'          => true,
    221         'show_tagcloud'              => false,
    222         'show_in_rest'               => true,
    223     );
    224     register_taxonomy( 'instruction_type', array( 'lesson-plan' ), $args );
    225 
    226 }
     6    /**
     7    *  Register Lesson Plan Post Type
     8    */
     9    public static function lesson_plan_post_type() {
     10
     11        $labels = array(
     12            'name'                  => _x( 'Lesson Plans', 'Post Type General Name', 'wporg_learn' ),
     13            'singular_name'         => _x( 'Lesson Plan', 'Post Type Singular Name', 'wporg_learn' ),
     14            'menu_name'             => __( 'Lesson Plans', 'wporg_learn' ),
     15            'name_admin_bar'        => __( 'Lesson Plan', 'wporg_learn' ),
     16            'archives'              => __( 'Lesson Archives', 'wporg_learn' ),
     17            'attributes'            => __( 'Lesson Attributes', 'wporg_learn' ),
     18            'parent_item_colon'     => __( 'Parent Lesson:', 'wporg_learn' ),
     19            'all_items'             => __( 'All Lessons', 'wporg_learn' ),
     20            'add_new_item'          => __( 'Add New Lesson', 'wporg_learn' ),
     21            'add_new'               => __( 'Add New', 'wporg_learn' ),
     22            'new_item'              => __( 'New Lesson Plan', 'wporg_learn' ),
     23            'edit_item'             => __( 'Edit Lesson Plan', 'wporg_learn' ),
     24            'update_item'           => __( 'Update Lesson Plan', 'wporg_learn' ),
     25            'view_item'             => __( 'View Lesson', 'wporg_learn' ),
     26            'view_items'            => __( 'View Lessons', 'wporg_learn' ),
     27            'search_items'          => __( 'Search Lesson', 'wporg_learn' ),
     28            'not_found'             => __( 'Not found', 'wporg_learn' ),
     29            'not_found_in_trash'    => __( 'Not found in Trash', 'wporg_learn' ),
     30            'featured_image'        => __( 'Featured Image', 'wporg_learn' ),
     31            'set_featured_image'    => __( 'Set featured image', 'wporg_learn' ),
     32            'remove_featured_image' => __( 'Remove featured image', 'wporg_learn' ),
     33            'use_featured_image'    => __( 'Use as featured image', 'wporg_learn' ),
     34            'insert_into_item'      => __( 'Insert into lesson', 'wporg_learn' ),
     35            'uploaded_to_this_item' => __( 'Uploaded to this lesson', 'wporg_learn' ),
     36            'items_list'            => __( 'Lessons list', 'wporg_learn' ),
     37            'items_list_navigation' => __( 'Lessons list navigation', 'wporg_learn' ),
     38            'filter_items_list'     => __( 'Filter Lessons list', 'wporg_learn' ),
     39        );
     40        $args  = array(
     41            'label'               => __( 'Lesson Plan', 'wporg_learn' ),
     42            'description'         => __( 'WordPress.org Training Lesson Plan', 'wporg_learn' ),
     43            'labels'              => $labels,
     44            'supports'            => array( 'title', 'editor', 'comments', 'revisions', 'custom-fields' ),
     45            'taxonomies'          => array( 'duration', 'level', 'audience', 'instruction_type' ),
     46            'hierarchical'        => true,
     47            'public'              => true,
     48            'show_ui'             => true,
     49            'show_in_menu'        => true,
     50            'menu_position'       => 5,
     51            'menu_icon'           => 'dashicons-welcome-learn-more',
     52            'show_in_admin_bar'   => true,
     53            'show_in_nav_menus'   => true,
     54            'can_export'          => true,
     55            'has_archive'         => 'lesson-plans',
     56            'exclude_from_search' => false,
     57            'publicly_queryable'  => true,
     58            'capability_type'     => 'page',
     59            'show_in_rest'        => true,
     60        );
     61        register_post_type( 'lesson-plan', $args );
     62    }
     63
     64    /**
     65    * Register duration Taxonomy
     66    */
     67    public static function lesson_duration_taxonomy() {
     68
     69        $labels = array(
     70            'name'                       => _x( 'Duration', 'Taxonomy General Name', 'wporg_learn' ),
     71            'singular_name'              => _x( 'Duration', 'Taxonomy Singular Name', 'wporg_learn' ),
     72            'menu_name'                  => __( 'Duration', 'wporg_learn' ),
     73            'all_items'                  => __( 'All Durations', 'wporg_learn' ),
     74            'parent_item'                => __( 'Parent Duration', 'wporg_learn' ),
     75            'parent_item_colon'          => __( 'Parent Duration:', 'wporg_learn' ),
     76            'new_item_name'              => __( 'New Duration', 'wporg_learn' ),
     77            'add_new_item'               => __( 'Add New Duration', 'wporg_learn' ),
     78            'edit_item'                  => __( 'Edit Duration', 'wporg_learn' ),
     79            'update_item'                => __( 'Update Duration', 'wporg_learn' ),
     80            'view_item'                  => __( 'View Duration', 'wporg_learn' ),
     81            'separate_items_with_commas' => __( 'Separate durations with commas', 'wporg_learn' ),
     82            'add_or_remove_items'        => __( 'Add or remove durations', 'wporg_learn' ),
     83            'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
     84            'popular_items'              => __( 'Popular durations', 'wporg_learn' ),
     85            'search_items'               => __( 'Search durations', 'wporg_learn' ),
     86            'not_found'                  => __( 'Not Found', 'wporg_learn' ),
     87            'no_terms'                   => __( 'No durations', 'wporg_learn' ),
     88            'items_list'                 => __( 'Durations list', 'wporg_learn' ),
     89            'items_list_navigation'      => __( 'Durations list navigation', 'wporg_learn' ),
     90        );
     91        $args  = array(
     92            'labels'            => $labels,
     93            'hierarchical'      => false,
     94            'public'            => true,
     95            'show_ui'           => true,
     96            'show_admin_column' => true,
     97            'show_in_nav_menus' => false,
     98            'show_tagcloud'     => false,
     99            'show_in_rest'      => true,
     100        );
     101        register_taxonomy( 'duration', array( 'lesson-plan' ), $args );
     102
     103    }
     104
     105    /**
     106    * Register Lesson Experience Level Taxonomy
     107    */
     108    public static function lesson_level_taxonomy() {
     109
     110        $labels = array(
     111            'name'                       => _x( 'Experience Levels', 'Taxonomy General Name', 'wporg_learn' ),
     112            'singular_name'              => _x( 'Experience Level', 'Taxonomy Singular Name', 'wporg_learn' ),
     113            'menu_name'                  => __( 'Experience Level', 'wporg_learn' ),
     114            'all_items'                  => __( 'All Experience Levels', 'wporg_learn' ),
     115            'parent_item'                => __( 'Parent Experience Level', 'wporg_learn' ),
     116            'parent_item_colon'          => __( 'Parent Experience Level:', 'wporg_learn' ),
     117            'new_item_name'              => __( 'New Experience Level Name', 'wporg_learn' ),
     118            'add_new_item'               => __( 'Add New Experience Level', 'wporg_learn' ),
     119            'edit_item'                  => __( 'Edit Experience Level', 'wporg_learn' ),
     120            'update_item'                => __( 'Update Experience Level', 'wporg_learn' ),
     121            'view_item'                  => __( 'View Experience Level', 'wporg_learn' ),
     122            'separate_items_with_commas' => __( 'Separate experience levels with commas', 'wporg_learn' ),
     123            'add_or_remove_items'        => __( 'Add or remove experience levels', 'wporg_learn' ),
     124            'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
     125            'popular_items'              => __( 'Popular Experience levels', 'wporg_learn' ),
     126            'search_items'               => __( 'Search Experience Levels', 'wporg_learn' ),
     127            'not_found'                  => __( 'Not Experience Found', 'wporg_learn' ),
     128            'no_terms'                   => __( 'No experience levels', 'wporg_learn' ),
     129            'items_list'                 => __( 'Experience Levels list', 'wporg_learn' ),
     130            'items_list_navigation'      => __( 'Experience Levels list navigation', 'wporg_learn' ),
     131        );
     132        $args  = array(
     133            'labels'            => $labels,
     134            'hierarchical'      => false,
     135            'public'            => true,
     136            'show_ui'           => true,
     137            'show_admin_column' => true,
     138            'show_in_nav_menus' => true,
     139            'show_tagcloud'     => false,
     140            'show_in_rest'      => true,
     141        );
     142        register_taxonomy( 'level', array( 'lesson-plan' ), $args );
     143
     144    }
     145
     146    /**
     147    * Register Lesson Audience Taxonomy
     148    */
     149    public static function lesson_audience_taxonomy() {
     150
     151        $labels = array(
     152            'name'                       => _x( 'Audiences', 'Taxonomy General Name', 'wporg_learn' ),
     153            'singular_name'              => _x( 'Audience', 'Taxonomy Singular Name', 'wporg_learn' ),
     154            'menu_name'                  => __( 'Audience', 'wporg_learn' ),
     155            'all_items'                  => __( 'All Audiences', 'wporg_learn' ),
     156            'parent_item'                => __( 'Parent Audience', 'wporg_learn' ),
     157            'parent_item_colon'          => __( 'Parent Audience:', 'wporg_learn' ),
     158            'new_item_name'              => __( 'New Audience Name', 'wporg_learn' ),
     159            'add_new_item'               => __( 'Add Audience', 'wporg_learn' ),
     160            'edit_item'                  => __( 'Edit Audience', 'wporg_learn' ),
     161            'update_item'                => __( 'Update Audience', 'wporg_learn' ),
     162            'view_item'                  => __( 'View Audience', 'wporg_learn' ),
     163            'separate_items_with_commas' => __( 'Separate Audiences with commas', 'wporg_learn' ),
     164            'add_or_remove_items'        => __( 'Add or remove Audiences', 'wporg_learn' ),
     165            'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
     166            'popular_items'              => __( 'Popular Audiences', 'wporg_learn' ),
     167            'search_items'               => __( 'Search Audiences', 'wporg_learn' ),
     168            'not_found'                  => __( 'Not Found', 'wporg_learn' ),
     169            'no_terms'                   => __( 'No Audiences', 'wporg_learn' ),
     170            'items_list'                 => __( 'Audiences list', 'wporg_learn' ),
     171            'items_list_navigation'      => __( 'Audiences list navigation', 'wporg_learn' ),
     172        );
     173        $args  = array(
     174            'labels'            => $labels,
     175            'hierarchical'      => false,
     176            'public'            => true,
     177            'show_ui'           => true,
     178            'show_admin_column' => true,
     179            'show_in_nav_menus' => true,
     180            'show_tagcloud'     => false,
     181            'show_in_rest'      => true,
     182        );
     183        register_taxonomy( 'audience', array( 'lesson-plan' ), $args );
     184
     185    }
     186
     187    /**
     188    * Register Instruction Type Taxonomy
     189    */
     190    public static function lesson_instruction_type_taxonomy() {
     191
     192        $labels = array(
     193            'name'                       => _x( 'Instruction Types', 'Taxonomy General Name', 'wporg_learn' ),
     194            'singular_name'              => _x( 'Instruction Type', 'Taxonomy Singular Name', 'wporg_learn' ),
     195            'menu_name'                  => __( 'Instruction Type', 'wporg_learn' ),
     196            'all_items'                  => __( 'All Instruction Types', 'wporg_learn' ),
     197            'parent_item'                => __( 'Parent Instruction Type', 'wporg_learn' ),
     198            'parent_item_colon'          => __( 'Parent Instruction Type:', 'wporg_learn' ),
     199            'new_item_name'              => __( 'New Instruction Type Name', 'wporg_learn' ),
     200            'add_new_item'               => __( 'Add Instruction Type', 'wporg_learn' ),
     201            'edit_item'                  => __( 'Edit Instruction Type', 'wporg_learn' ),
     202            'update_item'                => __( 'Update Instruction Type', 'wporg_learn' ),
     203            'view_item'                  => __( 'View Instruction Type', 'wporg_learn' ),
     204            'separate_items_with_commas' => __( 'Separate Instruction Types with commas', 'wporg_learn' ),
     205            'add_or_remove_items'        => __( 'Add or remove Instruction Types', 'wporg_learn' ),
     206            'choose_from_most_used'      => __( 'Choose from the most used', 'wporg_learn' ),
     207            'popular_items'              => __( 'Popular Instruction Types', 'wporg_learn' ),
     208            'search_items'               => __( 'Search Instruction Types', 'wporg_learn' ),
     209            'not_found'                  => __( 'Not Found', 'wporg_learn' ),
     210            'no_terms'                   => __( 'No Instruction Types', 'wporg_learn' ),
     211            'items_list'                 => __( 'Instruction Types list', 'wporg_learn' ),
     212            'items_list_navigation'      => __( 'Instruction Types list navigation', 'wporg_learn' ),
     213        );
     214        $args  = array(
     215            'labels'            => $labels,
     216            'hierarchical'      => false,
     217            'public'            => true,
     218            'show_ui'           => true,
     219            'show_admin_column' => true,
     220            'show_in_nav_menus' => true,
     221            'show_tagcloud'     => false,
     222            'show_in_rest'      => true,
     223        );
     224        register_taxonomy( 'instruction_type', array( 'lesson-plan' ), $args );
     225
     226    }
    227227
    228228    /**
     
    230230     */
    231231    public static function filter_the_title_edit_link( $title, $id = null ) {
    232         // Only apply to the main title for the document
     232        // Only apply to the main title for the document.
    233233        if ( ! is_singular( 'lesson_plan' )
    234234            || ! is_main_query()
    235235            || ! in_the_loop()
    236236            || is_embed()
    237             || $id !== get_queried_object_id() ) {
     237            || get_queried_object_id() !== $id ) {
    238238            return $title;
    239239        }
     
    306306         */
    307307        $edit_action = array(
    308             'action' => 'edit',
    309             'href' => $markdown_source,
    310             'classes' => array( 'edit-post-link' ),
    311             'rel' => $post_id,
    312             'initialState' => 'default'
     308            'action'       => 'edit',
     309            'href'         => $markdown_source,
     310            'classes'      => array( 'edit-post-link' ),
     311            'rel'          => $post_id,
     312            'initialState' => 'default',
    313313        );
    314314
    315315        // Find and replace the existing edit action.
    316316        $replaced = false;
    317         foreach( $actions as &$action ) {
     317        foreach ( $actions as &$action ) {
    318318            if ( 'edit' === $action['action'] ) {
    319                 $action = $edit_action;
     319                $action   = $edit_action;
    320320                $replaced = true;
    321321                break;
     
    341341            return $markdown_source;
    342342        }
    343         $markdown_source = str_replace( '/lesson-plan', '', $markdown_source);
    344         $markdown_source = str_replace( 'wptrainingteam.github.io', 'github.com/wptrainingteam', $markdown_source);
     343        $markdown_source = str_replace( '/lesson-plan', '', $markdown_source );
     344        $markdown_source = str_replace( 'wptrainingteam.github.io', 'github.com/wptrainingteam', $markdown_source );
    345345        $markdown_source = str_replace( '/README.md', '/edit/dev/README.md', $markdown_source );
    346346        return $markdown_source;
    347347    }
    348348
    349   public static function replace_image_links( $content ) {
    350     $post_id = get_the_ID();
    351     $markdown_source = Markdown_Import::get_markdown_source( $post_id );
    352     if ( is_wp_error( $markdown_source ) ) {
    353       return $content;
    354     }
    355     $markdown_source = str_replace( '/README.md', '', $markdown_source );
    356     $content = str_replace( '<img src="/images/', '<img src="' . $markdown_source . '/images/', $content );
    357 
    358     return $content;
    359   }
     349    public static function replace_image_links( $content ) {
     350        $post_id        = get_the_ID();
     351        $markdown_source = Markdown_Import::get_markdown_source( $post_id );
     352        if ( is_wp_error( $markdown_source ) ) {
     353            return $content;
     354        }
     355        $markdown_source = str_replace( '/README.md', '', $markdown_source );
     356        $content        = str_replace( '<img src="/images/', '<img src="' . $markdown_source . '/images/', $content );
     357
     358        return $content;
     359    }
    360360}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-markdown-import.php

    r10147 r10169  
    99
    1010    private static $lesson_plan_manifest = 'https://wptrainingteam.github.io/manifest.json';
    11     private static $input_name = 'wporg-learn-markdown-source';
    12     private static $meta_key = 'wporg_learn_markdown_source';
    13     private static $nonce_name = 'wporg-learn-markdown-source-nonce';
    14     private static $submit_name = 'wporg-learn-markdown-import';
    15     private static $supported_post_type = 'lesson-plan';
    16     private static $posts_per_page = 100;
     11    private static $input_name           = 'wporg-learn-markdown-source';
     12    private static $meta_key             = 'wporg_learn_markdown_source';
     13    private static $nonce_name           = 'wporg-learn-markdown-source-nonce';
     14    private static $submit_name          = 'wporg-learn-markdown-import';
     15    private static $supported_post_type  = 'lesson-plan';
     16    private static $posts_per_page       = 100;
    1717
    1818    /**
     
    2828    }
    2929
     30    /**
     31     * Actions taken on `wporg_learn_manifest_import` event.
     32     */
    3033    public static function action_wporg_learn_manifest_import() {
    3134        $response = wp_remote_get( self::$lesson_plan_manifest );
     
    3740        $manifest = json_decode( wp_remote_retrieve_body( $response ), true );
    3841        if ( ! $manifest ) {
    39             return new WP_Error( 'invalid-manifest', 'Manifest did not unfurl properly.' );;
     42            return new WP_Error( 'invalid-manifest', 'Manifest did not unfurl properly.' );
    4043        }
    4144        // Fetch all lesson plan posts for comparison
    42         $q = new WP_Query( array(
     45        $q        = new WP_Query( array(
    4346            'post_type'      => self::$supported_post_type,
    4447            'post_status'    => 'publish',
     
    4649        ) );
    4750        $existing = $q->posts;
    48         $created = 0;
    49         foreach( $manifest as $doc ) {
     51        $created  = 0;
     52        foreach ( $manifest as $doc ) {
    5053            // Already exists
    5154            if ( wp_filter_object_list( $existing, array( 'post_name' => $doc['slug'] ) ) ) {
     
    6568                    if ( isset( $manifest[ $doc['parent'] ] ) ) {
    6669                        $parent_doc = $manifest[ $doc['parent'] ];
    67                         $parent = self::create_post_from_manifest_doc( $parent_doc );
     70                        $parent     = self::create_post_from_manifest_doc( $parent_doc );
    6871                        if ( $parent ) {
    6972                            $created++;
     
    100103            'post_name'   => sanitize_title_with_dashes( $doc['slug'] ),
    101104        );
    102         $post_id = wp_insert_post( $post_data );
     105        $post_id   = wp_insert_post( $post_data );
    103106        if ( ! $post_id ) {
    104107            return false;
     
    111114    }
    112115
     116    /**
     117     * Actions taken on `wporg_learn_markdown_import` event.
     118     */
    113119    public static function action_wporg_learn_markdown_import() {
    114         $q = new WP_Query( array(
     120        $q       = new WP_Query( array(
    115121            'post_type'      => self::$supported_post_type,
    116122            'post_status'    => 'publish',
     
    118124            'posts_per_page' => self::$posts_per_page,
    119125        ) );
    120         $ids = $q->posts;
     126        $ids     = $q->posts;
    121127        $success = 0;
    122         foreach( $ids as $id ) {
     128        foreach ( $ids as $id ) {
    123129            $ret = self::update_post_from_markdown_source( $id );
    124130            if ( class_exists( 'WP_CLI' ) ) {
     
    155161        $response = self::update_post_from_markdown_source( $post_id );
    156162        if ( is_wp_error( $response ) ) {
     163            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    157164            wp_die( $response->get_error_message() );
    158165        }
     
    164171    /**
    165172     * Add an input field for specifying Markdown source
    166      */
     173     */
    167174    public static function action_edit_form_after_title( $post ) {
    168175        if ( $post->post_type !== self::$supported_post_type ) {
     
    177184            placeholder="Enter a URL representing a markdown file to import"
    178185            size="50" />
    179         </label> <?php
    180             if ( $markdown_source ) :
    181                 $update_link = add_query_arg( array(
    182                     self::$submit_name => 'import',
    183                     self::$nonce_name  => wp_create_nonce( self::$input_name ),
    184                 ), get_edit_post_link( $post->ID, 'raw' ) );
    185                 ?>
     186        </label>
     187        <?php
     188        if ( $markdown_source ) :
     189            $update_link = add_query_arg( array(
     190                self::$submit_name => 'import',
     191                self::$nonce_name  => wp_create_nonce( self::$input_name ),
     192            ), get_edit_post_link( $post->ID, 'raw' ) );
     193            ?>
    186194                <a class="button button-small button-primary" href="<?php echo esc_url( $update_link ); ?>">Import</a>
    187195            <?php endif; ?>
     
    218226        $schedules['15_minutes'] = array(
    219227            'interval' => 15 * MINUTE_IN_SECONDS,
    220             'display'  => '15 minutes'
     228            'display'  => '15 minutes',
    221229        );
    222230        return $schedules;
     
    238246        //$markdown_source = preg_replace( '#https?://github\.com/([^/]+/[^/]+)/blob/(.+)#', 'https://raw.githubusercontent.com/$1/$2', $markdown_source );
    239247        $markdown_source = add_query_arg( 'v', time(), $markdown_source );
    240         $response = wp_remote_get( $markdown_source );
     248        $response        = wp_remote_get( $markdown_source );
    241249        if ( is_wp_error( $response ) ) {
    242250            return $response;
     
    251259        $title = null;
    252260        if ( preg_match( '/^#\s(.+)/', $markdown, $matches ) ) {
    253             $title = $matches[1];
     261            $title    = $matches[1];
    254262            $markdown = preg_replace( '/^#\s(.+)/', '', $markdown );
    255263        }
     
    257265        // Transform to HTML and save the post
    258266        jetpack_require_lib( 'markdown' );
    259         $parser = new \WPCom_GHF_Markdown_Parser;
    260         $html = $parser->transform( $markdown );
    261         $html = self::replace_markdown_checkboxes( $html );
     267        $parser = new \WPCom_GHF_Markdown_Parser();
     268        $html   = $parser->transform( $markdown );
     269        $html   = self::replace_markdown_checkboxes( $html );
    262270
    263271        $post_data = array(
     
    293301    public static function replace_markdown_checkboxes( $html ) {
    294302        $empty_check_markup = '<input type="checkbox" id="" disabled="" class="task-list-item-checkbox">';
    295         $full_check_markup = '<input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked="">';
     303        $full_check_markup  = '<input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked="">';
    296304
    297305        // We need to allow inputs with all of our attributes for wp_filter_post_kses().
    298306        global $allowedposttags;
    299307
    300         $allowedposttags['input'] = [
    301             'type'     => [],
    302             'disabled' => [],
    303             'checked'  => [],
    304             'class'    => [],
    305             'id'       => [],
    306         ];
     308        // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
     309        $allowedposttags['input'] = array(
     310            'type'     => array(),
     311            'disabled' => array(),
     312            'checked'  => array(),
     313            'class'    => array(),
     314            'id'       => array(),
     315        );
    307316
    308317        $html = preg_replace( '/\[ \]/', $empty_check_markup, $html );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-shortcodes.php

    r10130 r10169  
    33namespace WPOrg_Learn;
    44
    5 class Shortcodes{
     5class Shortcodes {
    66
    77    private static $auth_token;
     
    2323        }
    2424        $filter_label = isset( $atts['label'] ) ? $atts['label'] : '';
    25         $out = '<h2>' . sprintf( 'Issues labeled "%s"', esc_html( $filter_label ) ) . '</h2>';
    26         $url = 'https://api.github.com/orgs/wptrainingteam/issues';
    27         $url = add_query_arg( array_map( 'rawurlencode', array(
     25        $out          = '<h2>' . sprintf( 'Issues labeled "%s"', esc_html( $filter_label ) ) . '</h2>';
     26        $url          = 'https://api.github.com/orgs/wptrainingteam/issues';
     27        $url          = add_query_arg( array_map( 'rawurlencode', array(
    2828            'per_page' => 100,
    2929            'labels'   => $filter_label,
    3030            'filter'   => 'all',
    3131        ) ), $url );
    32         $issues = self::github_request( $url );
     32        $issues       = self::github_request( $url );
    3333        if ( is_wp_error( $issues ) ) {
    3434            $out .= '<p>' . esc_html( $issues->get_error_message() ) . '</p>' . PHP_EOL;
     
    6060                $out .= '<li><a href="' . esc_url( $issue->html_url ) . '">' . esc_html( $issue->title ) . '</a><br />' . PHP_EOL;
    6161                if ( ! empty( $issue->labels ) ) {
    62                     foreach( $issue->labels as $label ) {
     62                    foreach ( $issue->labels as $label ) {
    6363                        if ( $label->name === $filter_label ) {
    6464                            continue;
    6565                        }
    66                         $text_color = '#FFF';
     66                        $text_color       = '#FFF';
    6767                        $background_color = $label->color;
    68                         $c_r = hexdec( substr( $background_color, 0, 2 ) );
    69                         $c_g = hexdec( substr( $background_color, 2, 2 ) );
    70                         $c_b = hexdec( substr( $background_color, 4, 2 ) );
     68                        $c_r              = hexdec( substr( $background_color, 0, 2 ) );
     69                        $c_g              = hexdec( substr( $background_color, 2, 2 ) );
     70                        $c_b              = hexdec( substr( $background_color, 4, 2 ) );
    7171                        // Light background means dark color
    7272                        if ( ( ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000 ) > 135 ) {
     
    9393        }
    9494
    95         $out = '<h2>Repositories</h2>';
     95        $out   = '<h2>Repositories</h2>';
    9696        $repos = self::github_request( 'https://api.github.com/orgs/wptrainingteam/repos?per_page=100' );
    9797        if ( is_wp_error( $repos ) ) {
     
    100100        }
    101101        $repo_list = array();
    102         foreach( $repos as $repo ) {
     102        foreach ( $repos as $repo ) {
    103103            if ( ! preg_match( '#^wptrainingteam/.+-command$#', $repo->full_name ) ) {
    104104                continue;
     
    116116        $out .= '</tr>' . PHP_EOL;
    117117        $out .= '</thead>' . PHP_EOL;
    118         foreach( $repo_list as $i => $repo_name ) {
     118        foreach ( $repo_list as $i => $repo_name ) {
    119119            $out .= '<tr>' . PHP_EOL;
    120120            // Name
     
    123123            $out .= '<td><ul>' . PHP_EOL;
    124124            // Overview: Active milestone
    125             $url = sprintf( 'https://api.github.com/repos/%s/milestones', $repo_name );
    126             $milestones = self::github_request( $url );
     125            $url              = sprintf( 'https://api.github.com/repos/%s/milestones', $repo_name );
     126            $milestones       = self::github_request( $url );
    127127            $latest_milestone = '<em>None</em>';
    128128            if ( is_wp_error( $milestones ) ) {
    129129                $latest_milestone = $milestones->get_error_message();
    130130            } elseif ( ! empty( $milestones ) ) {
    131                 $milestones = array_shift( $milestones );
     131                $milestones       = array_shift( $milestones );
    132132                $latest_milestone = '<a href="' . esc_url( $milestones->html_url ) . '">v' . esc_html( $milestones->title ) . '</a> (' . (int) $milestones->open_issues . ' open, ' . (int) $milestones->closed_issues . ' closed)';
    133133            }
    134134            $out .= '<li>Active: ' . wp_kses_post( $latest_milestone ) . '</li>';
    135135            // Overview: Latest release
    136             $url = sprintf( 'https://api.github.com/repos/%s/releases', $repo_name );
    137             $releases = self::github_request( $url );
     136            $url            = sprintf( 'https://api.github.com/repos/%s/releases', $repo_name );
     137            $releases       = self::github_request( $url );
    138138            $latest_release = '<em>None</em>';
    139139            if ( is_wp_error( $releases ) ) {
    140140                $latest_release = $releases->get_error_message();
    141141            } elseif ( ! empty( $releases ) ) {
    142                 $releases = array_shift( $releases );
     142                $releases       = array_shift( $releases );
    143143                $latest_release = '<a href="' . esc_url( $releases->html_url ) . '">' . esc_html( $releases->tag_name ) . '</a>';
    144144            }
     
    149149            if ( 'wp-cli/dist-archive-command' === $repo_name ) {
    150150                $status_image = sprintf( 'https://circleci.com/gh/%s/tree/master.svg?style=svg', $repo_name );
    151                 $status_link = sprintf( 'https://circleci.com/gh/%s/tree/master', $repo_name );
     151                $status_link  = sprintf( 'https://circleci.com/gh/%s/tree/master', $repo_name );
    152152            } else {
    153153                $status_image = sprintf( 'https://travis-ci.org/%s.svg?branch=master', $repo_name );
    154                 $status_link = sprintf( 'https://travis-ci.org/%s/branches', $repo_name );
     154                $status_link  = sprintf( 'https://travis-ci.org/%s/branches', $repo_name );
    155155            }
    156             $out .= '<td><a href="' . esc_url( $status_link ) . '"><img src="' . esc_url( $status_image ) . '">' . '</a></td>' . PHP_EOL;
     156            $out .= '<td><a href="' . esc_url( $status_link ) . '"><img src="' . esc_url( $status_image ) . '"></a></td>' . PHP_EOL;
    157157            $out .= '</tr>' . PHP_EOL;
    158158        }
     
    165165     */
    166166    private static function github_request( $url ) {
    167 
    168         $cache_key = 'cli_github_' . md5( $url );
    169         if ( false !== ( $cache_value = get_transient( $cache_key ) ) ) {
     167        $cache_key   = 'cli_github_' . md5( $url );
     168        $cache_value = get_transient( $cache_key );
     169        if ( false !== $cache_value ) {
    170170            return $cache_value;
    171171        }
     
    175175                'Accept'     => 'application/vnd.github.v3+json',
    176176                'User-Agent' => 'WordPress.org / WP-CLI',
    177             )
     177            ),
    178178        );
    179179        if ( isset( self::$auth_token ) ) {
     
    193193        return $data;
    194194    }
    195 
    196195}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-workshop.php

    r10130 r10169  
    66    /**
    77     *  Register Workshop Post Type
    8     */
     8     */
    99    public static function workshop_post_type() {
    1010        $labels = array(
     
    3737            'filter_items_list'     => __( 'Filter Workshops list', 'wporg_learn' ),
    3838        );
    39         $args = array(
    40             'label'                 => __( 'Workshop', 'wporg_learn' ),
    41             'description'           => __( 'WordPress.org Training Workshop', 'wporg_learn' ),
    42             'labels'                => $labels,
    43             'supports'              => array( 'title', 'editor', 'comments', 'revisions', 'custom-fields' ),
    44             'taxonomies'            => array( 'lesson_group', 'topic', 'category' ),
    45             'hierarchical'          => true,
    46             'public'                => true,
    47             'show_ui'               => true,
    48             'show_in_menu'          => true,
    49             'has_archive'           => 'workshops',
    50             'menu_position'         => 6,
    51             'menu_icon'             => 'dashicons-category',
    52             'show_in_admin_bar'     => true,
    53             'show_in_nav_menus'     => true,
    54             'can_export'            => true,
    55             'exclude_from_search'   => false,
    56             'publicly_queryable'    => true,
    57             'capability_type'       => 'page',
    58             'show_in_rest'          => true
     39        $args   = array(
     40            'label'               => __( 'Workshop', 'wporg_learn' ),
     41            'description'         => __( 'WordPress.org Training Workshop', 'wporg_learn' ),
     42            'labels'              => $labels,
     43            'supports'            => array( 'title', 'editor', 'comments', 'revisions', 'custom-fields' ),
     44            'taxonomies'          => array( 'lesson_group', 'topic', 'category' ),
     45            'hierarchical'        => true,
     46            'public'              => true,
     47            'show_ui'             => true,
     48            'show_in_menu'        => true,
     49            'has_archive'         => 'workshops',
     50            'menu_position'       => 6,
     51            'menu_icon'           => 'dashicons-category',
     52            'show_in_admin_bar'   => true,
     53            'show_in_nav_menus'   => true,
     54            'can_export'          => true,
     55            'exclude_from_search' => false,
     56            'publicly_queryable'  => true,
     57            'capability_type'     => 'page',
     58            'show_in_rest'        => true,
    5959
    6060        );
     
    6464    /**
    6565     * Register Workshop Grouping Taxonomy
    66     */
     66     */
    6767    public static function lesson_workshop_taxonomy() {
    6868        $labels = array(
     
    9090
    9191        $args = array(
    92             'labels'                     => $labels,
    93             'hierarchical'               => true,
    94             'public'                     => true,
    95             'show_ui'                    => true,
    96             'show_admin_column'          => true,
    97             'show_in_nav_menus'          => true,
    98             'show_tagcloud'              => false,
    99             'show_in_rest'               => true,
     92            'labels'            => $labels,
     93            'hierarchical'      => true,
     94            'public'            => true,
     95            'show_ui'           => true,
     96            'show_admin_column' => true,
     97            'show_in_nav_menus' => true,
     98            'show_tagcloud'     => false,
     99            'show_in_rest'      => true,
    100100        );
    101101
     
    105105    /**
    106106     * Register Workshop Topics Taxonomy
    107     */
     107     */
    108108    public static function workshop_topics_taxonomy() {
    109109        $labels = array(
     
    131131
    132132        $args = array(
    133             'labels'                     => $labels,
    134             'hierarchical'               => false,
    135             'public'                     => true,
    136             'show_ui'                    => true,
    137             'show_admin_column'          => true,
    138             'show_in_nav_menus'          => true,
    139             'show_tagcloud'              => false,
    140             'show_in_rest'               => true,
     133            'labels'            => $labels,
     134            'hierarchical'      => false,
     135            'public'            => true,
     136            'show_ui'           => true,
     137            'show_admin_column' => true,
     138            'show_in_nav_menus' => true,
     139            'show_tagcloud'     => false,
     140            'show_in_rest'      => true,
    141141        );
    142142
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php

    r10147 r10169  
    8181function get_workshop_duration( WP_Post $workshop, $format = 'raw' ) {
    8282    $raw_duration = $workshop->duration ? absint( $workshop->duration ) : 0;
    83     $interval = date_diff( new DateTime( '@0' ), new DateTime( "@$raw_duration" ) ); // The '@' ignores timezone.
    84     $return = null;
     83    $interval     = date_diff( new DateTime( '@0' ), new DateTime( "@$raw_duration" ) ); // The '@' ignores timezone.
     84    $return       = null;
    8585
    8686    switch ( $format ) {
     
    9292                $return = human_time_diff( 0, $interval->d * DAY_IN_SECONDS );
    9393            } elseif ( $interval->h > 0 ) {
    94                 $return = $hours = human_time_diff( 0, $interval->h * HOUR_IN_SECONDS );
     94                $hours = human_time_diff( 0, $interval->h * HOUR_IN_SECONDS );
     95                $return = $hours;
    9596
    9697                if ( $interval->i > 0 ) {
    9798                    $minutes = human_time_diff( 0, $interval->i * MINUTE_IN_SECONDS );
    98                     $return = sprintf(
     99                    $return  = sprintf(
    99100                        // translators: 1 is a string like "2 hours". 2 is a string like "20 mins".
    100                         _x( '%1$s, %2$s', 'hours and minutes','wporg-learn' ),
     101                        _x( '%1$s, %2$s', 'hours and minutes', 'wporg-learn' ),
    101102                        $hours,
    102103                        $minutes
     
    148149function render_metabox_workshop_details( WP_Post $post ) {
    149150    $duration_interval = get_workshop_duration( $post, 'interval' );
    150     $captions = get_post_meta( $post->ID, 'video_caption_language' ) ?: array();
     151    $captions          = get_post_meta( $post->ID, 'video_caption_language' ) ?: array();
    151152
    152153    require dirname( dirname( __FILE__ ) ) . '/views/metabox-workshop-details.php';
     
    167168 * Update the post meta values from the meta box fields when the post is saved.
    168169 *
    169  * @param int $post_id
     170 * @param int     $post_id
    170171 * @param WP_Post $post
    171172 */
     
    182183
    183184    $presenter_wporg_username = filter_input( INPUT_POST, 'presenter-wporg-username' );
    184     $usernames = array_map( 'trim', explode( ',', $presenter_wporg_username ) );
     185    $usernames                = array_map( 'trim', explode( ',', $presenter_wporg_username ) );
    185186    delete_post_meta( $post_id, 'presenter_wporg_username' );
    186     foreach( $usernames as $username ) {
     187    foreach ( $usernames as $username ) {
    187188        add_post_meta( $post_id, 'presenter_wporg_username', $username );
    188189    }
     
    192193
    193194    $video_caption_language = filter_input( INPUT_POST, 'video-caption-language' );
    194     $captions = array_map( 'trim', explode( ',', $video_caption_language ) );
     195    $captions               = array_map( 'trim', explode( ',', $video_caption_language ) );
    195196    delete_post_meta( $post_id, 'video_caption_language' );
    196     foreach( $captions as $caption ) {
     197    foreach ( $captions as $caption ) {
    197198        add_post_meta( $post_id, 'video_caption_language', $caption );
    198199    }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php

    r10147 r10169  
    4646    );
    4747
    48     $video_template_part =  array( 'core/group',
     48    $video_template_part = array( 'core/group',
    4949        array( 'className' => 'workshop-page_video' ),
    50         array( array( 'core-embed/wordpress-tv' ) )
     50        array( array( 'core-embed/wordpress-tv' ) ),
    5151    );
    5252
     
    5555        array(
    5656            array( 'core/heading', array(
    57                 'level' => '2',
     57                'level'   => '2',
    5858                'content' => __( 'Learning outcomes', 'wporg-learn' ),
    59             ) ),
     59            ),
     60        ),
    6061            array( 'core/list', array(
    61                 'ordered' => true
    62              ) ),
    63         )
     62                'ordered' => true,
     63             ),
     64        ),
     65        ),
    6466    );
    6567
     
    6870        array(
    6971            array( 'core/heading', array(
    70                 'level' => '2',
     72                'level'   => '2',
    7173                'content' => __( 'Comprehension questions', 'wporg-learn' ),
    72             ) ),
     74            ),
     75        ),
    7376            array( 'core/list', array(
    74                 'ordered' => true
    75             ) ),
    76         )
     77                'ordered' => true,
     78            ),
     79        ),
     80        ),
    7781    );
    7882
     
    8690                'borderRadius' => 5,
    8791                'className'    => 'is-style-secondary-full-width',
    88             ) ),
     92            ),
     93        ),
    8994            array( 'core/paragraph', array(
    9095                'className' => 'terms',
    91                 'content' => sprintf(
     96                'content'   => sprintf(
    9297                    __( 'You must agree to our <a href="%s">Code of Conduct</a> in order to participate.', 'wporg-learn' ),
    9398                    'https://learn.wordpress.org/code-of-conduct/'
    94                 )
    95             ) )
    96         )
     99                ),
     100            ),
     101        ),
     102        ),
    97103    );
    98104
    99105    $args = array(
    100         'label'                 => __( 'Workshop', 'wporg_learn' ),
    101         'description'           => __( 'WordPress.org Training Workshop', 'wporg_learn' ),
    102         'labels'                => $labels,
    103         'supports'              => array( 'title', 'editor', 'comments', 'revisions', 'custom-fields', 'thumbnail', 'excerpt' ),
    104         'taxonomies'            => array( 'level', 'topic' ),
    105         'hierarchical'          => true,
    106         'public'                => true,
    107         'show_ui'               => true,
    108         'show_in_menu'          => true,
    109         'has_archive'           => 'workshops',
    110         'menu_position'         => 6,
    111         'menu_icon'             => 'dashicons-category',
    112         'show_in_admin_bar'     => true,
    113         'show_in_nav_menus'     => true,
    114         'can_export'            => true,
    115         'exclude_from_search'   => false,
    116         'publicly_queryable'    => true,
    117         'capability_type'       => 'page',
    118         'show_in_rest'          => true,
    119         'template_lock'         => 'all',
    120         'rewrite'               => array( 'slug' => 'workshop' ),
    121         'template' => array(
     106        'label'               => __( 'Workshop', 'wporg_learn' ),
     107        'description'         => __( 'WordPress.org Training Workshop', 'wporg_learn' ),
     108        'labels'              => $labels,
     109        'supports'            => array( 'title', 'editor', 'comments', 'revisions', 'custom-fields', 'thumbnail', 'excerpt' ),
     110        'taxonomies'          => array( 'level', 'topic' ),
     111        'hierarchical'        => true,
     112        'public'              => true,
     113        'show_ui'             => true,
     114        'show_in_menu'        => true,
     115        'has_archive'         => 'workshops',
     116        'menu_position'       => 6,
     117        'menu_icon'           => 'dashicons-category',
     118        'show_in_admin_bar'   => true,
     119        'show_in_nav_menus'   => true,
     120        'can_export'          => true,
     121        'exclude_from_search' => false,
     122        'publicly_queryable'  => true,
     123        'capability_type'     => 'page',
     124        'show_in_rest'        => true,
     125        'template_lock'       => 'all',
     126        'rewrite'             => array( 'slug' => 'workshop' ),
     127        'template'            => array(
    122128            array( 'core/group',
    123129            array( 'className' => 'workshop-page_content' ),
    124130                array(
    125131                    $video_template_part,
    126                     array( 'core/columns', array( ), array(
     132                    array( 'core/columns', array(), array(
    127133                        array( 'core/column', array( 'width' => 66.66 ), array(
    128134                            array( 'core/paragraph', array(
    129135                                'placeholder' => __( 'Describe what the workshop is about', 'wporg-learn' ),
    130                             ) ),
     136                            ),
     137                        ),
    131138                            $outcome_template_part,
    132139                            $comprehension_template_part,
    133                         ) ),
     140                        ),
     141                    ),
    134142                        array( 'core/column', array( 'width' => 33.333 ), array(
    135143                            $sidebar_template_part,
    136                         ) )
    137                     ) ),
    138                 ) ),
    139             array( 'core/separator', array( ) ),
     144                        ),
     145                    ),
     146                    ),
     147                ),
     148                ),
     149            ),
     150            array( 'core/separator', array() ),
    140151        ),
    141152    );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php

    r10142 r10169  
    4242        'public'            => true,
    4343        'rewrite'           => array(
    44             'slug' => 'lesson-plans'
     44            'slug' => 'lesson-plans',
    4545        ),
    4646        'show_ui'           => true,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/block-styles/index.js

    r10130 r10169  
    1 
    21import { registerBlockStyle } from '@wordpress/blocks';
    32import { __ } from '@wordpress/i18n';
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/block-styles/style.scss

    r10130 r10169  
    99        text-align: center;
    1010        font-size: 13px;
    11         font-weight: bold;
     11        font-weight: 600;
    1212        padding: 0.9rem;
    1313        margin: 32px 0;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/edit.js

    r10130 r10169  
    2929        <div className={ className }>
    3030            <p>{ __( 'Workshop Details', 'wporg-learn' ) }</p>
    31             <p>{ __( 'This will be dynamically populated based on custom fields.', 'wporg-learn' ) }</p>
     31            <p>
     32                { __(
     33                    'This will be dynamically populated based on custom fields.',
     34                    'wporg-learn'
     35                ) }
     36            </p>
    3237        </div>
    3338    );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/editor.scss

    r10130 r10169  
    55 */
    66
    7  .wp-block-wporg-learn-workshop-details {
     7.wp-block-wporg-learn-workshop-details {
    88    min-height: 150px;
    99    padding: 16px;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/index.js

    r10132 r10169  
    5252     * The categories provided by core are `common`, `embed`, `formatting`, `layout` and `widgets`.
    5353     */
    54     category: 'widgets',
     54    category: 'widgets',
    5555
    5656    /**
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/style.scss

    r10130 r10169  
    66 */
    77
    8  .wp-block-wporg-learn-workshop-details {
     8.wp-block-wporg-learn-workshop-details {
    99    list-style: none;
    1010    margin: 0;
     
    1616        justify-content: space-between;
    1717        padding: 8px 0;
    18         border-top: 1px solid #E2E4E7;
     18        border-top: 1px solid #e2e4e7;
    1919
    2020        &:last-child {
    21             border-bottom: 1px solid #E2E4E7;
     21            border-bottom: 1px solid #e2e4e7;
    2222        }
    2323
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/package.json

    r10146 r10169  
    11{
    2     "name": "wporg-learn",
     2    "name": "wporg-learn-plugin",
    33    "version": "1.0.0",
    4     "description": "",
     4    "description": "Plugin for learn.wordpress.org",
    55    "author": "WordPress.org",
    66    "license": "GPL-2.0-or-later",
     
    1515    },
    1616    "devDependencies": {
    17         "@wordpress/scripts": "^12.1.1"
     17        "@wordpress/scripts": "12.1.1"
     18    },
     19    "stylelint": {
     20        "extends": "../../../.stylelintrc"
    1821    }
    1922}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-details.php

    r10142 r10169  
    11<?php
     2/**
     3 * Template for Workshop Details metabox
     4 */
     5
    26/** @var WP_Post $post */
    37/** @var DateInterval $duration_interval */
     
    610
    711<p>
    8     <label><?php _e( 'Duration', 'wporg_learn' ); ?></label><br />
     12    <label><?php esc_html_e( 'Duration', 'wporg_learn' ); ?></label><br />
    913    <label for="workshop-duration-hours">
    1014        <input
     
    1620            max="23"
    1721        />
    18         <?php _e( 'hours', 'wporg_learn' ); ?>
     22        <?php esc_html_e( 'hours', 'wporg_learn' ); ?>
    1923    </label>
    2024    <label for="workshop-duration-minutes">
     
    2731            max="59"
    2832        />
    29         <?php _e( 'minutes', 'wporg_learn' ); ?>
     33        <?php esc_html_e( 'minutes', 'wporg_learn' ); ?>
    3034    </label>
    3135    <label for="workshop-duration-seconds">
     
    3842                max="59"
    3943        />
    40         <?php _e( 'seconds', 'wporg_learn' ); ?>
     44        <?php esc_html_e( 'seconds', 'wporg_learn' ); ?>
    4145    </label>
    4246</p>
     
    4448<?php // todo Change this to a select dropdown with locale values. ?>
    4549<p>
    46     <label for="workshop-video-language"><?php _e( 'Language', 'wporg_learn' ); ?></label>
     50    <label for="workshop-video-language"><?php esc_html_e( 'Language', 'wporg_learn' ); ?></label>
    4751    <input
    4852        id="workshop-video-language"
    4953        name="video-language"
    5054        type="text"
    51         value="<?php echo sanitize_text_field( $post->video_language ); ?>"
     55        value="<?php echo esc_attr( $post->video_language ); ?>"
    5256    />
    5357</p>
     
    5559<?php // todo Change this to a multiselect dropdown with locale values. ?>
    5660<p>
    57     <label for="workshop-video-caption-language"><?php _e( 'Captions', 'wporg_learn' ); ?></label>
    58     <textarea id="workshop-video-caption-language" name="video-caption-language"><?php echo sanitize_textarea_field( implode( ', ', $captions ) ); ?></textarea>
     61    <label for="workshop-video-caption-language"><?php esc_html_e( 'Captions', 'wporg_learn' ); ?></label>
     62    <textarea id="workshop-video-caption-language" name="video-caption-language"><?php echo esc_attr( implode( ', ', $captions ) ); ?></textarea>
    5963    <span class="help">
    60         <?php _e( 'Separate multiple languages with a comma.', 'wporg_learn' ); ?>
     64        <?php esc_html_e( 'Separate multiple languages with a comma.', 'wporg_learn' ); ?>
    6165    </span>
    6266</p>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-presenters.php

    r10146 r10169  
    11<?php
     2/**
     3 * Template for Presenters metabox
     4 */
     5
    26/** @var WP_Post $post */
    37/** @var array $presenters */
     
    610<?php // todo Change this to a multiselect dropdown that validates wporg usernames. ?>
    711<p>
    8     <label for="workshop-presenter-wporg-username"><?php _e( 'WordPress.org User Names', 'wporg_learn' ); ?></label>
    9     <textarea id="workshop-presenter-wporg-username" name="presenter-wporg-username"><?php
    10         echo sanitize_textarea_field( implode( ', ', $presenters ) );
    11     ?></textarea>
     12    <label for="workshop-presenter-wporg-username"><?php esc_html_e( 'WordPress.org User Names', 'wporg_learn' ); ?></label>
     13    <textarea id="workshop-presenter-wporg-username" name="presenter-wporg-username">
     14    <?php
     15        echo esc_html( implode( ', ', $presenters ) );
     16    ?>
     17    </textarea>
    1218    <span class="help">
    13         <?php _e( 'Separate multiple presenter user names with a comma.', 'wporg_learn' ); ?>
     19        <?php esc_html_e( 'Separate multiple presenter user names with a comma.', 'wporg_learn' ); ?>
    1420    </span>
    1521</p>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/wporg-learn.php

    r10155 r10169  
    3030add_action( 'init', array( 'WPORG_Learn\Lesson_Plan', 'lesson_instruction_type_taxonomy' ) );
    3131add_action( 'init', 'WPORG_Learn\Taxonomy\register' );
    32 add_filter( 'the_content', array('WPORG_Learn\Lesson_Plan', 'replace_image_links' ) );
     32add_filter( 'the_content', array( 'WPORG_Learn\Lesson_Plan', 'replace_image_links' ) );
    3333
    3434add_action( 'init', 'WPORG_Learn\Blocks\workshop_details_init' );
     
    7373    }
    7474
    75     if( $post->post_type == 'workshop' ) {
     75    if ( 'workshop' === $post->post_type ) {
    7676        return 35;
    7777    }
     
    8080}
    8181
    82 add_action( 'wp_head', function(){
     82add_action( 'wp_head', function() {
    8383    ?>
    8484    <style>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/archive-lesson-plan.php

    r10166 r10169  
    1818        <?php if ( have_posts() ) : ?>
    1919            <div id="lesson-plans" class="lp-list">
    20                 <?php while ( have_posts() ) : the_post(); ?>
     20                <?php while ( have_posts() ) :
     21                    the_post(); ?>
    2122                    <?php get_template_part( 'template-parts/content', 'archive' ); ?>
    2223                <?php endwhile; ?>
     
    2627        <?php else : ?>
    2728            <div class="lp-empty">
    28                 <?php echo _e( 'We were unable to find any matches.' , 'wporg-learn' ); ?>
     29                <?php echo esc_html_e( 'We were unable to find any matches.', 'wporg-learn' ); ?>
    2930            </div>
    3031        <?php endif; ?>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/base/_select.scss

    r10131 r10169  
    44    display: inline-block;
    55    box-sizing: border-box;
    6     padding: 0.5rem 2rem 0.5rem .8rem;
     6    padding: 0.5rem 2rem 0.5rem 0.8rem;
    77    width: auto;
    88
     
    1818
    1919    background-color: transparent;
     20    /* stylelint-disable-next-line function-url-quotes */
    2021    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg width="14" height="8" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M2 0L7 5L12 0L14 1L7 8L0 1L2 0Z" fill="%23555D66"/%3E%3C/svg%3E%0A');
    2122    background-repeat: no-repeat;
    22     background-position: right .7em top 50%;
    23     background-size: .65em auto;
     23    background-position: right 0.7em top 50%;
     24    background-size: 0.65em auto;
    2425
    2526    &::-ms-expand {
     
    2829
    2930    &:focus {
    30         box-shadow: 0 0 1px 3px rgba(59, 153, 252, .7);
     31        box-shadow: 0 0 1px 3px rgba(59, 153, 252, 0.7);
    3132        box-shadow: 0 0 0 3px -moz-mac-focusring;
    3233        color: #222;
     
    3435    }
    3536
    36     & option {
    37         font-weight: normal;
     37    option {
     38        font-weight: 400;
    3839    }
    3940}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_featured-workshop.scss

    r10162 r10169  
    2222        display: block;
    2323        margin-bottom: $gutter-default / 2;
    24         font-weight: bold;
     24        font-weight: 600;
    2525        text-decoration: underline;
    2626        font-size: $gutter-default * 1.25;
     
    3636                padding-top: 0;
    3737                padding-left: $gutter-default * 2;
    38        
     38
    3939            }
    4040        }
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_section-heading.scss

    r10162 r10169  
    11.section-heading {
    2     &_title, &_link  {
     2    &_title,
     3    &_link {
    34        margin-bottom: 0;
    45    }
     
    1011    &_link {
    1112        text-decoration: underline;
    12         font-weight: bold;
     13        font-weight: 600;
    1314        margin-top: $gutter-default !important; // Override button styles
    1415
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_video-grid.scss

    r10164 r10169  
    2020            display: block;
    2121            margin-top: 8px;
    22             font-weight: bold;
     22            font-weight: 600;
    2323            text-align: center;
    24    
     24
    2525            @media only screen and (min-width: $breakpoint-small) {
    2626                padding: 0 $gutter-default * 2 $gutter-default;
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_workshop-page.scss

    r10164 r10169  
    5151    }
    5252
    53     ol, ul {
     53    ol,
     54    ul {
    5455        margin: 0 0 0 18px;
    5556        padding: 0;
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_workshop-presenter.scss

    r10162 r10169  
    55    /* We want to make sure a long name doesn't overlap the image */
    66    > div:first-child {
    7         min-width:  $gutter-default * 3.5;
     7        min-width: $gutter-default * 3.5;
    88    }
    99
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/settings/_colors.scss

    r10131 r10169  
    11// Base colors.
    22$color__wp-blue: #0073aa;
    3 $color__green: #C7E8CA;
    4 $color__wporg-blue: #1E8CBE;
    5 $color__wporg-purple: #826EB4;
     3$color__green: #c7e8ca;
     4$color__wporg-blue: #1e8cbe;
     5$color__wporg-purple: #826eb4;
    66
    77// Base grays.
     
    1313$color-gray-800: $color-dark-gray;
    1414$color-gray-700: $color-base-gray;
    15 $color-gray-600: lighten($color-base-gray,6%);
    16 $color-gray-500: lighten($color-base-gray,15%);
    17 $color-gray-400: lighten($color-base-gray,20%);
    18 $color-gray-300: lighten($color-base-gray,25%);
    19 $color-gray-200: lighten($color-base-gray,32%);
    20 $color-gray-100: lighten($color-base-gray,38%);
     15$color-gray-600: lighten($color-base-gray, 6%);
     16$color-gray-500: lighten($color-base-gray, 15%);
     17$color-gray-400: lighten($color-base-gray, 20%);
     18$color-gray-300: lighten($color-base-gray, 25%);
     19$color-gray-200: lighten($color-base-gray, 32%);
     20$color-gray-100: lighten($color-base-gray, 38%);
    2121
    22 $color-gray-light-900: lighten($color-base-gray,45%);
    23 $color-gray-light-800: lighten($color-base-gray,52%);
    24 $color-gray-light-700: lighten($color-base-gray,60%);
    25 $color-gray-light-600: lighten($color-base-gray,64%);
    26 $color-gray-light-500: lighten($color-base-gray,68%);
    27 $color-gray-light-400: lighten($color-base-gray,70%);
    28 $color-gray-light-300: lighten($color-base-gray,72%);
    29 $color-gray-light-200: lighten($color-base-gray,74%);
    30 $color-gray-light-100: lighten($color-base-gray,77%);
     22$color-gray-light-900: lighten($color-base-gray, 45%);
     23$color-gray-light-800: lighten($color-base-gray, 52%);
     24$color-gray-light-700: lighten($color-base-gray, 60%);
     25$color-gray-light-600: lighten($color-base-gray, 64%);
     26$color-gray-light-500: lighten($color-base-gray, 68%);
     27$color-gray-light-400: lighten($color-base-gray, 70%);
     28$color-gray-light-300: lighten($color-base-gray, 72%);
     29$color-gray-light-200: lighten($color-base-gray, 74%);
     30$color-gray-light-100: lighten($color-base-gray, 77%);
    3131
    3232$color-error-red: #c92c2c;
     
    3535// Theme colors
    3636$color__background-input: $color-gray-light-200;
    37 $color__text: #555D66;;
     37$color__text: #555d66;
    3838$color__text-darker: $color-gray-700;
    3939$color__text-lighter: $color-gray-300;
    40 $color__text-on-dark: #FFFFFF;
     40$color__text-on-dark: #fff;
    4141$color__text-heading: $color-gray-400;
    4242$color__text-heading-darker: $color-gray-800;
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/settings/_icons.scss

    r10131 r10169  
     1/* stylelint-disable-next-line max-line-length */
    12$icon__quote: "%3Csvg width='24' height='16' viewBox='0 0 24 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.333 16V6.347L16.507 0h6.986l-2.666 5.333H24V16H13.333zM16 13.333h5.333V8h-4.826l2.666-5.333H18.16L16 6.987v6.346zM0 16V6.347L3.173 0h6.987L7.493 5.333h3.174V16H0zm2.667-2.667H8V8H3.173L5.84 2.667H4.827l-2.16 4.32v6.346z' fill='%239EA3A8' fill-rule='nonzero'/%3E%3C/svg%3E";
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/settings/_typography.scss

    r10131 r10169  
    33$type__lineheight: 1.5;
    44
    5 $font__serif: Georgia, "Times New Roman", serif;
     5$font__serif: georgia, "Times New Roman", serif;
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/style-editor.scss

    r10131 r10169  
    2020    .is-style-wporg-parallelogram {
    2121        .wp-block-column {
     22
    2223            @include breakpoint( $breakpoint-tablet ) {
    2324                transform: skew(0);
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/utilities/_parallelogram.scss

    r10164 r10169  
    2727
    2828.home-page .shapes .parallelogram.lesson-plans {
    29     background-color: #00669B;
     29    background-color: #00669b;
    3030    right: 16px;
    3131    top: 50px;
     
    105105        transform: skew(15deg);
    106106    }
    107    
    108107}
    109108
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/front-page.php

    r10166 r10169  
    1414                <a class="parallelogram workshop-ideas dashicons-before dashicons-slides" href="/workshops/">
    1515                    <p>
    16                         <strong><?php _e( 'Workshops', 'wporg-forums' ); ?></strong>
     16                        <strong><?php esc_html_e( 'Workshops', 'wporg-learn' ); ?></strong>
    1717                        <?php
    18                         _e( 'Workshops are a great way to get hands-on with WordPress. Here are some workshops for you to level up your WordPress skills.', 'wporg-learn' );
     18                        esc_html_e( 'Workshops are a great way to get hands-on with WordPress. Here are some workshops for you to level up your WordPress skills.', 'wporg-learn' );
    1919                        ?>
    20                         <u><?php _e( 'Browse Workshops' ); ?></u>
     20                        <u><?php esc_html_e( 'Browse Workshops', 'wporg-learn' ); ?></u>
    2121                    </p>
    2222                </a>
    2323                <a class="parallelogram lesson-plans dashicons-before dashicons-clipboard" href="/lesson-plans/">
    2424                    <p>
    25                         <strong><?php _e( 'Lesson Plans', 'wporg-forums' ); ?></strong>
     25                        <strong><?php esc_html_e( 'Lesson Plans', 'wporg-learn' ); ?></strong>
    2626                        <?php
    27                             _e( 'Are you teaching WordPress to others? These lesson plans are designed to guide and inspire you to deliver great content.', 'wporg-learn' );
     27                        esc_html_e( 'Are you teaching WordPress to others? These lesson plans are designed to guide and inspire you to deliver great content.', 'wporg-learn' );
    2828                        ?>
    29                         <u><?php _e( 'See the Lesson Plans' ); ?></u>
     29                        <u><?php esc_html_e( 'See the Lesson Plans', 'wporg-learn' ); ?></u>
    3030                    </p>
    3131                </a>
     
    3737                <div class="graphic"><span class="dashicons dashicons-welcome-learn-more"></span></div>
    3838                <div>
    39                     <h2 class="h3"><?php _e( 'Get Involved' ); ?></h2>
    40                     <p><?php _e( 'Want to grow WordPress? As part of Training Team you could help others learn WordPress accross the world.' ); ?></p>
    41                     <a href="https://make.wordpress.org/training/handbook/"><?php _e( 'Learn About The Training Team' ); ?></a>
     39                    <h2 class="h3"><?php esc_html_e( 'Get Involved', 'wporg-learn' ); ?></h2>
     40                    <p><?php esc_html_e( 'Want to grow WordPress? As part of Training Team you could help others learn WordPress accross the world.', 'wporg-learn' ); ?></p>
     41                    <a href="https://make.wordpress.org/training/handbook/"><?php esc_html_e( 'Learn About The Training Team', 'wporg-learn' ); ?></a>
    4242                </div>
    4343            </div>
     
    5252
    5353            <?php
    54                 $args = array(
    55                     'posts_per_page' => '3',
    56                 );
    57                 set_query_var( 'video-grid-options', $args );
    58                 get_template_part( 'template-parts/component', 'video-grid' );
     54            $args = array(
     55                'posts_per_page' => '3',
     56            );
     57            set_query_var( 'video-grid-options', $args );
     58            get_template_part( 'template-parts/component', 'video-grid' );
    5959            ?>
    6060        </section>
    6161        <hr>
    62        
     62
    6363        <?php get_template_part( 'template-parts/component', 'submit-idea-cta', array( 'icon' => 'lightbulb' ) ); ?>
    6464
     
    7373
    7474            <div id="helphub-forum-link" class="text-center">
    75                 <h3><?php esc_html_e( 'Support Forums', 'wporg-forums' ); ?></h3>
     75                <h3><?php esc_html_e( 'Support Forums', 'wporg-learn' ); ?></h3>
    7676
    7777                <p>
    7878                    <span>
    79                         <?php esc_html_e( 'Can\'t find what you\'re looking for? Find out if others share your experience.', 'wporg-forums' ); ?>
     79                        <?php esc_html_e( 'Can\'t find what you\'re looking for? Find out if others share your experience.', 'wporg-learn' ); ?>
    8080                    </span>
    8181
    8282                    <br>
    8383
    84                     <a href="<?php echo esc_url( site_url( '/forums/' ) ); ?>"><?php esc_html_e( 'Check out our support forums', 'wporg-forums' ); ?></a>
     84                    <a href="<?php echo esc_url( site_url( '/forums/' ) ); ?>"><?php esc_html_e( 'Check out our support forums', 'wporg-learn' ); ?></a>
    8585                </p>
    8686            </div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php

    r10166 r10169  
    2929 */
    3030function wporg_learn_scripts() {
    31     wp_enqueue_style( 'wporg-style', get_theme_file_uri( '/css/style.css' ), [ 'dashicons', 'open-sans' ], filemtime( __DIR__ . '/css/style.css' ) );
     31    wp_enqueue_style( 'wporg-style', get_theme_file_uri( '/css/style.css' ), array( 'dashicons', 'open-sans' ), filemtime( __DIR__ . '/css/style.css' ) );
    3232    wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), filemtime( __DIR__ . '/js/navigation.js' ), true );
    33 
    3433}
    3534add_action( 'wp_enqueue_scripts', 'wporg_learn_scripts' );
     
    5150 */
    5251function wporg_get_tax_slugs_from_workshop() {
    53     return wp_get_post_terms( get_the_ID(), 'lesson_group',  array( 'fields' => 'slugs' ) );
     52    return wp_get_post_terms( get_the_ID(), 'lesson_group', array( 'fields' => 'slugs' ) );
    5453}
    5554
     
    5756 * Get the lesson plans associated to a taxonomy
    5857 *
    59  * @param string $slugs Comma separated list of taxonomy terms
     58 * @param string $slugs Comma separated list of taxonomy terms.
    6059 * @package WPBBP
    6160 */
     
    113112    $cat = wporg_get_filter_category();
    114113
    115     if( empty( $cat ) ) {
     114    if ( empty( $cat ) ) {
    116115        return wporg_get_default_cat()->slug;
    117116    }
     
    124123 * Get the values associated to the page/post
    125124 *
    126  * @param string $id Id of the post
    127  * @param string $tax_slug The slug for the custom taxonomy
     125 * @param string $id Id of the post.
     126 * @param string $tax_slug The slug for the custom taxonomy.
    128127 * @return string
    129128 */
    130 function get_taxonomy_values( $id, $tax_slug ){
    131     $terms = wp_get_post_terms( $id, $tax_slug, array( 'fields' => 'names' )  );
     129function get_taxonomy_values( $id, $tax_slug ) {
     130    $terms = wp_get_post_terms( $id, $tax_slug, array( 'fields' => 'names' ) );
    132131    return implode( ', ', $terms );
    133132}
     
    137136 * Returns the taxonomies associated to a lesson or workshop
    138137 *
    139  * @param string $id Id of the post
     138 * @param string $id Id of the post.
    140139 * @return string
    141140 */
    142141function wporg_get_custom_taxonomies( $id ) {
    143     return [
    144         [
    145             'icon' => 'clock',
    146             'label' => 'Length:',
    147             'values' => get_taxonomy_values( $id, 'duration' )
    148         ],
    149         [
    150             'icon' => 'admin-users',
    151             'label' => 'Audience:',
    152             'values' => get_taxonomy_values( $id, 'audience' )
    153         ],
    154         [
    155             'icon' => 'dashboard',
    156             'label' => 'Level:',
    157             'values' => get_taxonomy_values( $id, 'level' )
    158         ],
    159         [
    160             'icon' => 'welcome-learn-more',
    161             'label' => 'Type of Instruction:',
    162             'values' => get_taxonomy_values( $id, 'instruction_type' )
    163         ]
    164     ];
     142    return array(
     143        array(
     144            'icon'   => 'clock',
     145            'label'  => 'Length:',
     146            'values' => get_taxonomy_values( $id, 'duration' ),
     147        ),
     148        array(
     149            'icon'   => 'admin-users',
     150            'label'  => 'Audience:',
     151            'values' => get_taxonomy_values( $id, 'audience' ),
     152        ),
     153        array(
     154            'icon'   => 'dashboard',
     155            'label'  => 'Level:',
     156            'values' => get_taxonomy_values( $id, 'level' ),
     157        ),
     158        array(
     159            'icon'   => 'welcome-learn-more',
     160            'label'  => 'Type of Instruction:',
     161            'values' => get_taxonomy_values( $id, 'instruction_type' ),
     162        ),
     163    );
    165164}
    166165
     
    198197 */
    199198function wporg_get_download_slides_url() {
    200 return get_post_meta( get_the_ID(), 'download_lesson_plan_slides_url', true );
     199    return get_post_meta( get_the_ID(), 'download_lesson_plan_slides_url', true );
    201200}
    202201
     
    206205 * @return array
    207206 */
    208 function wporg_get_workshops( $options = NULL ) {
     207function wporg_get_workshops( $options = null ) {
    209208    $args = array(
    210209        'post_type' => 'wporg_workshop',
    211210    );
    212211
    213     if( ! is_null( $options ) ) {
     212    if ( ! is_null( $options ) ) {
    214213        $args = array_merge( $args, $options );
    215214
     
    243242}
    244243
    245 /**             
     244/**
    246245 * Display a featured image, falling back to the VideoPress thumbnail if no featured image was explicitly set.
    247  *         
    248  * @param $post The Workshop post for which we want the thumbnail.
    249  * @param $size The image size: 'medium', 'full'.
    250  */     
     246 *
     247 * @param WP_Post $post The Workshop post for which we want the thumbnail.
     248 * @param string  $size The image size: 'medium', 'full'.
     249 */
    251250function wporg_get_post_thumbnail( $post, $size = 'post-thumbnail' ) {
    252     $thumbnail = get_the_post_thumbnail( $post, $size );
    253     if ( $thumbnail ) {
    254         return $thumbnail;
    255     } else {
    256         $post = get_post( $post );
    257         foreach ( get_post_meta( $post->ID, '', true ) as $key => $value ) {
    258             if ( substr( $key, 0, 8 ) === '_oembed_' && preg_match( '#https://video.wordpress.com/embed/(\w+)#', $value[0], $match ) ) {
    259                 $video = videopress_get_video_details( $match[1] );
    260                 if ( !is_wp_error( $video ) && isset( $video->poster ) ) {
    261                     return '<img class="attachment-' . esc_attr( $size ) . ' wp-post-image" src=' . esc_url( $video->poster ) . ' loading="lazy" />';
    262                 }
    263             }
    264         }
    265     }
    266 }
    267 
     251    $thumbnail = get_the_post_thumbnail( $post, $size );
     252    if ( $thumbnail ) {
     253        return $thumbnail;
     254    } else {
     255        $post = get_post( $post );
     256        foreach ( get_post_meta( $post->ID, '', true ) as $key => $value ) {
     257            if ( substr( $key, 0, 8 ) === '_oembed_' && preg_match( '#https://video.wordpress.com/embed/(\w+)#', $value[0], $match ) ) {
     258                $video = videopress_get_video_details( $match[1] );
     259                if ( ! is_wp_error( $video ) && isset( $video->poster ) ) {
     260                    return '<img class="attachment-' . esc_attr( $size ) . ' wp-post-image" src=' . esc_url( $video->poster ) . ' loading="lazy" alt="" />';
     261                }
     262            }
     263        }
     264    }
     265}
     266
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php

    r10166 r10169  
    1313
    1414global $wporg_global_header_options;
    15 if ( !isset( $wporg_global_header_options['in_wrapper'] ) )
     15if ( ! isset( $wporg_global_header_options['in_wrapper'] ) ) {
    1616    $wporg_global_header_options['in_wrapper'] = '';
    17 $wporg_global_header_options['in_wrapper'] .= '<a class="skip-link screen-reader-text" href="#content">' . esc_html__( 'Skip to content', 'wporg-forums' ) . '</a>';
     17}
     18$wporg_global_header_options['in_wrapper'] .= '<a class="skip-link screen-reader-text" href="#content">' . esc_html__( 'Skip to content', 'wporg-learn' ) . '</a>';
    1819wporg_get_global_header();
    1920
     
    2122
    2223<div id="page" class="site">
    23     <a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Skip to content', 'wporg-forums' ); ?></a>
     24    <a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Skip to content', 'wporg-learn' ); ?></a>
    2425
    2526    <div id="content">
    2627        <header id="masthead" class="site-header <?php echo is_front_page() ? 'home' : ''; ?>" role="banner">
    2728            <div class="site-branding">
    28                 <?php
    29                 if ( is_front_page() ) {
    30                 ?>
    31                 <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php _ex('Learn WordPress', 'Site title', 'wporg-forums'); ?></a></h1>
     29            <?php if ( is_front_page() ) : ?>
     30                <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo esc_html( _x( 'Learn WordPress', 'Site title', 'wporg-learn' ) ); ?></a></h1>
    3231
    3332                <p class="site-description">
    3433                    <?php
    3534                    /* Translators: subhead */
    36                     _e('Whether you&#8217;re a first-time blogger or seasoned developer, there&#8217;s always more to learn. From community members all over the world, these vast resources will help you learn more about WordPress and teach it to others.', 'wporg-forums');
     35                    esc_html_e( 'Whether you&#8217;re a first-time blogger or seasoned developer, there&#8217;s always more to learn. From community members all over the world, these vast resources will help you learn more about WordPress and teach it to others.', 'wporg-learn' );
    3736                    ?>
    3837                </p>
    3938
    40                 <form role="search" method="get" class="search-form" action="<?php esc_url( home_url( '/' ) ) ?>">
    41                     <label>
    42                         <span class="screen-reader-text"><?php _e('Search for:', 'wporg-forums' ) ?></span>
    43                         <input type="search" class="search-field" placeholder="<?php esc_attr_e( 'Search a teaching resource', 'wporg-forums' )?>" value="<?php get_search_query() ?>" name="s" />
    44                     </label>
    45                     <button type="submit" class="search-submit button button-primary button-search"><i class="dashicons dashicons-search"></i><span class="screen-reader-text"><?php esc_attr_e( 'Search', 'wporg-forums' ) ?></span></button>
    46                 </form>
     39                <form role="search" method="get" class="search-form" action="<?php esc_url( home_url( '/' ) ); ?>">
     40                    <label>
     41                        <span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'wporg-learn' ); ?></span>
     42                        <input type="search" class="search-field" placeholder="<?php esc_attr_e( 'Search a teaching resource', 'wporg-learn' ); ?>" value="<?php get_search_query(); ?>" name="s" />
     43                    </label>
     44                    <button type="submit" class="search-submit button button-primary button-search"><i class="dashicons dashicons-search"></i><span class="screen-reader-text"><?php esc_attr_e( 'Search', 'wporg-learn' ); ?></span></button>
     45                </form>
    4746
    48                 <?php
    49                 } elseif ( is_page() ) {
    50                 ?>
     47                <?php elseif ( is_page() ) : ?>
    5148                <h1 class="site-title"><a href="<?php echo esc_url( get_the_permalink() ); ?>" rel="home"><?php the_title(); ?></a></h1>
    52                 <?php
    53                 } else {
    54                 ?>
    55                     <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php _ex('Learn WordPress', 'Site title', 'wporg-forums'); ?></a></p>
    56                     <nav id="site-navigation" class="main-navigation" role="navigation">
    57                         <button
    58                             class="menu-toggle dashicons dashicons-arrow-down-alt2"
    59                             aria-controls="primary-menu"
    60                             aria-expanded="false"
    61                             aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg-learn' ); ?>"
    62                         >
    63                         </button>
     49                <?php else : ?>
     50                <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
     51                    <?php echo esc_html( _x( 'Learn WordPress', 'Site title', 'wporg-learn' ) ); ?>
     52                </a></p>
     53                <nav id="site-navigation" class="main-navigation" role="navigation">
     54                    <button
     55                        class="menu-toggle dashicons dashicons-arrow-down-alt2"
     56                        aria-controls="primary-menu"
     57                        aria-expanded="false"
     58                        aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg-learn' ); ?>"
     59                    >
     60                    </button>
    6461
    65                         <div id="primary-menu" class="menu">
    66                             <?php
    67                             wp_nav_menu( array(
    68                                 'theme_location' => 'primary',
    69                                 'menu_id'        => 'primary-menu',
    70                             ) );
    71                             ?>
    72                         </div>
    73                     </nav><!-- #site-navigation -->
    74                 <?php } ?>
     62                    <div id="primary-menu" class="menu">
     63                        <?php
     64                        wp_nav_menu( array(
     65                            'theme_location' => 'primary',
     66                            'menu_id'        => 'primary-menu',
     67                        ) );
     68                        ?>
     69                    </div>
     70                </nav><!-- #site-navigation -->
     71                <?php endif; ?>
     72
    7573            </div><!-- .site-branding -->
    7674        </header><!-- #masthead -->
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/package.json

    r10133 r10169  
    11{
    2     "name": "wporg-learn-2020",
     2    "name": "wporg-learn-theme",
    33    "version": "1.0.0",
    44    "description": "Theme for learn.wordpress.org",
     
    1212        "start": "grunt watch",
    1313        "build": "grunt build",
    14         "dev": "grunt"
     14        "dev": "grunt",
     15        "format:js": "wp-scripts format-js js",
     16        "lint:css": "wp-scripts lint-style css",
     17        "lint:js": "exit 0",
     18        "packages-update": "wp-scripts packages-update"
    1519    },
    1620    "browserslist": [
     
    1923    "devDependencies": {
    2024        "@wordpress/browserslist-config": "2.6.0",
     25        "@wordpress/scripts": "12.1.1",
    2126        "autoprefixer": "9.6.1",
    2227        "cssnano": "4.1.10",
     
    2833        "node-sass": "4.12.0",
    2934        "pixrem": "5.0.0"
     35    },
     36    "stylelint": {
     37        "extends": "../../../../.stylelintrc",
     38        "ignoreFiles": ["*/vendor/*", "**/*.css", "**/*.css.map"]
    3039    }
    3140}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page-submit-an-idea.php

    r10146 r10169  
    99
    1010    <main id="main" class="site-main page-full-width" role="main">
    11         <?php echo get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
     11        <?php get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
    1212
    1313        <?php
     
    1818                <div class="entry-content">
    1919                    <section class="submit-idea-cta">
    20                         <h2><?php _e( 'Is this a Workshop or Lesson Plan idea?' ); ?></h2>
     20                        <h2><?php esc_html_e( 'Is this a Workshop or Lesson Plan idea?', 'wporg-learn' ); ?></h2>
    2121
    2222                        <div class="idea-type-lists">
    2323                            <div class="col">
    2424                                <span class="dashicons dashicons-welcome-learn-more"></span>
    25                                 <p>
    26                                 Workshops are a collection of lessons and a great way to get people hands-on with WordPress.
    27                                 </p>
    28                                 <a class="button button-primary button-large" href="/submit-workshop-idea"><?php _e( 'Workshop Idea' ); ?></a>
     25                                <p><?php esc_html_e( 'Workshops are a collection of lessons and a great way to get people hands-on with WordPress.', 'wporg-learn' ); ?></p>
     26                                <a class="button button-primary button-large" href="/submit-workshop-idea"><?php esc_html_e( 'Workshop Idea', 'wporg-learn' ); ?></a>
    2927                            </div>
    3028                           
    3129                            <div class="col">
    3230                                <span class="dashicons dashicons-lightbulb"></span>
    33                                 <p>
    34                                 Lesson plans are designed to guide and inspire others to deliver great content.
    35                                 </p>
    36                                 <a class="button button-primary button-large" href="/submit-lesson-idea"><?php _e( 'Lesson Idea' ); ?></a>
     31                                <p><?php esc_html_e( 'Lesson plans are designed to guide and inspire others to deliver great content.', 'wporg-learn' ); ?></p>
     32                                <a class="button button-primary button-large" href="/submit-lesson-idea"><?php esc_html_e( 'Lesson Idea', 'wporg-learn' ); ?></a>
    3733                            </div>
    3834                        </div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page.php

    r10131 r10169  
    1414
    1515    <main id="main" class="site-main" role="main">
    16     <?php echo get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
     16        <?php get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
    1717
    1818        <div id="main-content">
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/search.php

    r10131 r10169  
    1111
    1212$search_query = sprintf(
    13     /* translators: Search query. */
    14     esc_html__( 'Search Results for: %s', 'wporg-learn' ),
    15     get_search_query()
     13    /* translators: Search query. */
     14    esc_html__( 'Search Results for: %s', 'wporg-learn' ),
     15    get_search_query()
    1616);
    1717
     
    1919
    2020    <main id="main" class="site-main type-page" role="main">
    21         <div class="clearfix">
    22             <div class="bbp-breadcrumb">
    23                 <p>
    24                     <a href="<?php echo home_url(); ?>" class="bbp-breadcrumb-home">Learn Home</a>
    25                     <span class="bbp-breadcrumb-sep">»</span>
    26                     <span class="bbp-breadcrumb-current"><?php echo $search_query; ?></span>
    27                 </p>
    28             </div>
    29         </div>
     21        <div class="clearfix">
     22            <div class="bbp-breadcrumb">
     23                <p>
     24                    <a href="<?php echo esc_url( home_url() ); ?>" class="bbp-breadcrumb-home"><?php esc_html_e( 'Learn Home', 'wporg-learn' ); ?></a>
     25                    <span class="bbp-breadcrumb-sep">»</span>
     26                    <span class="bbp-breadcrumb-current"><?php echo esc_html( $search_query ); ?></span>
     27                </p>
     28            </div>
     29        </div>
    3030
    3131        <?php if ( have_posts() ) : ?>
    3232
    3333            <header class="page-header">
    34                 <h1 class="h3"><?php echo $search_query; ?></h1>
     34                <h1 class="h3"><?php echo esc_html( $search_query ); ?></h1>
    3535            </header><!-- .page-header -->
    3636
     
    3939            while ( have_posts() ) :
    4040                the_post();
    41             ?>
     41                ?>
    4242
    4343            <article id="post-<?php the_ID(); ?>" <?php post_class( 'card' ); ?>>
     
    5959                        sprintf(
    6060                            /* translators: %s: Name of current post */
    61                             __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'wporg' ),
     61                            __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'wporg-learn' ),
    6262                            get_the_title()
    6363                        ),
     
    6969            </article><!-- #post-## -->
    7070
    71             <?php
     71                <?php
    7272                // End the loop.
    7373                endwhile;
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/searchform.php

    r10131 r10169  
    1010?>
    1111<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    12     <label for="s" class="screen-reader-text"><?php _ex( 'Search for:', 'label', 'wporg-forums' ); ?></label>
     12    <label for="s" class="screen-reader-text"><?php echo esc_html( _x( 'Search for:', 'label', 'wporg-learn' ) ); ?></label>
    1313    <?php
    14         $placeholder = _x( 'Search Lesson Plans and Workshop Ideas', 'placeholder', 'wporg-forums' );
     14        $placeholder = _x( 'Search Lesson Plans and Workshop Ideas', 'placeholder', 'wporg-learn' );
    1515    ?>
    1616    <input type="search" id="s" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php the_search_query(); ?>" name="s" />
     
    1818    <input type="hidden" name="intext" value="<?php echo esc_attr( $project->prefixed_title ); ?>" />
    1919    <?php endif; ?>
    20     <button class="button button-primary button-search"><i class="dashicons dashicons-search"></i><span class="screen-reader-text"><?php _e( 'Search Lesson Plans and Workshop Ideas', 'wporg-forums' ); ?></span></button>
     20    <button class="button button-primary button-search"><i class="dashicons dashicons-search"></i><span class="screen-reader-text"><?php esc_html_e( 'Search Lesson Plans and Workshop Ideas', 'wporg-learn' ); ?></span></button>
    2121</form>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single-lesson-plan.php

    r10131 r10169  
    99
    1010    <main id="main" class="site-main type-page" role="main">
    11         <?php echo get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
     11        <?php get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
    1212
    1313        <div id="main-content">
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single-wporg_workshop.php

    r10131 r10169  
    1414            the_post();
    1515            get_template_part( 'template-parts/content', 'workshop-single' );
    16         }   ?>
     16        }
     17        ?>
    1718    </main><!-- #main -->
    1819
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single.php

    r10131 r10169  
    1212        <div id="main-content">
    1313            <?php
    14 
    1514            while ( have_posts() ) :
    1615                the_post();
    17 
    1816                get_template_part( 'template-parts/content', 'single' );
    1917            endwhile; // End of the loop.
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/bbpress-front.php

    r10131 r10169  
    1717    <div>
    1818        <div class="info-box">
    19                     <span class="dashicons
    20                     <?php
    21                     /* translators: dashicon class name for 'Welcome to Support' section. Do not translate into your own language. */
    22                     esc_attr_e( 'dashicons-sos', 'wporg-forums' );
    23                     ?>
    24                     "></span>
    25             <h3><?php _e( 'Welcome to Support', 'wporg-forums' ); ?></h3>
    26             <p><?php _e( 'Our community-based Support Forums are a great place to learn, share, and troubleshoot.', 'wporg-forums' ); ?></p>
    27             <p><?php _e( '<a href="https://wordpress.org/support/welcome/">Get started</a>', 'wporg-forums' ); ?></p>
     19            <span class="dashicons dashicons-sos"></span>
     20            <h3><?php esc_html_e( 'Welcome to Support', 'wporg-learn' ); ?></h3>
     21            <p><?php esc_html_e( 'Our community-based Support Forums are a great place to learn, share, and troubleshoot.', 'wporg-learn' ); ?></p>
     22            <p><?php esc_html_e( '<a href="https://wordpress.org/support/welcome/">Get started</a>', 'wporg-learn' ); ?></p>
    2823        </div>
    2924    </div>
    3025    <div>
    3126        <div class="info-box">
    32                     <span class="dashicons
    33                     <?php
    34                     /* translators: dashicon class name for 'Documentation' section. Do not translate into your own language. */
    35                     esc_attr_e( 'dashicons-portfolio', 'wporg-forums' );
    36                     ?>
    37                     "></span>
    38             <h3><?php _e( 'Documentation', 'wporg-forums' ); ?></h3>
    39             <p><?php _e( 'Your first stop where you\'ll find information on everything from installing to creating plugins.', 'wporg-forums' ); ?></p>
    40             <p><?php _e( '<a href="https://codex.wordpress.org/">Explore documentation</a>', 'wporg-forums' ); ?></p>
     27            <span class="dashicons dashicons-portfolio"></span>
     28            <h3><?php esc_html_e( 'Documentation', 'wporg-learn' ); ?></h3>
     29            <p><?php esc_html_e( 'Your first stop where you\'ll find information on everything from installing to creating plugins.', 'wporg-learn' ); ?></p>
     30            <p><?php esc_html_e( '<a href="https://codex.wordpress.org/">Explore documentation</a>', 'wporg-learn' ); ?></p>
    4131        </div>
    4232    </div>
    4333    <div>
    4434        <div class="info-box">
    45                     <span class="dashicons
    46                     <?php
    47                     /* translators: dashicon class name for 'Get Involved' section. Do not translate into your own language. */
    48                     esc_attr_e( 'dashicons-hammer', 'wporg-forums' );
    49                     ?>
    50                     "></span>
    51             <h3><?php _e( 'Get Involved', 'wporg-forums' ); ?></h3>
    52             <p><?php _e( 'The Support Handbook is great for tips, tricks, and advice regarding giving the best support possible.', 'wporg-forums' ); ?></p>
    53             <p><?php _e( '<a href="https://make.wordpress.org/support/handbook/">Explore the Handbook</a>', 'wporg-forums' ); ?></p>
     35            <span class="dashicons dashicons-hammer"></span>
     36            <h3><?php esc_html_e( 'Get Involved', 'wporg-learn' ); ?></h3>
     37            <p><?php esc_html_e( 'The Support Handbook is great for tips, tricks, and advice regarding giving the best support possible.', 'wporg-learn' ); ?></p>
     38            <p><?php esc_html_e( '<a href="https://make.wordpress.org/support/handbook/">Explore the Handbook</a>', 'wporg-learn' ); ?></p>
    5439        </div>
    5540    </div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-breadcrumbs.php

    r10131 r10169  
    1010/**
    1111 * Returns list of workshops based on slug
    12  * 
     12 *
    1313 * @return array|bool
    1414 */
    1515function get_workshop_from_slug( $slug ) {
    16     $args = array(
    17         'name'        => $slug,
    18         'post_type'   => 'workshop',
    19         'post_status' => 'publish',
    20         'numberposts' => 1
    21       );
     16    $args = array(
     17        'name'        => $slug,
     18        'post_type'   => 'workshop',
     19        'post_status' => 'publish',
     20        'numberposts' => 1,
     21    );
    2222
    23     $workshop = get_posts( $args );
     23    $workshop = get_posts( $args );
    2424
    25     return isset( $workshop[ 0 ] ) ? $workshop[ 0 ] : false;
     25    return isset( $workshop[0] ) ? $workshop[0] : false;
    2626}
    2727
    2828/**
    2929 * Returns whether we are viewing a lesson from a workshop
    30  * 
     30 *
    3131 * @param string $referer
    3232 * @return bool
    3333 */
    3434function lesson_came_from_workshop( $referer ) {
    35     return wporg_post_type_is_lesson() && strrpos( $referer, 'workshop' );
     35    return wporg_post_type_is_lesson() && strrpos( $referer, 'workshop' );
    3636}
    3737
    38 $crumbs = [
    39     [
    40         'label' => __( 'Learn Home', 'wporg-learn' ),
    41         'url' => home_url()
    42     ]
    43 ];
     38$crumbs = array(
     39    array(
     40        'label' => __( 'Learn Home', 'wporg-learn' ),
     41        'url'   => home_url(),
     42    ),
     43);
    4444
    4545$referer = wp_get_referer();
    4646
    47 // If we came from a workshop, we want to modify the breadrumbs to bring us back to the workshop 
    48 if( lesson_came_from_workshop( $referer ) ) {
    49     $workshop = get_workshop_from_slug( basename( $referer ) );
     47// If we came from a workshop, we want to modify the breadrumbs to bring us back to the workshop.
     48if ( lesson_came_from_workshop( $referer ) ) {
     49    $workshop = get_workshop_from_slug( basename( $referer ) );
    5050
    51     if( $workshop ) {
    52         array_push( $crumbs, [
    53             'label' => __( 'Workshops', 'wporg-learn' ),
    54             'url' => get_post_type_archive_link( 'workshop' )
    55         ] );
     51    if ( $workshop ) {
     52        array_push( $crumbs, array(
     53            'label' => __( 'Workshops', 'wporg-learn' ),
     54            'url'   => get_post_type_archive_link( 'workshop' ),
     55        ) );
    5656
    57         array_push( $crumbs, [
    58             'label' => $workshop->post_title,
    59             'url' => get_post_permalink( $workshop->ID )
    60         ] );
    61     }
    62 
     57        array_push( $crumbs, array(
     58            'label' => $workshop->post_title,
     59            'url'   => get_post_permalink( $workshop->ID ),
     60        ) );
     61    }
    6362} else {
    6463
    65     // Get information about the post title.
    66     $post_type = get_post_type_object( get_post_type( get_queried_object() ) );
     64    // Get information about the post title.
     65    $cpt_object = get_post_type_object( get_post_type( get_queried_object() ) );
    6766
    68     if( wporg_post_type_is_lesson() ){
    69         array_push( $crumbs, [
    70             'label' => ucfirst( $post_type->labels->name ),
    71             'url' => home_url( $post_type->has_archive  )
    72         ] );
    73     }
     67    if ( wporg_post_type_is_lesson() ) {
     68        array_push( $crumbs, array(
     69            'label' => ucfirst( $cpt_object->labels->name ),
     70            'url'   => home_url( $cpt_object->has_archive ),
     71        ) );
     72    }
    7473}
    7574
    76 array_push( $crumbs, [
    77     'label' => get_the_title(),
    78     'url' => ''
    79 ] );
     75array_push( $crumbs, array(
     76    'label' => get_the_title(),
     77    'url'   => '',
     78) );
    8079?>
    8180
    8281<div class="clearfix">
    83     <div class="bbp-breadcrumb">       
    84     <?php
    85         $crumb_length = count($crumbs);
     82    <div class="bbp-breadcrumb">
     83    <?php
     84    $crumb_length = count( $crumbs );
    8685
    87         for( $x = 0; $x < $crumb_length; $x++ ) {
    88             if( empty( $crumbs[ $x ][ 'url' ] ) ) {
    89                 echo '<span class="bbp-breadcrumb-current">' . $crumbs[ $x ][ 'label' ] . '</span>';
    90             } else {
    91                 echo '<a href="' . $crumbs[ $x ][ 'url' ] .'" class="bbp-breadcrumb-home">';
    92                 echo $crumbs[ $x ][ 'label' ];
    93                 echo '</a>';
    94             }
     86    for ( $x = 0; $x < $crumb_length; $x++ ) {
     87        if ( empty( $crumbs[ $x ]['url'] ) ) {
     88            echo '<span class="bbp-breadcrumb-current">' . esc_html( $crumbs[ $x ]['label'] ) . '</span>';
     89        } else {
     90            echo '<a href="' . esc_url( $crumbs[ $x ]['url'] ) . '" class="bbp-breadcrumb-home">';
     91            echo esc_html( $crumbs[ $x ]['label'] );
     92            echo '</a>';
     93        }
    9594
    96             if( $x < $crumb_length - 1 ) {
    97                 echo ' <span class="bbp-breadcrumb-sep">»</span> ';
    98             }   
    99         }
    100     ?>
    101     </div>
     95        if ( $x < $crumb_length - 1 ) {
     96            echo ' <span class="bbp-breadcrumb-sep">»</span> ';
     97        }
     98    }
     99    ?>
     100    </div>
    102101</div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-directory-nav.php

    r10131 r10169  
    1111
    1212<nav id="site-navigation" class="directory-navigation" role="navigation">
    13     <ul id="menu-theme-directory" class="menu">
    14         <li class="<?php echo ( wporg_post_type_is_lesson() ? "current" : "" ) ?>"><a href="<?php echo home_url( '/lesson-plans/' ); ?>"><?php _e( 'Lesson Plans', 'wporg-themes' ); ?></a></li>
    15     </ul>
     13    <ul id="menu-theme-directory" class="menu">
     14        <li class="<?php echo ( wporg_post_type_is_lesson() ? 'current' : '' ); ?>"><a href="<?php echo esc_url( home_url( '/lesson-plans/' ) ); ?>"><?php esc_html_e( 'Lesson Plans', 'wporg-learn' ); ?></a></li>
     15    </ul>
    1616</nav>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-featured-workshop.php

    r10162 r10169  
    1212
    1313<div class="featured-workshop">
    14     <?php while ( $featured_workshop->have_posts() ) : $featured_workshop->the_post(); ?>
    15         <div class="featured-workshop_video"><?php echo wporg_get_post_thumbnail( $post, 'full' ); ?></div>
     14    <?php while ( $featured_workshop->have_posts() ) :
     15        $featured_workshop->the_post(); ?>
     16        <div class="featured-workshop_video">
     17            <?php
     18            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     19            echo wporg_get_post_thumbnail( $post, 'full' );
     20            ?>
     21        </div>
    1622        <div class="featured-workshop_content">
    17             <a class="featured-workshop_title" href="<?php echo esc_url( get_the_permalink() ); ?>"><?php echo the_title() ?></a>
     23            <a class="featured-workshop_title" href="<?php echo esc_url( get_the_permalink() ); ?>"><?php the_title(); ?></a>
    1824            <div class="row">
    1925                <div class="col-8">
     
    2228                <div class="col-4 featured-workshop_content_author">
    2329                    <?php
    24                         $presenters = wporg_get_workshop_presenters();
     30                    $presenters = wporg_get_workshop_presenters();
    2531
    2632                        // We'll only display the first author in this view
    27                         if ( isset( $presenters[0] ) ) :
    28                             get_template_part( 'template-parts/component', 'workshop-presenter',
    29                                 array( 'presenter' => $presenters[0], 'class' => 'workshop-presenter--is-centered' )
    30                             );
     33                    if ( isset( $presenters[0] ) ) :
     34                        get_template_part( 'template-parts/component', 'workshop-presenter',
     35                            array(
     36                                'presenter' => $presenters[0],
     37                                'class' => 'workshop-presenter--is-centered',
     38                            )
     39                        );
    3140                        endif;
    3241                    ?>
     
    3443            </div>
    3544        </div>
    36     <?php endwhile; ?>
     45        <?php
     46        endwhile;
     47        wp_reset_postdata();
     48    ?>
    3749</div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-lesson-filters.php

    r10142 r10169  
    11<?php
    22$terms = get_terms( array(
    3     'taxonomy' => 'wporg_lesson_category',
     3    'taxonomy'   => 'wporg_lesson_category',
    44    'hide_empty' => false,
    55) );
     
    99
    1010<div class="wp-filter">
    11     <ul class="filter-links">
    12         <li>
    13             <a href="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) ) ?>" class="<?php echo ( 'all' === $current_term ) ? 'current' : ''; ?>">
    14                 <?php _e( 'All', 'wporg-learn' ); ?>
    15             </a>
    16         </li>
    17         <?php foreach ( $terms as $term ) : ?>
    18             <li>
    19                 <a href="<?php echo get_term_link( $term, 'wporg_lesson_category' ); ?>" class="<?php echo ( $term->slug === $current_term ) ? 'current' : ''; ?>">
    20                     <?php echo esc_html( $term->name ); ?>
    21                 </a>
    22             </li>
    23         <?php endforeach; ?>
    24     </ul>
     11    <ul class="filter-links">
     12        <li>
     13            <a href="<?php echo esc_url( get_post_type_archive_link( 'lesson-plan' ) ); ?>" class="<?php echo ( 'all' === $current_term ) ? 'current' : ''; ?>">
     14                <?php esc_html_e( 'All', 'wporg-learn' ); ?>
     15            </a>
     16        </li>
     17        <?php foreach ( $terms as $t ) : ?>
     18            <li>
     19                <a href="<?php echo esc_url( get_term_link( $t, 'wporg_lesson_category' ) ); ?>" class="<?php echo ( $t->slug === $current_term ) ? 'current' : ''; ?>">
     20                    <?php echo esc_html( $t->name ); ?>
     21                </a>
     22            </li>
     23        <?php endforeach; ?>
     24    </ul>
    2525</div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-submit-idea-cta.php

    r10166 r10169  
    1313
    1414<section class="submit-idea-cta">
    15     <?php if( isset( $args['icon'] ) ) :?>
    16         <div class="content-icon"><span class="dashicons dashicons-<?php echo $args['icon']; ?>"></span></div>
     15    <?php if ( isset( $args['icon'] ) ) : ?>
     16        <div class="content-icon"><span class="dashicons dashicons-<?php echo esc_attr( $args['icon'] ); ?>"></span></div>
    1717    <?php endif; ?>
    18     <h2><?php _e( 'Have an Idea for a Workshop? Let us know!' ); ?></h2>
    19     <a class="button button-primary button-large" href="https://wordcampcentral.survey.fm/learn-wordpress-workshop-application"><?php _e( 'Submit an Idea' ); ?></a>
     18    <h2><?php esc_html_e( 'Have an Idea for a Workshop? Let us know!', 'wporg-learn' ); ?></h2>
     19    <a class="button button-primary button-large" href="https://wordcampcentral.survey.fm/learn-wordpress-workshop-application"><?php esc_html_e( 'Submit an Idea', 'wporg-learn' ); ?></a>
    2020</section>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-taxonomy-item.php

    r10131 r10169  
    1111
    1212<li>
    13     <span class="dashicons dashicons-<?php echo $detail[ 'icon' ]; ?>"></span>
    14     <span><?php echo $detail[ 'label']; ?></span>
    15     <strong>
    16         <span><?php echo $detail[ 'values' ]; ?></span>
    17     </strong>
     13    <span class="dashicons dashicons-<?php echo esc_attr( $detail['icon'] ); ?>"></span>
     14    <span><?php echo esc_html( $detail['label'] ); ?></span>
     15    <strong>
     16        <span><?php echo esc_html( $detail['values'] ); ?></span>
     17    </strong>
    1818</li>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-video-grid-item.php

    r10161 r10169  
    1212<li class="col-4 video-grid_item">
    1313    <a class="video-grid_item_link" href="<?php echo esc_url( get_the_permalink() ); ?>">
    14         <?php echo wporg_get_post_thumbnail( $post, 'medium' ); ?>
     14        <?php
     15        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     16        echo wporg_get_post_thumbnail( $post, 'medium' );
     17        ?>
    1518        <?php the_title(); ?>
    1619    </a>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-video-grid.php

    r10131 r10169  
    1010$options = get_query_var( 'video-grid-options' );
    1111
    12 if( is_array( $options ) ) {
     12if ( is_array( $options ) ) {
    1313    $latest_posts = wporg_get_workshops( $options );
    1414} else {
     
    1818?>
    1919
    20 <?php if ( $latest_posts->have_posts() )  : ?>
     20<?php if ( $latest_posts->have_posts() ) : ?>
    2121    <ul class="row video-grid">
    2222        <?php while ( $latest_posts->have_posts() ) :
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-workshop-presenter.php

    r10162 r10169  
    99
    1010$args = wp_parse_args( $args, array( 'class' => '' ) );
    11 $presenter = $args[ 'presenter' ];
     11$presenter = $args['presenter'];
    1212
    1313?>
    1414
    1515<?php if ( $presenter ) : ?>
    16     <div class="workshop-presenter <?php echo $args['class']; ?> ">
     16    <div class="workshop-presenter <?php echo esc_attr( $args['class'] ); ?> ">
    1717        <div>
    18             <?php echo get_avatar( $presenter->ID , 56, '', '', array ( 'class' => 'workshop-presenter_profile' ) ); ?>
     18            <?php echo get_avatar( $presenter->ID, 56, '', '', array( 'class' => 'workshop-presenter_profile' ) ); ?>
    1919        </div>
    2020        <div>
    21             <div class="workshop-presenter_name"><?php echo esc_html(  $presenter->display_name ); ?></div>
     21            <div class="workshop-presenter_name"><?php echo esc_html( $presenter->display_name ); ?></div>
    2222            <?php if ( ! empty( $presenter->user_nicename ) ) : ?>
    2323                <a class="workshop-presenter_handle" href="<?php printf( 'https://profiles.wordpress.org/%s/', esc_attr( $presenter->user_login ) ); ?>">
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-archive.php

    r10131 r10169  
    88 */
    99
    10 $topic_list = [];
     10$topic_list = array();
    1111
    12 if( wporg_post_type_is_workshop() ) {
     12if ( wporg_post_type_is_workshop() ) {
    1313    $topics = get_taxonomy_values( get_the_ID(), 'topic' );
    1414
    15     if( !empty( $topics ) ) {
     15    if ( ! empty( $topics ) ) {
    1616        $topic_list = explode( ',', $topics );
    1717    }
     
    2020?>
    2121
    22 <div class="lp-item <?php echo ( wporg_post_type_is_workshop() ? 'lp-item--full' : '' ) ?>">
    23     <div class="lp-item-wrap <?php echo ( wporg_post_type_is_workshop() ? 'lp-item-wrap--split' : '' ) ?>">
     22<div class="lp-item <?php echo ( wporg_post_type_is_workshop() ? 'lp-item--full' : '' ); ?>">
     23    <div class="lp-item-wrap <?php echo ( wporg_post_type_is_workshop() ? 'lp-item-wrap--split' : '' ); ?>">
    2424        <h2 class="h4"><a href="<?php echo esc_url( get_the_permalink() ); ?>"><?php the_title(); ?></a></h2>
    2525        <div class="lp-body">
    2626            <div>
    27                 <p class="lp-excerpt <?php echo ( wporg_post_type_is_workshop() ? 'lp-excerpt--short' : '' ) ?>"><?php echo esc_attr( get_the_excerpt() ); ?></p>   
    28                 <?php if( !empty( $topic_list ) ) : ?>
    29                     <ul class="lp-topics <?php echo count( $topic_list ) > 4 ? 'lp-topics--split' : '' ; ?>">
    30                     <?php foreach( $topic_list as $topic ) : ?>
    31                         <li><?php echo $topic; ?></li>
     27                <p class="lp-excerpt <?php echo ( wporg_post_type_is_workshop() ? 'lp-excerpt--short' : '' ); ?>"><?php echo esc_attr( get_the_excerpt() ); ?></p> 
     28                <?php if ( ! empty( $topic_list ) ) : ?>
     29                    <ul class="lp-topics <?php echo count( $topic_list ) > 4 ? 'lp-topics--split' : ''; ?>">
     30                    <?php foreach ( $topic_list as $topic ) : ?>
     31                        <li><?php echo esc_html( $topic ); ?></li>
    3232                    <?php endforeach; ?>
    3333                    </ul>
     
    3535            </div>
    3636            <div class="lp-details">
    37                 <ul class="lp-details-list <?php echo wporg_post_type_is_lesson() ? 'lp-details-list--split' : '' ?>">
    38                     <?php
    39                         foreach( wporg_get_custom_taxonomies( get_the_ID() ) as $detail ) {
    40                             if( !empty( $detail[ 'values' ] ) ) {
    41                                 include( locate_template( 'template-parts/component-taxonomy-item.php' ) );
    42                             }           
     37                <ul class="lp-details-list <?php echo wporg_post_type_is_lesson() ? 'lp-details-list--split' : ''; ?>">
     38                    <?php
     39                    foreach ( wporg_get_custom_taxonomies( get_the_ID() ) as $detail ) {
     40                        if ( ! empty( $detail['values'] ) ) {
     41                            include locate_template( 'template-parts/component-taxonomy-item.php' );
    4342                        }
     43                    }
    4444                    ?>
    4545                </ul>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-page.php

    r10131 r10169  
    1717
    1818            wp_link_pages( array(
    19                 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wporg-forums' ),
     19                'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wporg-learn' ),
    2020                'after'  => '</div>',
    2121            ) );
     
    2929            sprintf(
    3030            /* translators: %s: Name of current post */
    31                 esc_html__( 'Edit %s', 'wporg-forums' ),
     31                esc_html__( 'Edit %s', 'wporg-learn' ),
    3232                the_title( '<span class="screen-reader-text">"', '"</span>', false )
    3333            ),
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-single.php

    r10148 r10169  
    88 */
    99
    10 
    11 $slides_url = wporg_get_slides_url();
     10$slides_url   = wporg_get_slides_url();
    1211$download_url = wporg_get_download_slides_url();
    13 
    1412?>
    1513
    1614<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1715
    18     <section>   
     16    <section>
    1917        <header class="row align-middle between section-heading section-heading--with-space">
    2018            <h1 class="section-heading_title h2"><?php the_title(); ?></h1>
     
    2725                wp_link_pages(
    2826                    array(
    29                         'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wporg-forums' ),
     27                        'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wporg-learn' ),
    3028                        'after'  => '</div>',
    3129                    )
     
    3634                <div class="lp-details">
    3735                    <ul>
    38                         <?php
    39                             foreach( wporg_get_custom_taxonomies( get_the_ID() ) as $detail ) {
    40                                 if( !empty( $detail[ 'values' ] ) ) {
    41                                     include( locate_template( 'template-parts/component-taxonomy-item.php' ) );
    42                                 }           
     36                        <?php
     37                        foreach ( wporg_get_custom_taxonomies( get_the_ID() ) as $detail ) {
     38                            if ( ! empty( $detail['values'] ) ) {
     39                                include locate_template( 'template-parts/component-taxonomy-item.php' );
    4340                            }
     41                        }
    4442                        ?>
    4543                    </ul>
     
    4745                    <ul class="lp-links">
    4846
    49                     <?php if( $slides_url ) : ?>
     47                    <?php if ( $slides_url ) : ?>
    5048                        <li>
    51                             <a href="<?php echo $slides_url; ?>" target="_blank"><span class="dashicons dashicons-admin-page"></span> <?php _e( 'View Lesson Plan Slides' ); ?></a>
     49                            <a href="<?php echo esc_url( $slides_url ); ?>" target="_blank"><span class="dashicons dashicons-admin-page"></span> <?php esc_html_e( 'View Lesson Plan Slides', 'wporg-learn' ); ?></a>
    5250                        </li>
    5351                    <?php endif; ?>
    5452
    55                     <?php if( $download_url ) : ?>
     53                    <?php if ( $download_url ) : ?>
    5654                        <li>
    57                             <a href="<?php echo $download_url; ?>"><span class="dashicons dashicons-download"></span> <?php _e( 'Download Lesson Slides' ); ?></a>
     55                            <a href="<?php echo esc_url( $download_url ); ?>"><span class="dashicons dashicons-download"></span> <?php esc_html_e( 'Download Lesson Slides', 'wporg-learn' ); ?></a>
    5856                        </li>
    5957                    <?php endif; ?>
    6058           
    6159                        <!-- <li>
    62                             <a href="#" target="_blank"><span class="dashicons dashicons-admin-post"></span> <?php _e( 'Print Lesson Plan' ); ?></a>
     60                            <a href="#" target="_blank"><span class="dashicons dashicons-admin-post"></span> <?php esc_html_e( 'Print Lesson Plan', 'wporg-learn' ); ?></a>
    6361                        </li> -->
    6462                    </ul>
    6563
    6664                    <div class="lp-suggestion">
    67                         <h2 class="lp-suggestion_title h4"><?php _e( 'Suggestions' ); ?></h2>
    68                         <p><?php _e( 'Found a typo, grammar error,or outdated screenshot?' ); ?></p>
    69                         <p><?php _e( 'Used this lesson plan in your event and have some suggestions?' ); ?></p>
    70                         <a href="https://wordcampcentral.survey.fm/learn-wordpress-workshop-application"><?php _e( 'Let us know!' ); ?></a>
     65                        <h2 class="lp-suggestion_title h4"><?php esc_html_e( 'Suggestions', 'wporg-learn' ); ?></h2>
     66                        <p><?php esc_html_e( 'Found a typo, grammar error,or outdated screenshot?', 'wporg-learn' ); ?></p>
     67                        <p><?php esc_html_e( 'Used this lesson plan in your event and have some suggestions?', 'wporg-learn' ); ?></p>
     68                        <a href="https://wordcampcentral.survey.fm/learn-wordpress-workshop-application"><?php esc_html_e( 'Let us know!', 'wporg-learn' ); ?></a>
    7169                    </div>
    7270                </div>
Note: See TracChangeset for help on using the changeset viewer.