<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[11352] sites/trunk/wordpress.org/public_html/wp-content: WordPress.org Learn: sync with GitHub</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/11352">11352</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/11352","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>tellyworth</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-12-02 00:59:04 +0000 (Thu, 02 Dec 2021)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordPress.org Learn: sync with GitHub
Props hlashbrooke.
https://github.com/WordPress/learn/compare/fa76b2cdf5c9b979585f3142d62949ae4c0ca91d...4b476da0d46f52c39505379eeb202561bf0d37db</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnincblocksphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnviewsblockworkshopdetailsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-workshop-details.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020functionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020headerphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020pagephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020sidebarlessonplanphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/sidebar-lesson-plan.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020templatepartscomponenttaxonomyitemphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-taxonomy-item.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnincblocksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,29 +71,53 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string HTML output used by the block
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function workshop_details_render_callback( $attributes, $content ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post();
- $topics = wp_get_post_terms( $post->ID, 'topic', array( 'fields' => 'names' ) );
- $level = wp_get_post_terms( $post->ID, 'level', array( 'fields' => 'names' ) );
- $captions = get_post_meta( $post->ID, 'video_caption_language' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post();
+ $topic_ids = wp_get_post_terms( $post->ID, 'topic', array( 'fields' => 'ids' ) );
+ $level = wp_get_post_terms( $post->ID, 'level', array( 'fields' => 'names' ) );
+ $captions = get_post_meta( $post->ID, 'video_caption_language' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $topic_names = array();
+ foreach ( $topic_ids as $id ) {
+ $topic_names[] = get_term( $id )->name;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $fields = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Length', 'wporg-learn' ) => get_workshop_duration( $post, 'string' ),
- __( 'Topic', 'wporg-learn' ) => implode( ', ', array_map( 'esc_html', $topics ) ),
- __( 'Level', 'wporg-learn' ) => implode( ', ', array_map( 'esc_html', $level ) ),
- __( 'Language', 'wporg-learn' ) => esc_html( get_locale_name_from_code( $post->video_language, 'native' ) ),
- __( 'Subtitles', 'wporg-learn' ) => implode(
- ', ',
- array_map(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'length' => array(
+ 'label' => __( 'Length', 'wporg-learn' ),
+ 'param' => array(),
+ 'value' => array( get_workshop_duration( $post, 'string' ) ),
+ ),
+ 'topic' => array(
+ 'label' => __( 'Topic', 'wporg-learn' ),
+ 'param' => $topic_ids,
+ 'value' => $topic_names,
+ ),
+ 'level' => array(
+ 'label' => __( 'Level', 'wporg-learn' ),
+ 'param' => array(),
+ 'value' => $level,
+ ),
+ 'language' => array(
+ 'label' => __( 'Language', 'wporg-learn' ),
+ 'param' => array( $post->video_language ),
+ 'value' => array( esc_html( get_locale_name_from_code( $post->video_language, 'native' ) ) ),
+ ),
+ 'captions' => array(
+ 'label' => __( 'Subtitles', 'wporg-learn' ),
+ 'param' => $captions,
+ 'value' => array_map(
</ins><span class="cx" style="display: block; padding: 0 10px"> function( $caption_lang ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return esc_html( get_locale_name_from_code( $caption_lang, 'native' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> $captions
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Remove empty fields.
- $fields = array_filter( $fields );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Remove fields with empty values.
+ $fields = array_filter( $fields, function( $data ) {
+ return $data['value'];
+ } );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $lesson_id = get_post_meta( $post->ID, 'linked_lesson_id', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $quiz_url = '';
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnviewsblockworkshopdetailsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-workshop-details.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-workshop-details.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-workshop-details.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,10 +17,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wp-block-wporg-learn-workshop-details">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( ! empty( $fields ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="workshop-details-list">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php foreach ( $fields as $key => $value ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php foreach ( $fields as $key => $field ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <li>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <b><?php echo esc_html( $key ); ?></b>
- <span><?php echo esc_html( $value ); ?></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <b><?php echo esc_html( $field['label'] ); ?></b>
+ <span>
+ <?php
+ $i = 0;
+ foreach ( $field['value'] as $field_key => $value ) {
+ $url = '';
+ if ( ! empty( $field['param'] ) ) {
+ $url = trailingslashit( site_url() ) . 'workshops/?' . $key . '=' . $field['param'][ $field_key ];
+ }
+
+ if ( 0 < $i ) {
+ echo ', ';
+ }
+
+ if ( $url ) {
+ echo '<a href="' . esc_url( $url ) . '">' . esc_html( $value ) . '</a>';
+ } else {
+ echo esc_html( $value );
+ }
+ $i++;
+ }
+ ?>
+ </span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020functionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Get the values associated to the page/post
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Get the values associated to the page/post formatted as a string
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $post_id Id of the post.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tax_slug The slug for the custom taxonomy.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,6 +179,45 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Get the values associated to the page/post formatted as an array
+ *
+ * @param string $post_id Id of the post.
+ * @param string $tax_slug The slug for the custom taxonomy.
+ *
+ * @return array
+ */
+function wporg_learn_get_taxonomy_terms_array( $post_id, $tax_slug ) {
+ $term_ids = wp_get_post_terms( $post_id, $tax_slug, array( 'fields' => 'ids' ) );
+
+ $terms = array();
+ foreach ( $term_ids as $id ) {
+ $terms[ $id ] = get_term( $id )->name;
+ }
+
+ return $terms;
+}
+
+/**
+ * Get the values associated to the page/post according to the context
+ *
+ * @param int $post_id ID of the post.
+ * @param string $tax_slug The slug for the custom taxonomy.
+ * @param string $context The context for display.
+ *
+ * @return array|string
+ */
+function wporg_learn_get_taxonomy_terms( $post_id, $tax_slug, $context ) {
+ switch ( $context ) {
+ case 'archive':
+ return wporg_learn_get_taxonomy_terms_string( $post_id, $tax_slug );
+ break;
+ case 'single':
+ return wporg_learn_get_taxonomy_terms_array( $post_id, $tax_slug );
+ break;
+ }
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Returns the taxonomies associated to a lesson or workshop
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Id of the post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,27 +224,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wporg_learn_get_lesson_plan_taxonomy_data( $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wporg_learn_get_lesson_plan_taxonomy_data( $post_id, $context ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'icon' => 'clock',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'slug' => 'duration',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'label' => wporg_label_with_colon( get_taxonomy_labels( get_taxonomy( 'duration' ) )->singular_name ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'value' => wporg_learn_get_taxonomy_terms_string( $post_id, 'duration' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'value' => wporg_learn_get_taxonomy_terms( $post_id, 'duration', $context ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'icon' => 'admin-users',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'slug' => 'audience',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'label' => wporg_label_with_colon( get_taxonomy_labels( get_taxonomy( 'audience' ) )->singular_name ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'value' => wporg_learn_get_taxonomy_terms_string( $post_id, 'audience' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'value' => wporg_learn_get_taxonomy_terms( $post_id, 'audience', $context ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'icon' => 'dashboard',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'slug' => 'level',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'label' => wporg_label_with_colon( get_taxonomy_labels( get_taxonomy( 'level' ) )->singular_name ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'value' => wporg_learn_get_taxonomy_terms_string( $post_id, 'level' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'value' => wporg_learn_get_taxonomy_terms( $post_id, 'level', $context ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'icon' => 'welcome-learn-more',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'slug' => 'type',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'label' => wporg_label_with_colon( get_taxonomy_labels( get_taxonomy( 'instruction_type' ) )->singular_name ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'value' => wporg_learn_get_taxonomy_terms_string( $post_id, 'instruction_type' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'value' => wporg_learn_get_taxonomy_terms( $post_id, 'instruction_type', $context ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,9 +343,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Omit some post types from search results.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $query->is_main_query() && $query->is_search() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $public_post_types = array_keys( get_post_types( array( 'public' => true ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $omit_from_search = array( 'attachment', 'lesson', 'quiz', 'sensei_message', 'meeting' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $omit_from_search = array( 'attachment', 'page', 'lesson', 'quiz', 'sensei_message', 'meeting' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $searchable_post_types = array_diff( $public_post_types, $omit_from_search );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Only show featured courses, but don't limit other post types
+ $query->set(
+ 'meta_query',
+ array(
+ 'relation' => 'OR',
+ array(
+ 'key' => '_course_featured',
+ 'value' => 'featured',
+ ),
+ array(
+ 'key' => '_course_featured',
+ 'compare' => 'NOT EXISTS',
+ ),
+ )
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $query->set( 'post_type', $searchable_post_types );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -563,7 +622,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'lesson-plan':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $args['meta'] = wporg_learn_get_lesson_plan_taxonomy_data( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $args['meta'] = wporg_learn_get_lesson_plan_taxonomy_data( $post_id, 'archive' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wporg_workshop':
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020headerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,8 +49,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="search-form--is-inline search-form--is-constrained search-form--is-centered">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php get_search_form(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php elseif ( is_page() ) : ?>
- <h1 class="site-title"><a href="<?php echo esc_url( get_the_permalink() ); ?>" rel="home"><?php the_title(); ?></a></h1>
</del><span class="cx" style="display: block; padding: 0 10px"> <?php else : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="site-title">
</span><span class="cx" style="display: block; padding: 0 10px"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020pagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/page.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,6 +20,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <main id="main" class="site-main" role="main">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php get_template_part( 'template-parts/component', 'breadcrumbs' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="row align-middle between section-heading section-heading--with-space">
+ <?php the_title( '<h1 class="section-heading_title h2">', '</h1>' ); ?>
+ </div>
+ <hr>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <div id="main-content">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> while ( have_posts() ) :
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020sidebarlessonplanphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/sidebar-lesson-plan.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/sidebar-lesson-plan.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/sidebar-lesson-plan.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="lp-details">
</span><span class="cx" style="display: block; padding: 0 10px"> <ul>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( wporg_learn_get_lesson_plan_taxonomy_data( get_the_ID() ) as $detail ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( wporg_learn_get_lesson_plan_taxonomy_data( get_the_ID(), 'single' ) as $detail ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $detail['value'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> include locate_template( 'template-parts/component-taxonomy-item.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2020templatepartscomponenttaxonomyitemphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-taxonomy-item.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-taxonomy-item.php 2021-12-01 22:48:34 UTC (rev 11351)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-taxonomy-item.php 2021-12-02 00:59:04 UTC (rev 11352)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,6 +13,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="dashicons dashicons-<?php echo esc_attr( $detail['icon'] ); ?>"></span>
</span><span class="cx" style="display: block; padding: 0 10px"> <span><?php echo esc_html( $detail['label'] ); ?></span>
</span><span class="cx" style="display: block; padding: 0 10px"> <strong>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span><?php echo esc_html( $detail['value'] ); ?></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span>
+ <?php //echo esc_html( $detail['value'] ); ?>
+
+ <?php
+ $i = 0;
+ foreach ( $detail['value'] as $key => $value ) {
+ $url = trailingslashit( site_url() ) . 'lesson-plans/?' . $detail['slug'] . '[]=' . $key;
+
+ if ( 0 < $i ) {
+ echo ', ';
+ }
+
+ echo '<a href="' . esc_attr( $url ) . '">' . esc_html( $value ) . '</a>';
+ $i++;
+ }
+ ?>
+ </span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </strong>
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span></span></pre>
</div>
</div>
</body>
</html>