Changeset 10169
- Timestamp:
- 08/13/2020 11:43:14 PM (4 years ago)
- 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%} 2 2 -
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} 2 2 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php
r10147 r10169 12 12 * 13 13 * @see https://developer.wordpress.org/block-editor/tutorials/block-tutorial/applying-styles-with-stylesheets/ 14 * @throws Error If the build files are not found. 14 15 */ 15 16 function workshop_details_init() { … … 23 24 } 24 25 25 $script_asset = require ( $script_asset_path );26 $script_asset = require $script_asset_path; 26 27 wp_register_script( 27 28 'workshop-details-editor-script', … … 51 52 'editor_style' => 'workshop-details-editor-style', 52 53 'style' => 'workshop-details-style', 53 'render_callback' => __NAMESPACE__ . '\workshop_details_render_callback' 54 'render_callback' => __NAMESPACE__ . '\workshop_details_render_callback', 54 55 ) ); 55 56 } 56 57 58 57 59 58 /** 60 59 * Build the html output based on input fields 61 60 * 62 * @param array 61 * @param array $fields 63 62 * @return string HTML output. 64 63 */ … … 66 65 $output = '<ul class="wp-block-wporg-learn-workshop-details">'; 67 66 68 foreach ( $fields as $key => $value ) {67 foreach ( $fields as $key => $value ) { 69 68 $output .= sprintf( '<li><b>%1$s</b><span>%2$s</span></li>', $key, $value ); 70 69 } … … 83 82 */ 84 83 function 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' ) ); 88 87 $captions = get_post_meta( $post->ID, 'video_caption_language' ); 89 88 90 89 $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 ) ), 96 95 ); 97 96 98 // Remove empty fields 97 // Remove empty fields. 99 98 $fields_to_output = array_filter( $fields ); 100 99 … … 104 103 /** 105 104 * Enqueue scripts and stylesheets for custom block styles. 105 * 106 * @throws Error If the build files are not found. 106 107 */ 107 108 function enqueue_block_style_assets() { … … 116 117 } 117 118 118 $script_asset = require ( $script_asset_path );119 $script_asset = require $script_asset_path; 119 120 wp_enqueue_script( 120 121 'wporg-learn-block-styles', -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-lesson-plan.php
r10142 r10169 4 4 class Lesson_Plan { 5 5 6 /**7 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 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 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 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 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 } 227 227 228 228 /** … … 230 230 */ 231 231 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. 233 233 if ( ! is_singular( 'lesson_plan' ) 234 234 || ! is_main_query() 235 235 || ! in_the_loop() 236 236 || is_embed() 237 || $id !== get_queried_object_id()) {237 || get_queried_object_id() !== $id ) { 238 238 return $title; 239 239 } … … 306 306 */ 307 307 $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', 313 313 ); 314 314 315 315 // Find and replace the existing edit action. 316 316 $replaced = false; 317 foreach ( $actions as &$action ) {317 foreach ( $actions as &$action ) { 318 318 if ( 'edit' === $action['action'] ) { 319 $action = $edit_action;319 $action = $edit_action; 320 320 $replaced = true; 321 321 break; … … 341 341 return $markdown_source; 342 342 } 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 ); 345 345 $markdown_source = str_replace( '/README.md', '/edit/dev/README.md', $markdown_source ); 346 346 return $markdown_source; 347 347 } 348 348 349 350 $post_id= get_the_ID();351 352 353 354 355 356 $content= str_replace( '<img src="/images/', '<img src="' . $markdown_source . '/images/', $content );357 358 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 } 360 360 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-markdown-import.php
r10147 r10169 9 9 10 10 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; 17 17 18 18 /** … … 28 28 } 29 29 30 /** 31 * Actions taken on `wporg_learn_manifest_import` event. 32 */ 30 33 public static function action_wporg_learn_manifest_import() { 31 34 $response = wp_remote_get( self::$lesson_plan_manifest ); … … 37 40 $manifest = json_decode( wp_remote_retrieve_body( $response ), true ); 38 41 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.' ); 40 43 } 41 44 // Fetch all lesson plan posts for comparison 42 $q = new WP_Query( array(45 $q = new WP_Query( array( 43 46 'post_type' => self::$supported_post_type, 44 47 'post_status' => 'publish', … … 46 49 ) ); 47 50 $existing = $q->posts; 48 $created = 0;49 foreach ( $manifest as $doc ) {51 $created = 0; 52 foreach ( $manifest as $doc ) { 50 53 // Already exists 51 54 if ( wp_filter_object_list( $existing, array( 'post_name' => $doc['slug'] ) ) ) { … … 65 68 if ( isset( $manifest[ $doc['parent'] ] ) ) { 66 69 $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 ); 68 71 if ( $parent ) { 69 72 $created++; … … 100 103 'post_name' => sanitize_title_with_dashes( $doc['slug'] ), 101 104 ); 102 $post_id = wp_insert_post( $post_data );105 $post_id = wp_insert_post( $post_data ); 103 106 if ( ! $post_id ) { 104 107 return false; … … 111 114 } 112 115 116 /** 117 * Actions taken on `wporg_learn_markdown_import` event. 118 */ 113 119 public static function action_wporg_learn_markdown_import() { 114 $q = new WP_Query( array(120 $q = new WP_Query( array( 115 121 'post_type' => self::$supported_post_type, 116 122 'post_status' => 'publish', … … 118 124 'posts_per_page' => self::$posts_per_page, 119 125 ) ); 120 $ids = $q->posts;126 $ids = $q->posts; 121 127 $success = 0; 122 foreach ( $ids as $id ) {128 foreach ( $ids as $id ) { 123 129 $ret = self::update_post_from_markdown_source( $id ); 124 130 if ( class_exists( 'WP_CLI' ) ) { … … 155 161 $response = self::update_post_from_markdown_source( $post_id ); 156 162 if ( is_wp_error( $response ) ) { 163 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 157 164 wp_die( $response->get_error_message() ); 158 165 } … … 164 171 /** 165 172 * Add an input field for specifying Markdown source 166 173 */ 167 174 public static function action_edit_form_after_title( $post ) { 168 175 if ( $post->post_type !== self::$supported_post_type ) { … … 177 184 placeholder="Enter a URL representing a markdown file to import" 178 185 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 ?> 186 194 <a class="button button-small button-primary" href="<?php echo esc_url( $update_link ); ?>">Import</a> 187 195 <?php endif; ?> … … 218 226 $schedules['15_minutes'] = array( 219 227 'interval' => 15 * MINUTE_IN_SECONDS, 220 'display' => '15 minutes' 228 'display' => '15 minutes', 221 229 ); 222 230 return $schedules; … … 238 246 //$markdown_source = preg_replace( '#https?://github\.com/([^/]+/[^/]+)/blob/(.+)#', 'https://raw.githubusercontent.com/$1/$2', $markdown_source ); 239 247 $markdown_source = add_query_arg( 'v', time(), $markdown_source ); 240 $response = wp_remote_get( $markdown_source );248 $response = wp_remote_get( $markdown_source ); 241 249 if ( is_wp_error( $response ) ) { 242 250 return $response; … … 251 259 $title = null; 252 260 if ( preg_match( '/^#\s(.+)/', $markdown, $matches ) ) { 253 $title = $matches[1];261 $title = $matches[1]; 254 262 $markdown = preg_replace( '/^#\s(.+)/', '', $markdown ); 255 263 } … … 257 265 // Transform to HTML and save the post 258 266 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 ); 262 270 263 271 $post_data = array( … … 293 301 public static function replace_markdown_checkboxes( $html ) { 294 302 $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="">'; 296 304 297 305 // We need to allow inputs with all of our attributes for wp_filter_post_kses(). 298 306 global $allowedposttags; 299 307 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 ); 307 316 308 317 $html = preg_replace( '/\[ \]/', $empty_check_markup, $html ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-shortcodes.php
r10130 r10169 3 3 namespace WPOrg_Learn; 4 4 5 class Shortcodes {5 class Shortcodes { 6 6 7 7 private static $auth_token; … … 23 23 } 24 24 $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( 28 28 'per_page' => 100, 29 29 'labels' => $filter_label, 30 30 'filter' => 'all', 31 31 ) ), $url ); 32 $issues = self::github_request( $url );32 $issues = self::github_request( $url ); 33 33 if ( is_wp_error( $issues ) ) { 34 34 $out .= '<p>' . esc_html( $issues->get_error_message() ) . '</p>' . PHP_EOL; … … 60 60 $out .= '<li><a href="' . esc_url( $issue->html_url ) . '">' . esc_html( $issue->title ) . '</a><br />' . PHP_EOL; 61 61 if ( ! empty( $issue->labels ) ) { 62 foreach ( $issue->labels as $label ) {62 foreach ( $issue->labels as $label ) { 63 63 if ( $label->name === $filter_label ) { 64 64 continue; 65 65 } 66 $text_color = '#FFF';66 $text_color = '#FFF'; 67 67 $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 ) ); 71 71 // Light background means dark color 72 72 if ( ( ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000 ) > 135 ) { … … 93 93 } 94 94 95 $out = '<h2>Repositories</h2>';95 $out = '<h2>Repositories</h2>'; 96 96 $repos = self::github_request( 'https://api.github.com/orgs/wptrainingteam/repos?per_page=100' ); 97 97 if ( is_wp_error( $repos ) ) { … … 100 100 } 101 101 $repo_list = array(); 102 foreach ( $repos as $repo ) {102 foreach ( $repos as $repo ) { 103 103 if ( ! preg_match( '#^wptrainingteam/.+-command$#', $repo->full_name ) ) { 104 104 continue; … … 116 116 $out .= '</tr>' . PHP_EOL; 117 117 $out .= '</thead>' . PHP_EOL; 118 foreach ( $repo_list as $i => $repo_name ) {118 foreach ( $repo_list as $i => $repo_name ) { 119 119 $out .= '<tr>' . PHP_EOL; 120 120 // Name … … 123 123 $out .= '<td><ul>' . PHP_EOL; 124 124 // 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 ); 127 127 $latest_milestone = '<em>None</em>'; 128 128 if ( is_wp_error( $milestones ) ) { 129 129 $latest_milestone = $milestones->get_error_message(); 130 130 } elseif ( ! empty( $milestones ) ) { 131 $milestones = array_shift( $milestones );131 $milestones = array_shift( $milestones ); 132 132 $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)'; 133 133 } 134 134 $out .= '<li>Active: ' . wp_kses_post( $latest_milestone ) . '</li>'; 135 135 // 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 ); 138 138 $latest_release = '<em>None</em>'; 139 139 if ( is_wp_error( $releases ) ) { 140 140 $latest_release = $releases->get_error_message(); 141 141 } elseif ( ! empty( $releases ) ) { 142 $releases = array_shift( $releases );142 $releases = array_shift( $releases ); 143 143 $latest_release = '<a href="' . esc_url( $releases->html_url ) . '">' . esc_html( $releases->tag_name ) . '</a>'; 144 144 } … … 149 149 if ( 'wp-cli/dist-archive-command' === $repo_name ) { 150 150 $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 ); 152 152 } else { 153 153 $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 ); 155 155 } 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; 157 157 $out .= '</tr>' . PHP_EOL; 158 158 } … … 165 165 */ 166 166 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 ) { 170 170 return $cache_value; 171 171 } … … 175 175 'Accept' => 'application/vnd.github.v3+json', 176 176 'User-Agent' => 'WordPress.org / WP-CLI', 177 ) 177 ), 178 178 ); 179 179 if ( isset( self::$auth_token ) ) { … … 193 193 return $data; 194 194 } 195 196 195 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-workshop.php
r10130 r10169 6 6 /** 7 7 * Register Workshop Post Type 8 */8 */ 9 9 public static function workshop_post_type() { 10 10 $labels = array( … … 37 37 'filter_items_list' => __( 'Filter Workshops list', 'wporg_learn' ), 38 38 ); 39 $args = array(40 'label' 41 'description' 42 'labels' 43 'supports' 44 'taxonomies' 45 'hierarchical' 46 'public' 47 'show_ui' 48 'show_in_menu' 49 'has_archive' 50 'menu_position' 51 'menu_icon' 52 'show_in_admin_bar' 53 'show_in_nav_menus' 54 'can_export' 55 'exclude_from_search' 56 'publicly_queryable' 57 'capability_type' 58 'show_in_rest' => true39 $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, 59 59 60 60 ); … … 64 64 /** 65 65 * Register Workshop Grouping Taxonomy 66 */66 */ 67 67 public static function lesson_workshop_taxonomy() { 68 68 $labels = array( … … 90 90 91 91 $args = array( 92 'labels' 93 'hierarchical' 94 'public' 95 'show_ui' 96 'show_admin_column' 97 'show_in_nav_menus' 98 'show_tagcloud' 99 'show_in_rest' 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, 100 100 ); 101 101 … … 105 105 /** 106 106 * Register Workshop Topics Taxonomy 107 */107 */ 108 108 public static function workshop_topics_taxonomy() { 109 109 $labels = array( … … 131 131 132 132 $args = array( 133 'labels' 134 'hierarchical' 135 'public' 136 'show_ui' 137 'show_admin_column' 138 'show_in_nav_menus' 139 'show_tagcloud' 140 'show_in_rest' 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 141 ); 142 142 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php
r10147 r10169 81 81 function get_workshop_duration( WP_Post $workshop, $format = 'raw' ) { 82 82 $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; 85 85 86 86 switch ( $format ) { … … 92 92 $return = human_time_diff( 0, $interval->d * DAY_IN_SECONDS ); 93 93 } 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; 95 96 96 97 if ( $interval->i > 0 ) { 97 98 $minutes = human_time_diff( 0, $interval->i * MINUTE_IN_SECONDS ); 98 $return = sprintf(99 $return = sprintf( 99 100 // 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' ), 101 102 $hours, 102 103 $minutes … … 148 149 function render_metabox_workshop_details( WP_Post $post ) { 149 150 $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(); 151 152 152 153 require dirname( dirname( __FILE__ ) ) . '/views/metabox-workshop-details.php'; … … 167 168 * Update the post meta values from the meta box fields when the post is saved. 168 169 * 169 * @param int $post_id170 * @param int $post_id 170 171 * @param WP_Post $post 171 172 */ … … 182 183 183 184 $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 ) ); 185 186 delete_post_meta( $post_id, 'presenter_wporg_username' ); 186 foreach ( $usernames as $username ) {187 foreach ( $usernames as $username ) { 187 188 add_post_meta( $post_id, 'presenter_wporg_username', $username ); 188 189 } … … 192 193 193 194 $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 ) ); 195 196 delete_post_meta( $post_id, 'video_caption_language' ); 196 foreach ( $captions as $caption ) {197 foreach ( $captions as $caption ) { 197 198 add_post_meta( $post_id, 'video_caption_language', $caption ); 198 199 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php
r10147 r10169 46 46 ); 47 47 48 $video_template_part = 48 $video_template_part = array( 'core/group', 49 49 array( 'className' => 'workshop-page_video' ), 50 array( array( 'core-embed/wordpress-tv' ) ) 50 array( array( 'core-embed/wordpress-tv' ) ), 51 51 ); 52 52 … … 55 55 array( 56 56 array( 'core/heading', array( 57 'level' => '2',57 'level' => '2', 58 58 'content' => __( 'Learning outcomes', 'wporg-learn' ), 59 ) ), 59 ), 60 ), 60 61 array( 'core/list', array( 61 'ordered' => true 62 ) ), 63 ) 62 'ordered' => true, 63 ), 64 ), 65 ), 64 66 ); 65 67 … … 68 70 array( 69 71 array( 'core/heading', array( 70 'level' => '2',72 'level' => '2', 71 73 'content' => __( 'Comprehension questions', 'wporg-learn' ), 72 ) ), 74 ), 75 ), 73 76 array( 'core/list', array( 74 'ordered' => true 75 ) ), 76 ) 77 'ordered' => true, 78 ), 79 ), 80 ), 77 81 ); 78 82 … … 86 90 'borderRadius' => 5, 87 91 'className' => 'is-style-secondary-full-width', 88 ) ), 92 ), 93 ), 89 94 array( 'core/paragraph', array( 90 95 'className' => 'terms', 91 'content' => sprintf(96 'content' => sprintf( 92 97 __( 'You must agree to our <a href="%s">Code of Conduct</a> in order to participate.', 'wporg-learn' ), 93 98 'https://learn.wordpress.org/code-of-conduct/' 94 ) 95 ) ) 96 ) 99 ), 100 ), 101 ), 102 ), 97 103 ); 98 104 99 105 $args = array( 100 'label' 101 'description' 102 'labels' 103 'supports' 104 'taxonomies' 105 'hierarchical' 106 'public' 107 'show_ui' 108 'show_in_menu' 109 'has_archive' 110 'menu_position' 111 'menu_icon' 112 'show_in_admin_bar' 113 'show_in_nav_menus' 114 'can_export' 115 'exclude_from_search' 116 'publicly_queryable' 117 'capability_type' 118 'show_in_rest' 119 'template_lock' 120 'rewrite' 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( 122 128 array( 'core/group', 123 129 array( 'className' => 'workshop-page_content' ), 124 130 array( 125 131 $video_template_part, 126 array( 'core/columns', array( 132 array( 'core/columns', array(), array( 127 133 array( 'core/column', array( 'width' => 66.66 ), array( 128 134 array( 'core/paragraph', array( 129 135 'placeholder' => __( 'Describe what the workshop is about', 'wporg-learn' ), 130 ) ), 136 ), 137 ), 131 138 $outcome_template_part, 132 139 $comprehension_template_part, 133 ) ), 140 ), 141 ), 134 142 array( 'core/column', array( 'width' => 33.333 ), array( 135 143 $sidebar_template_part, 136 ) ) 137 ) ), 138 ) ), 139 array( 'core/separator', array( ) ), 144 ), 145 ), 146 ), 147 ), 148 ), 149 ), 150 array( 'core/separator', array() ), 140 151 ), 141 152 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php
r10142 r10169 42 42 'public' => true, 43 43 'rewrite' => array( 44 'slug' => 'lesson-plans' 44 'slug' => 'lesson-plans', 45 45 ), 46 46 'show_ui' => true, -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/block-styles/index.js
r10130 r10169 1 2 1 import { registerBlockStyle } from '@wordpress/blocks'; 3 2 import { __ } from '@wordpress/i18n'; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/block-styles/style.scss
r10130 r10169 9 9 text-align: center; 10 10 font-size: 13px; 11 font-weight: bold;11 font-weight: 600; 12 12 padding: 0.9rem; 13 13 margin: 32px 0; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/edit.js
r10130 r10169 29 29 <div className={ className }> 30 30 <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> 32 37 </div> 33 38 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/editor.scss
r10130 r10169 5 5 */ 6 6 7 7 .wp-block-wporg-learn-workshop-details { 8 8 min-height: 150px; 9 9 padding: 16px; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/index.js
r10132 r10169 52 52 * The categories provided by core are `common`, `embed`, `formatting`, `layout` and `widgets`. 53 53 */ 54 54 category: 'widgets', 55 55 56 56 /** -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/style.scss
r10130 r10169 6 6 */ 7 7 8 8 .wp-block-wporg-learn-workshop-details { 9 9 list-style: none; 10 10 margin: 0; … … 16 16 justify-content: space-between; 17 17 padding: 8px 0; 18 border-top: 1px solid # E2E4E7;18 border-top: 1px solid #e2e4e7; 19 19 20 20 &:last-child { 21 border-bottom: 1px solid # E2E4E7;21 border-bottom: 1px solid #e2e4e7; 22 22 } 23 23 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/package.json
r10146 r10169 1 1 { 2 "name": "wporg-learn ",2 "name": "wporg-learn-plugin", 3 3 "version": "1.0.0", 4 "description": " ",4 "description": "Plugin for learn.wordpress.org", 5 5 "author": "WordPress.org", 6 6 "license": "GPL-2.0-or-later", … … 15 15 }, 16 16 "devDependencies": { 17 "@wordpress/scripts": "^12.1.1" 17 "@wordpress/scripts": "12.1.1" 18 }, 19 "stylelint": { 20 "extends": "../../../.stylelintrc" 18 21 } 19 22 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-details.php
r10142 r10169 1 1 <?php 2 /** 3 * Template for Workshop Details metabox 4 */ 5 2 6 /** @var WP_Post $post */ 3 7 /** @var DateInterval $duration_interval */ … … 6 10 7 11 <p> 8 <label><?php _e( 'Duration', 'wporg_learn' ); ?></label><br />12 <label><?php esc_html_e( 'Duration', 'wporg_learn' ); ?></label><br /> 9 13 <label for="workshop-duration-hours"> 10 14 <input … … 16 20 max="23" 17 21 /> 18 <?php _e( 'hours', 'wporg_learn' ); ?>22 <?php esc_html_e( 'hours', 'wporg_learn' ); ?> 19 23 </label> 20 24 <label for="workshop-duration-minutes"> … … 27 31 max="59" 28 32 /> 29 <?php _e( 'minutes', 'wporg_learn' ); ?>33 <?php esc_html_e( 'minutes', 'wporg_learn' ); ?> 30 34 </label> 31 35 <label for="workshop-duration-seconds"> … … 38 42 max="59" 39 43 /> 40 <?php _e( 'seconds', 'wporg_learn' ); ?>44 <?php esc_html_e( 'seconds', 'wporg_learn' ); ?> 41 45 </label> 42 46 </p> … … 44 48 <?php // todo Change this to a select dropdown with locale values. ?> 45 49 <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> 47 51 <input 48 52 id="workshop-video-language" 49 53 name="video-language" 50 54 type="text" 51 value="<?php echo sanitize_text_field( $post->video_language ); ?>"55 value="<?php echo esc_attr( $post->video_language ); ?>" 52 56 /> 53 57 </p> … … 55 59 <?php // todo Change this to a multiselect dropdown with locale values. ?> 56 60 <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> 59 63 <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' ); ?> 61 65 </span> 62 66 </p> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-presenters.php
r10146 r10169 1 1 <?php 2 /** 3 * Template for Presenters metabox 4 */ 5 2 6 /** @var WP_Post $post */ 3 7 /** @var array $presenters */ … … 6 10 <?php // todo Change this to a multiselect dropdown that validates wporg usernames. ?> 7 11 <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> 12 18 <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' ); ?> 14 20 </span> 15 21 </p> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/wporg-learn.php
r10155 r10169 30 30 add_action( 'init', array( 'WPORG_Learn\Lesson_Plan', 'lesson_instruction_type_taxonomy' ) ); 31 31 add_action( 'init', 'WPORG_Learn\Taxonomy\register' ); 32 add_filter( 'the_content', array( 'WPORG_Learn\Lesson_Plan', 'replace_image_links' ) );32 add_filter( 'the_content', array( 'WPORG_Learn\Lesson_Plan', 'replace_image_links' ) ); 33 33 34 34 add_action( 'init', 'WPORG_Learn\Blocks\workshop_details_init' ); … … 73 73 } 74 74 75 if ( $post->post_type == 'workshop') {75 if ( 'workshop' === $post->post_type ) { 76 76 return 35; 77 77 } … … 80 80 } 81 81 82 add_action( 'wp_head', function() {82 add_action( 'wp_head', function() { 83 83 ?> 84 84 <style> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/archive-lesson-plan.php
r10166 r10169 18 18 <?php if ( have_posts() ) : ?> 19 19 <div id="lesson-plans" class="lp-list"> 20 <?php while ( have_posts() ) : the_post(); ?> 20 <?php while ( have_posts() ) : 21 the_post(); ?> 21 22 <?php get_template_part( 'template-parts/content', 'archive' ); ?> 22 23 <?php endwhile; ?> … … 26 27 <?php else : ?> 27 28 <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' ); ?> 29 30 </div> 30 31 <?php endif; ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/base/_select.scss
r10131 r10169 4 4 display: inline-block; 5 5 box-sizing: border-box; 6 padding: 0.5rem 2rem 0.5rem .8rem;6 padding: 0.5rem 2rem 0.5rem 0.8rem; 7 7 width: auto; 8 8 … … 18 18 19 19 background-color: transparent; 20 /* stylelint-disable-next-line function-url-quotes */ 20 21 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'); 21 22 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; 24 25 25 26 &::-ms-expand { … … 28 29 29 30 &: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); 31 32 box-shadow: 0 0 0 3px -moz-mac-focusring; 32 33 color: #222; … … 34 35 } 35 36 36 &option {37 font-weight: normal;37 option { 38 font-weight: 400; 38 39 } 39 40 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_featured-workshop.scss
r10162 r10169 22 22 display: block; 23 23 margin-bottom: $gutter-default / 2; 24 font-weight: bold;24 font-weight: 600; 25 25 text-decoration: underline; 26 26 font-size: $gutter-default * 1.25; … … 36 36 padding-top: 0; 37 37 padding-left: $gutter-default * 2; 38 38 39 39 } 40 40 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_section-heading.scss
r10162 r10169 1 1 .section-heading { 2 &_title, &_link { 2 &_title, 3 &_link { 3 4 margin-bottom: 0; 4 5 } … … 10 11 &_link { 11 12 text-decoration: underline; 12 font-weight: bold;13 font-weight: 600; 13 14 margin-top: $gutter-default !important; // Override button styles 14 15 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_video-grid.scss
r10164 r10169 20 20 display: block; 21 21 margin-top: 8px; 22 font-weight: bold;22 font-weight: 600; 23 23 text-align: center; 24 24 25 25 @media only screen and (min-width: $breakpoint-small) { 26 26 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 51 51 } 52 52 53 ol, ul { 53 ol, 54 ul { 54 55 margin: 0 0 0 18px; 55 56 padding: 0; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_workshop-presenter.scss
r10162 r10169 5 5 /* We want to make sure a long name doesn't overlap the image */ 6 6 > div:first-child { 7 min-width: 7 min-width: $gutter-default * 3.5; 8 8 } 9 9 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/settings/_colors.scss
r10131 r10169 1 1 // Base colors. 2 2 $color__wp-blue: #0073aa; 3 $color__green: # C7E8CA;4 $color__wporg-blue: #1 E8CBE;5 $color__wporg-purple: #826 EB4;3 $color__green: #c7e8ca; 4 $color__wporg-blue: #1e8cbe; 5 $color__wporg-purple: #826eb4; 6 6 7 7 // Base grays. … … 13 13 $color-gray-800: $color-dark-gray; 14 14 $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%); 21 21 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%); 31 31 32 32 $color-error-red: #c92c2c; … … 35 35 // Theme colors 36 36 $color__background-input: $color-gray-light-200; 37 $color__text: #555 D66;;37 $color__text: #555d66; 38 38 $color__text-darker: $color-gray-700; 39 39 $color__text-lighter: $color-gray-300; 40 $color__text-on-dark: # FFFFFF;40 $color__text-on-dark: #fff; 41 41 $color__text-heading: $color-gray-400; 42 42 $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 */ 1 2 $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 3 3 $type__lineheight: 1.5; 4 4 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 20 20 .is-style-wporg-parallelogram { 21 21 .wp-block-column { 22 22 23 @include breakpoint( $breakpoint-tablet ) { 23 24 transform: skew(0); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/utilities/_parallelogram.scss
r10164 r10169 27 27 28 28 .home-page .shapes .parallelogram.lesson-plans { 29 background-color: #00669 B;29 background-color: #00669b; 30 30 right: 16px; 31 31 top: 50px; … … 105 105 transform: skew(15deg); 106 106 } 107 108 107 } 109 108 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/front-page.php
r10166 r10169 14 14 <a class="parallelogram workshop-ideas dashicons-before dashicons-slides" href="/workshops/"> 15 15 <p> 16 <strong><?php _e( 'Workshops', 'wporg-forums' ); ?></strong>16 <strong><?php esc_html_e( 'Workshops', 'wporg-learn' ); ?></strong> 17 17 <?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' ); 19 19 ?> 20 <u><?php _e( 'Browse Workshops' ); ?></u>20 <u><?php esc_html_e( 'Browse Workshops', 'wporg-learn' ); ?></u> 21 21 </p> 22 22 </a> 23 23 <a class="parallelogram lesson-plans dashicons-before dashicons-clipboard" href="/lesson-plans/"> 24 24 <p> 25 <strong><?php _e( 'Lesson Plans', 'wporg-forums' ); ?></strong>25 <strong><?php esc_html_e( 'Lesson Plans', 'wporg-learn' ); ?></strong> 26 26 <?php 27 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' ); 28 28 ?> 29 <u><?php _e( 'See the Lesson Plans' ); ?></u>29 <u><?php esc_html_e( 'See the Lesson Plans', 'wporg-learn' ); ?></u> 30 30 </p> 31 31 </a> … … 37 37 <div class="graphic"><span class="dashicons dashicons-welcome-learn-more"></span></div> 38 38 <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> 42 42 </div> 43 43 </div> … … 52 52 53 53 <?php 54 55 56 57 58 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' ); 59 59 ?> 60 60 </section> 61 61 <hr> 62 62 63 63 <?php get_template_part( 'template-parts/component', 'submit-idea-cta', array( 'icon' => 'lightbulb' ) ); ?> 64 64 … … 73 73 74 74 <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> 76 76 77 77 <p> 78 78 <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' ); ?> 80 80 </span> 81 81 82 82 <br> 83 83 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> 85 85 </p> 86 86 </div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php
r10166 r10169 29 29 */ 30 30 function 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' ) ); 32 32 wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), filemtime( __DIR__ . '/js/navigation.js' ), true ); 33 34 33 } 35 34 add_action( 'wp_enqueue_scripts', 'wporg_learn_scripts' ); … … 51 50 */ 52 51 function wporg_get_tax_slugs_from_workshop() { 53 return wp_get_post_terms( get_the_ID(), 'lesson_group', 52 return wp_get_post_terms( get_the_ID(), 'lesson_group', array( 'fields' => 'slugs' ) ); 54 53 } 55 54 … … 57 56 * Get the lesson plans associated to a taxonomy 58 57 * 59 * @param string $slugs Comma separated list of taxonomy terms 58 * @param string $slugs Comma separated list of taxonomy terms. 60 59 * @package WPBBP 61 60 */ … … 113 112 $cat = wporg_get_filter_category(); 114 113 115 if ( empty( $cat ) ) {114 if ( empty( $cat ) ) { 116 115 return wporg_get_default_cat()->slug; 117 116 } … … 124 123 * Get the values associated to the page/post 125 124 * 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. 128 127 * @return string 129 128 */ 130 function get_taxonomy_values( $id, $tax_slug ) {131 $terms = wp_get_post_terms( $id, $tax_slug, array( 'fields' => 'names' ) 129 function get_taxonomy_values( $id, $tax_slug ) { 130 $terms = wp_get_post_terms( $id, $tax_slug, array( 'fields' => 'names' ) ); 132 131 return implode( ', ', $terms ); 133 132 } … … 137 136 * Returns the taxonomies associated to a lesson or workshop 138 137 * 139 * @param string $id Id of the post 138 * @param string $id Id of the post. 140 139 * @return string 141 140 */ 142 141 function 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 ); 165 164 } 166 165 … … 198 197 */ 199 198 function 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 ); 201 200 } 202 201 … … 206 205 * @return array 207 206 */ 208 function wporg_get_workshops( $options = NULL) {207 function wporg_get_workshops( $options = null ) { 209 208 $args = array( 210 209 'post_type' => 'wporg_workshop', 211 210 ); 212 211 213 if ( ! is_null( $options ) ) {212 if ( ! is_null( $options ) ) { 214 213 $args = array_merge( $args, $options ); 215 214 … … 243 242 } 244 243 245 /** 244 /** 246 245 * 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 */ 251 250 function wporg_get_post_thumbnail( $post, $size = 'post-thumbnail' ) { 252 253 254 255 256 257 258 259 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 13 13 14 14 global $wporg_global_header_options; 15 if ( ! isset( $wporg_global_header_options['in_wrapper'] ) )15 if ( ! isset( $wporg_global_header_options['in_wrapper'] ) ) { 16 16 $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>'; 18 19 wporg_get_global_header(); 19 20 … … 21 22 22 23 <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> 24 25 25 26 <div id="content"> 26 27 <header id="masthead" class="site-header <?php echo is_front_page() ? 'home' : ''; ?>" role="banner"> 27 28 <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> 32 31 33 32 <p class="site-description"> 34 33 <?php 35 34 /* Translators: subhead */ 36 _e('Whether you’re a first-time blogger or seasoned developer, there’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’re a first-time blogger or seasoned developer, there’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' ); 37 36 ?> 38 37 </p> 39 38 40 <form role="search" method="get" class="search-form" action="<?php esc_url( home_url( '/' ) )?>">41 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 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 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> 47 46 48 <?php 49 } elseif ( is_page() ) { 50 ?> 47 <?php elseif ( is_page() ) : ?> 51 48 <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 57 58 59 60 61 62 63 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> 64 61 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 75 73 </div><!-- .site-branding --> 76 74 </header><!-- #masthead --> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/package.json
r10133 r10169 1 1 { 2 "name": "wporg-learn- 2020",2 "name": "wporg-learn-theme", 3 3 "version": "1.0.0", 4 4 "description": "Theme for learn.wordpress.org", … … 12 12 "start": "grunt watch", 13 13 "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" 15 19 }, 16 20 "browserslist": [ … … 19 23 "devDependencies": { 20 24 "@wordpress/browserslist-config": "2.6.0", 25 "@wordpress/scripts": "12.1.1", 21 26 "autoprefixer": "9.6.1", 22 27 "cssnano": "4.1.10", … … 28 33 "node-sass": "4.12.0", 29 34 "pixrem": "5.0.0" 35 }, 36 "stylelint": { 37 "extends": "../../../../.stylelintrc", 38 "ignoreFiles": ["*/vendor/*", "**/*.css", "**/*.css.map"] 30 39 } 31 40 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page-submit-an-idea.php
r10146 r10169 9 9 10 10 <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' ); ?> 12 12 13 13 <?php … … 18 18 <div class="entry-content"> 19 19 <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> 21 21 22 22 <div class="idea-type-lists"> 23 23 <div class="col"> 24 24 <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> 29 27 </div> 30 28 31 29 <div class="col"> 32 30 <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> 37 33 </div> 38 34 </div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page.php
r10131 r10169 14 14 15 15 <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' ); ?> 17 17 18 18 <div id="main-content"> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/search.php
r10131 r10169 11 11 12 12 $search_query = sprintf( 13 14 15 13 /* translators: Search query. */ 14 esc_html__( 'Search Results for: %s', 'wporg-learn' ), 15 get_search_query() 16 16 ); 17 17 … … 19 19 20 20 <main id="main" class="site-main type-page" role="main"> 21 22 23 24 <a href="<?php echo home_url(); ?>" class="bbp-breadcrumb-home">Learn Home</a>25 26 <span class="bbp-breadcrumb-current"><?php echo $search_query; ?></span>27 28 29 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> 30 30 31 31 <?php if ( have_posts() ) : ?> 32 32 33 33 <header class="page-header"> 34 <h1 class="h3"><?php echo $search_query; ?></h1>34 <h1 class="h3"><?php echo esc_html( $search_query ); ?></h1> 35 35 </header><!-- .page-header --> 36 36 … … 39 39 while ( have_posts() ) : 40 40 the_post(); 41 ?>41 ?> 42 42 43 43 <article id="post-<?php the_ID(); ?>" <?php post_class( 'card' ); ?>> … … 59 59 sprintf( 60 60 /* 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' ), 62 62 get_the_title() 63 63 ), … … 69 69 </article><!-- #post-## --> 70 70 71 <?php71 <?php 72 72 // End the loop. 73 73 endwhile; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/searchform.php
r10131 r10169 10 10 ?> 11 11 <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> 13 13 <?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' ); 15 15 ?> 16 16 <input type="search" id="s" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php the_search_query(); ?>" name="s" /> … … 18 18 <input type="hidden" name="intext" value="<?php echo esc_attr( $project->prefixed_title ); ?>" /> 19 19 <?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> 21 21 </form> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single-lesson-plan.php
r10131 r10169 9 9 10 10 <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' ); ?> 12 12 13 13 <div id="main-content"> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single-wporg_workshop.php
r10131 r10169 14 14 the_post(); 15 15 get_template_part( 'template-parts/content', 'workshop-single' ); 16 } ?> 16 } 17 ?> 17 18 </main><!-- #main --> 18 19 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single.php
r10131 r10169 12 12 <div id="main-content"> 13 13 <?php 14 15 14 while ( have_posts() ) : 16 15 the_post(); 17 18 16 get_template_part( 'template-parts/content', 'single' ); 19 17 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 17 17 <div> 18 18 <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> 28 23 </div> 29 24 </div> 30 25 <div> 31 26 <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> 41 31 </div> 42 32 </div> 43 33 <div> 44 34 <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> 54 39 </div> 55 40 </div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-breadcrumbs.php
r10131 r10169 10 10 /** 11 11 * Returns list of workshops based on slug 12 * 12 * 13 13 * @return array|bool 14 14 */ 15 15 function get_workshop_from_slug( $slug ) { 16 17 18 19 20 'numberposts' => 1 21 16 $args = array( 17 'name' => $slug, 18 'post_type' => 'workshop', 19 'post_status' => 'publish', 20 'numberposts' => 1, 21 ); 22 22 23 23 $workshop = get_posts( $args ); 24 24 25 return isset( $workshop[ 0 ] ) ? $workshop[ 0] : false;25 return isset( $workshop[0] ) ? $workshop[0] : false; 26 26 } 27 27 28 28 /** 29 29 * Returns whether we are viewing a lesson from a workshop 30 * 30 * 31 31 * @param string $referer 32 32 * @return bool 33 33 */ 34 34 function lesson_came_from_workshop( $referer ) { 35 35 return wporg_post_type_is_lesson() && strrpos( $referer, 'workshop' ); 36 36 } 37 37 38 $crumbs = [39 [ 40 41 'url' => home_url() 42 ] 43 ];38 $crumbs = array( 39 array( 40 'label' => __( 'Learn Home', 'wporg-learn' ), 41 'url' => home_url(), 42 ), 43 ); 44 44 45 45 $referer = wp_get_referer(); 46 46 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 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 ) ); 50 50 51 if( $workshop ) {52 array_push( $crumbs, [ 53 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 ) ); 56 56 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 } 63 62 } else { 64 63 65 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() ) ); 67 66 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 } 74 73 } 75 74 76 array_push( $crumbs, [77 78 'url' => '' 79 ]);75 array_push( $crumbs, array( 76 'label' => get_the_title(), 77 'url' => '', 78 ) ); 80 79 ?> 81 80 82 81 <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 ); 86 85 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 91 echo '<a href="' . $crumbs[ $x ][ 'url' ] .'" class="bbp-breadcrumb-home">';92 echo $crumbs[ $x ][ 'label' ];93 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 } 95 94 96 if( $x < $crumb_length - 1 ) {97 98 } 99 100 101 95 if ( $x < $crumb_length - 1 ) { 96 echo ' <span class="bbp-breadcrumb-sep">»</span> '; 97 } 98 } 99 ?> 100 </div> 102 101 </div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-directory-nav.php
r10131 r10169 11 11 12 12 <nav id="site-navigation" class="directory-navigation" role="navigation"> 13 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 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> 16 16 </nav> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-featured-workshop.php
r10162 r10169 12 12 13 13 <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> 16 22 <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> 18 24 <div class="row"> 19 25 <div class="col-8"> … … 22 28 <div class="col-4 featured-workshop_content_author"> 23 29 <?php 24 30 $presenters = wporg_get_workshop_presenters(); 25 31 26 32 // 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 ); 31 40 endif; 32 41 ?> … … 34 43 </div> 35 44 </div> 36 <?php endwhile; ?> 45 <?php 46 endwhile; 47 wp_reset_postdata(); 48 ?> 37 49 </div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-lesson-filters.php
r10142 r10169 1 1 <?php 2 2 $terms = get_terms( array( 3 'taxonomy' => 'wporg_lesson_category',3 'taxonomy' => 'wporg_lesson_category', 4 4 'hide_empty' => false, 5 5 ) ); … … 9 9 10 10 <div class="wp-filter"> 11 12 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 16 17 <?php foreach ( $terms as $term) : ?>18 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 22 23 24 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> 25 25 </div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-submit-idea-cta.php
r10166 r10169 13 13 14 14 <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> 17 17 <?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> 20 20 </section> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-taxonomy-item.php
r10131 r10169 11 11 12 12 <li> 13 <span class="dashicons dashicons-<?php echo $detail[ 'icon' ]; ?>"></span>14 <span><?php echo $detail[ 'label']; ?></span>15 16 <span><?php echo $detail[ 'values' ]; ?></span>17 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> 18 18 </li> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-video-grid-item.php
r10161 r10169 12 12 <li class="col-4 video-grid_item"> 13 13 <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 ?> 15 18 <?php the_title(); ?> 16 19 </a> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-video-grid.php
r10131 r10169 10 10 $options = get_query_var( 'video-grid-options' ); 11 11 12 if ( is_array( $options ) ) {12 if ( is_array( $options ) ) { 13 13 $latest_posts = wporg_get_workshops( $options ); 14 14 } else { … … 18 18 ?> 19 19 20 <?php if ( $latest_posts->have_posts() ) 20 <?php if ( $latest_posts->have_posts() ) : ?> 21 21 <ul class="row video-grid"> 22 22 <?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 9 9 10 10 $args = wp_parse_args( $args, array( 'class' => '' ) ); 11 $presenter = $args[ 'presenter'];11 $presenter = $args['presenter']; 12 12 13 13 ?> 14 14 15 15 <?php if ( $presenter ) : ?> 16 <div class="workshop-presenter <?php echo $args['class']; ?> ">16 <div class="workshop-presenter <?php echo esc_attr( $args['class'] ); ?> "> 17 17 <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' ) ); ?> 19 19 </div> 20 20 <div> 21 <div class="workshop-presenter_name"><?php echo esc_html( 21 <div class="workshop-presenter_name"><?php echo esc_html( $presenter->display_name ); ?></div> 22 22 <?php if ( ! empty( $presenter->user_nicename ) ) : ?> 23 23 <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 8 8 */ 9 9 10 $topic_list = [];10 $topic_list = array(); 11 11 12 if ( wporg_post_type_is_workshop() ) {12 if ( wporg_post_type_is_workshop() ) { 13 13 $topics = get_taxonomy_values( get_the_ID(), 'topic' ); 14 14 15 if ( !empty( $topics ) ) {15 if ( ! empty( $topics ) ) { 16 16 $topic_list = explode( ',', $topics ); 17 17 } … … 20 20 ?> 21 21 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' : '' ); ?>"> 24 24 <h2 class="h4"><a href="<?php echo esc_url( get_the_permalink() ); ?>"><?php the_title(); ?></a></h2> 25 25 <div class="lp-body"> 26 26 <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> 32 32 <?php endforeach; ?> 33 33 </ul> … … 35 35 </div> 36 36 <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' ); 43 42 } 43 } 44 44 ?> 45 45 </ul> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-page.php
r10131 r10169 17 17 18 18 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' ), 20 20 'after' => '</div>', 21 21 ) ); … … 29 29 sprintf( 30 30 /* translators: %s: Name of current post */ 31 esc_html__( 'Edit %s', 'wporg- forums' ),31 esc_html__( 'Edit %s', 'wporg-learn' ), 32 32 the_title( '<span class="screen-reader-text">"', '"</span>', false ) 33 33 ), -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-single.php
r10148 r10169 8 8 */ 9 9 10 11 $slides_url = wporg_get_slides_url(); 10 $slides_url = wporg_get_slides_url(); 12 11 $download_url = wporg_get_download_slides_url(); 13 14 12 ?> 15 13 16 14 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 17 15 18 <section> 16 <section> 19 17 <header class="row align-middle between section-heading section-heading--with-space"> 20 18 <h1 class="section-heading_title h2"><?php the_title(); ?></h1> … … 27 25 wp_link_pages( 28 26 array( 29 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wporg- forums' ),27 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wporg-learn' ), 30 28 'after' => '</div>', 31 29 ) … … 36 34 <div class="lp-details"> 37 35 <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' ); 43 40 } 41 } 44 42 ?> 45 43 </ul> … … 47 45 <ul class="lp-links"> 48 46 49 <?php if ( $slides_url ) : ?>47 <?php if ( $slides_url ) : ?> 50 48 <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> 52 50 </li> 53 51 <?php endif; ?> 54 52 55 <?php if ( $download_url ) : ?>53 <?php if ( $download_url ) : ?> 56 54 <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> 58 56 </li> 59 57 <?php endif; ?> 60 58 61 59 <!-- <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> 63 61 </li> --> 64 62 </ul> 65 63 66 64 <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> 71 69 </div> 72 70 </div>
Note: See TracChangeset
for help on using the changeset viewer.