Changeset 11323
- Timestamp:
- 11/11/2021 03:53:36 AM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php
r11279 r11323 276 276 array( 277 277 'post_date' => 'DESC', 278 'ID' => 'ASC',278 'ID' => 'ASC', 279 279 ) 280 280 ); … … 360 360 * grouping, there would be a separate row for each postmeta value for each workshop post. 361 361 */ 362 $clauses['fields'] 362 $clauses['fields'] .= ", 363 363 MAX( IF( pmeta.meta_key = 'video_language' AND pmeta.meta_value LIKE '{$locale_root}%', 1, 0 ) ) AS has_language 364 364 "; 365 $clauses['fields'] 365 $clauses['fields'] .= ", 366 366 MAX( IF( pmeta.meta_key = 'video_caption_language' AND pmeta.meta_value LIKE '{$locale_root}%', 1, 0 ) ) AS has_caption 367 367 "; 368 $clauses['join'] 368 $clauses['join'] .= " INNER JOIN {$wpdb->postmeta} pmeta ON ( {$wpdb->posts}.ID = pmeta.post_id )"; 369 369 // This orderby clause ensures that the workshops are sorted by the values in the calculated columns first. 370 370 $clauses['orderby'] = 'has_language DESC, has_caption DESC, ' . $clauses['orderby']; … … 432 432 $meta_query = array(); 433 433 $tax_query = array(); 434 434 435 $is_filtered = false; 435 436 … … 512 513 */ 513 514 function wporg_get_archive_query( $post_type, array $args = array() ) { 514 $args = wp_parse_args( $args, array( 515 'post_type' => $post_type, 516 'post_status' => 'publish', 517 ) ); 515 $args = wp_parse_args( 516 $args, 517 array( 518 'post_type' => $post_type, 519 'post_status' => 'publish', 520 ) 521 ); 518 522 519 523 return new WP_Query( $args ); … … 528 532 */ 529 533 function wporg_learn_get_card_template_args( $post_id ) { 530 $post = get_post( $post_id );534 $post = get_post( $post_id ); 531 535 $post_type = get_post_type( $post ); 532 536 … … 549 553 550 554 if ( is_user_logged_in() ) { 551 $completed 555 $completed = count( Sensei()->course->get_completed_lesson_ids( $post_id, get_current_user_id() ) ); 552 556 553 557 $args['meta'][] = array( … … 924 928 925 929 /** 930 * Register theme sidebars. 931 */ 932 function wporg_learn_register_sidebars() { 933 // Register lesson plans sidebar. 934 register_sidebar( 935 array( 936 'name' => __( 'Lesson Plans', 'wporg-learn' ), 937 'id' => 'wporg-learn-lesson-plans', 938 'before_widget' => '<div id="%1$s" class="block-widgets %2$s">', 939 'after_widget' => '</div>', 940 'before_title' => '<h4 class="widget-title">', 941 'after_title' => '<h4>', 942 ) 943 ); 944 945 // Register courses sidebar. 946 register_sidebar( 947 array( 948 'name' => __( 'Courses', 'wporg-learn' ), 949 'id' => 'wporg-learn-courses', 950 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 951 'after_widget' => '</aside>', 952 'before_title' => '<h4 class="widget-title">', 953 'after_title' => '</h4>', 954 ) 955 ); 956 957 // Register workshops sidebar. 958 register_sidebar( 959 array( 960 'name' => __( 'Workshops', 'wporg-learn' ), 961 'id' => 'wporg-learn-workshops', 962 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 963 'after_widget' => '</aside>', 964 'before_title' => '<h4 class="widget-title">', 965 'after_title' => '</h4>', 966 ) 967 ); 968 } 969 add_filter( 'widgets_init', 'wporg_learn_register_sidebars', 10 ); 970 971 /** 926 972 * Add fallback image to Jetpack when no featured image exists. 927 973 * … … 934 980 } 935 981 add_action( 'jetpack_open_graph_image_default', 'wporg_learn_return_default_image', 15, 1 ); 982 983 /** 984 * Disable the News XML Sitemap generated by Jetpack 985 */ 986 add_filter( 'jetpack_news_sitemap_generate', '__return_false' ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/single-lesson-plan.php
r10169 r11323 17 17 the_post(); 18 18 19 get_template_part( 'template-parts/content', 'single' );19 get_template_part( 'template-parts/content', 'single', array( 'context' => 'lesson-plan' ) ); 20 20 endwhile; // End of the loop. 21 21 ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-single.php
r11300 r11323 29 29 ?> 30 30 </div> 31 <aside class="lp-sidebar">32 <div class="lp-details">33 <ul>34 <?php35 foreach ( wporg_learn_get_lesson_plan_taxonomy_data( get_the_ID() ) as $detail ) {36 if ( ! empty( $detail['value'] ) ) {37 include locate_template( 'template-parts/component-taxonomy-item.php' );38 }39 }40 ?>41 </ul>42 31 43 <ul class="lp-links"> 44 <?php if ( $post->slides_view_url ) : ?> 45 <li> 46 <a href="<?php echo esc_attr( $post->slides_view_url ); ?>" target="_blank"> 47 <span class="dashicons dashicons-admin-page"></span> 48 <?php esc_html_e( 'View Lesson Plan Slides', 'wporg-learn' ); ?> 49 </a> 50 </li> 51 <?php endif; ?> 52 <?php if ( $post->slides_download_url ) : ?> 53 <li> 54 <a href="<?php echo esc_attr( $post->slides_download_url ); ?>"> 55 <span class="dashicons dashicons-download"></span> 56 <?php esc_html_e( 'Download Lesson Slides', 'wporg-learn' ); ?> 57 </a> 58 </li> 59 <?php endif; ?> 60 <!-- <li> 61 <a href="#" target="_blank"> 62 <span class="dashicons dashicons-admin-post"></span> 63 <?php esc_html_e( 'Print Lesson Plan', 'wporg-learn' ); ?> 64 </a> 65 </li> --> 66 </ul> 67 <div class="lp-print"> 68 <p><a href="#" onclick="window.print();"><?php esc_html_e( 'Print view', 'wporg-learn' ); ?></a></p> 69 </div> 70 <div class="lp-suggestion"> 71 <h2 class="lp-suggestion_title h4"><?php esc_html_e( 'Suggestions', 'wporg-learn' ); ?></h2> 72 <p><?php esc_html_e( 'Found a typo, grammar error,or outdated screenshot?', 'wporg-learn' ); ?></p> 73 <p><?php esc_html_e( 'Used this lesson plan in your event and have some suggestions?', 'wporg-learn' ); ?></p> 74 <a href="https://learn.wordpress.org/report-content-errors/"><?php esc_html_e( 'Let us know!', 'wporg-learn' ); ?></a> 75 </div> 76 </div> 77 </aside> 32 <?php 33 /** 34 * Read in passed context and render sidebar. 35 */ 36 switch ( get_post_type() ) { 37 case 'lesson-plan': 38 get_sidebar( 'lesson-plan' ); 39 break; 40 case 'course': 41 get_sidebar( 'course' ); 42 break; 43 } 44 ?> 78 45 </div> 79 46 </section> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/content-workshop-single.php
r11300 r11323 50 50 </div> 51 51 52 <div class="wp-block-button is-style-secondary-full-width"> 53 <a 54 class="wp-block-button__link" 55 href="https://learn.wordpress.org/social-learning/" 56 style="border-radius:5px" 57 > 58 <?php esc_html_e( 'Join a Social Learning Space', 'wporg-learn' ); ?> 59 </a> 60 </div> 61 62 <p class="terms"> 63 <?php printf( 64 wp_kses_data( __( 'You must agree to our <a href="%s">Code of Conduct</a> in order to participate.', 'wporg-learn' ) ), 65 esc_url( get_permalink( get_page_by_path( 'code-of-conduct' ) ) ) 66 ); ?> 67 </p> 52 <?php get_sidebar( 'workshop' ); ?> 68 53 69 54 </div> <!-- end sidebar column -->
Note: See TracChangeset
for help on using the changeset viewer.