Changeset 10147
- Timestamp:
- 08/12/2020 01:23:13 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php
r10142 r10147 55 55 } 56 56 57 58 59 /** 60 * Build the html output based on input fields 61 * 62 * @param array $fields 63 * @return string HTML output. 64 */ 65 function get_workshop_details_html_output( $fields ) { 66 $output = '<ul class="wp-block-wporg-learn-workshop-details">'; 67 68 foreach( $fields as $key => $value ) { 69 $output .= sprintf( '<li><b>%1$s</b><span>%2$s</span></li>', $key, $value ); 70 } 71 72 $output .= '</ul>'; 73 74 return $output; 75 } 76 57 77 /** 58 78 * Render the block content (html) on the frontend of the site. … … 60 80 * @param array $attributes 61 81 * @param string $content 62 * @return string HTML output used by the calendar JS.82 * @return string HTML output used by the block 63 83 */ 64 84 function workshop_details_render_callback( $attributes, $content ) { … … 68 88 $captions = get_post_meta( $post->ID, 'video_caption_language' ); 69 89 70 return sprintf( 71 '<ul class="wp-block-wporg-learn-workshop-details"> 72 <li><b>Length</b><span>%1$s</span></li> 73 <li><b>Topic</b><span>%2$s</span></li> 74 <li><b>Level</b><span>%3$s</span></li> 75 <li><b>Language</b><span>%4$s</span></li> 76 <li><b>Captions</b><span>%5$s</span></li> 77 </ul>', 78 get_workshop_duration( $post, 'string' ), 79 implode( ', ', array_map( 'esc_html', $topics ) ), 80 implode( ', ', array_map( 'esc_html', $level ) ), 81 esc_html( $post->video_language ), 82 implode( ', ', array_map( 'esc_html', $captions ) ) 83 ); 90 $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 ) ), 96 ); 97 98 // Remove empty fields 99 $fields_to_output = array_filter( $fields ); 100 101 return get_workshop_details_html_output( $fields_to_output ); 84 102 } 85 103 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/class-markdown-import.php
r10130 r10147 13 13 private static $nonce_name = 'wporg-learn-markdown-source-nonce'; 14 14 private static $submit_name = 'wporg-learn-markdown-import'; 15 private static $supported_post_type s= 'lesson-plan';15 private static $supported_post_type = 'lesson-plan'; 16 16 private static $posts_per_page = 100; 17 17 … … 41 41 // Fetch all lesson plan posts for comparison 42 42 $q = new WP_Query( array( 43 'post_type' => self::$supported_post_type s,43 'post_type' => self::$supported_post_type, 44 44 'post_status' => 'publish', 45 45 'posts_per_page' => self::$posts_per_page, … … 94 94 private static function create_post_from_manifest_doc( $doc, $post_parent = null ) { 95 95 $post_data = array( 96 'post_type' => self::$supported_post_type s,96 'post_type' => self::$supported_post_type, 97 97 'post_status' => 'publish', 98 98 'post_parent' => $post_parent, … … 113 113 public static function action_wporg_learn_markdown_import() { 114 114 $q = new WP_Query( array( 115 'post_type' => self::$supported_post_type s,115 'post_type' => self::$supported_post_type, 116 116 'post_status' => 'publish', 117 117 'fields' => 'ids', … … 149 149 if ( ! current_user_can( 'edit_post', $post_id ) 150 150 || ! wp_verify_nonce( $_GET[ self::$nonce_name ], self::$input_name ) 151 || ! in_array( get_post_type( $post_id ), self::$supported_post_types, true )) {151 || get_post_type( $post_id ) !== self::$supported_post_type ) { 152 152 return; 153 153 } … … 166 166 */ 167 167 public static function action_edit_form_after_title( $post ) { 168 if ( ! in_array( $post->post_type, self::$supported_post_types, true )) {168 if ( $post->post_type !== self::$supported_post_type ) { 169 169 return; 170 170 } … … 197 197 if ( ! isset( $_POST[ self::$input_name ] ) 198 198 || ! isset( $_POST[ self::$nonce_name ] ) 199 || ! in_array( get_post_type( $post_id ), self::$supported_post_types, true )) {199 || get_post_type( $post_id ) !== self::$supported_post_type ) { 200 200 return; 201 201 } … … 286 286 /** 287 287 * Replace markdown checkboxes in the post-processed HTML. 288 * 288 * 289 289 * @param string $html The HTML after translation from markup. 290 * 290 * 291 291 * @return string The HTML after potentially replacing markdown checkboxes with HTML ones. 292 292 */ -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php
r10146 r10147 89 89 break; 90 90 case 'string': 91 $return = human_readable_duration( $interval->format( '%H:%I:%S' ) ); 91 if ( $interval->d > 0 ) { 92 $return = human_time_diff( 0, $interval->d * DAY_IN_SECONDS ); 93 } elseif ( $interval->h > 0 ) { 94 $return = $hours = human_time_diff( 0, $interval->h * HOUR_IN_SECONDS ); 95 96 if ( $interval->i > 0 ) { 97 $minutes = human_time_diff( 0, $interval->i * MINUTE_IN_SECONDS ); 98 $return = sprintf( 99 // 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 $hours, 102 $minutes 103 ); 104 } 105 } elseif ( $interval->i > 0 ) { 106 $return = human_time_diff( 0, $interval->i * MINUTE_IN_SECONDS ); 107 } elseif ( $interval->s > 0 ) { 108 $return = human_time_diff( 0, $interval->s ); 109 } 92 110 break; 93 111 case 'raw': -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php
r10142 r10147 83 83 array( 'core/button', array( 84 84 'text' => __( 'Join a Group Discussion', 'wporg-learn' ), 85 'url' => 'https://w ordpress.org',85 'url' => 'https://www.meetup.com/learn-wordpress-discussions/events/', 86 86 'borderRadius' => 5, 87 87 'className' => 'is-style-secondary-full-width', -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/front-page.php
r10146 r10147 60 60 </section> 61 61 <hr> 62 63 <section class="lesson-lists clearfix"> 64 <div class="col"> 65 <h2 class="screen-reader-text"><?php _e( 'Lesson Plans' ); ?></h2> 66 <div class="lesson-item"> 67 <h3 class="h4 title"><?php _e( 'User-oriented Lesson Plans' ); ?></h3> 68 <p><?php _e( 'User lessons are targeted towards end-users, those who actually publish content.' ); ?></p> 69 <a class="viewmore" href="#"><?php _e( 'View the lesson plans' ); ?></a> 70 </div> 71 <div class="lesson-item"> 72 <h3 class="h4 title"><?php _e( 'Theme-oriented Lesson Plans' ); ?></h3> 73 <p><?php _e( 'Theme lessons are targeted towards entry-level developers, those who actually write code.' ); ?></p> 74 <a class="viewmore" href="#"><?php _e( 'View the lesson plans' ); ?></a> 75 </div> 76 <div class="lesson-item"> 77 <h3 class="h4 title"><?php _e( 'Plugin-oriented Lesson Plans' ); ?></h3> 78 <p><?php _e( 'Plugin lessons are targeted towards entry-level developers, those who actually write code.' ); ?></p> 79 <a class="viewmore" href="#"><?php _e( 'View the lesson plans' ); ?></a> 80 </div> 81 </div> 82 83 <div class="col"> 84 <h2 class="screen-reader-text"><?php _e( 'Workshop Ideas' ); ?></h2> 85 <div class="lesson-item"> 86 <h3 class="h4 title"><?php _e( 'Half-day Workshop Ideas' ); ?></h3> 87 <p><?php _e( 'Concepts and activities for workshops that are only a few hours long.' ); ?></p> 88 <a class="viewmore" href="#"><?php _e( 'View the Workshop Ideas' ); ?></a> 89 </div> 90 <div class="lesson-item"> 91 <h3 class="h4 title"><?php _e( 'Full-day Workshop Ideas' ); ?></h3> 92 <p><?php _e( 'Concepts and activities for workshops that fill the whole day.' ); ?></p> 93 <a class="viewmore" href="#"><?php _e( 'View the Workshop Ideas' ); ?></a> 94 </div> 95 <div class="lesson-item"> 96 <h3 class="h4 title"><?php _e( 'Multi-day Workshop Ideas' ); ?></h3> 97 <p><?php _e( 'Concepts and activities for workshops that span the course of 2 or more days.' ); ?></p> 98 <a class="viewmore" href="#"><?php _e( 'View the Workshop Ideas' ); ?></a> 99 </div> 100 </div> 101 102 <div class="col"> 103 <div class="lesson-item"> 104 <h2 class="h4 title"><?php _e( 'Want to Help More People Speak at Meetups and WordCamps?' ); ?></h2> 105 <p><?php _e( 'WordPress is a built on a community where diversity and inclusion are key to growth. Meetups and WordCamps are the best way to teach others about WordPress on a local level and these resources can help diversify the speakers at these events.' ); ?></p> 106 <a class="viewmore" href="#"><?php _e( 'View the Speaker Diversity Lesson plans' ); ?></a> 107 </div> 108 <div class="lesson-item"> 109 <h2 class="h4 title"><?php _e( 'Helpful Links' ); ?></h2> 110 <a class="viewmore" href="#"><?php _e( 'WordCamp Central' ); ?></a> <br /> 111 <a class="viewmore" href="#"><?php _e( 'WordPress Meetups' ); ?></a> 112 </div> 113 </div> 114 </section> 115 116 <hr> 117 62 118 63 <?php wporg_submit_idea_cta(); ?> 119 64 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php
r10146 r10147 25 25 wporg_get_global_header(); 26 26 27 if ( is_front_page() ) {28 $home_page = 'home ';29 }30 27 ?> 31 28 32 <div id="page" class=" <?php echo esc_html( $home_page ); ?>site">29 <div id="page" class="site"> 33 30 <a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Skip to content', 'wporg-forums' ); ?></a> 34 31
Note: See TracChangeset
for help on using the changeset viewer.