<!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>[13981] sites/trunk/wordpress.org/public_html/wp-content: Learn: Sync with git WordPress/learn@d055511</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/13981">13981</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/13981","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>adamwood</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-08-20 00:45:15 +0000 (Tue, 20 Aug 2024)</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'>Learn: Sync with git WordPress/learn@d055511</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnincpostmetaphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnviewsmetaboxworkshopdetailsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-details.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnwebpackconfigjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/webpack.config.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024incqueryphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024stylecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnbuildlessonarchiveexcludedmetaassetphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.asset.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnbuildlessonarchiveexcludedmetajs">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.js</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-archive-excluded-meta/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnbuildlessonarchiveexcludedmetaassetphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.asset.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/build/lesson-archive-excluded-meta.asset.php 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.asset.php 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'fe14a0882f738a5bdaea');
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnbuildlessonarchiveexcludedmetajs"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.js</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/build/lesson-archive-excluded-meta.js 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.js 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-(()=>{"use strict";const e=window.React,t=window.wp.components,n=window.wp.data,o=window.wp.editPost,d=window.wp.element,i=window.wp.i18n,l=window.wp.plugins,r="excluded";(0,l.registerPlugin)("wporg-learn-lesson-archive-excluded-meta",{render:()=>{const l=(0,n.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")||{})),{editPost:c}=(0,n.useDispatch)("core/editor"),[s,w]=(0,d.useState)(l?._lesson_archive_excluded===r);return(0,e.createElement)(o.PluginDocumentSettingPanel,{title:(0,i.__)("Hidden Lesson (deprecated)","wporg-learn")},(0,e.createElement)(t.PanelRow,null,(0,e.createElement)(t.CheckboxControl,{label:(0,i.__)("Exclude this lesson from the archive","wporg-learn"),checked:s,onChange:e=>{w(e),c({meta:{...l,_lesson_archive_excluded:e?r:""}})}})))}})})()
;
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnincpostmetaphp"></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/post-meta.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/post-meta.php 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,21 +51,6 @@
</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">-
- register_post_meta(
- 'lesson',
- '_lesson_archive_excluded',
- array(
- 'description' => __( 'Whether the lesson should be excluded from archive views.', 'wporg-learn' ),
- 'type' => 'string',
- 'single' => true,
- 'sanitize_callback' => 'sanitize_text_field',
- 'show_in_rest' => true,
- 'auth_callback' => function( $allowed, $meta_key, $post_id ) {
- return current_user_can( 'edit_post', $post_id );
- },
- ),
- );
</del><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">@@ -483,13 +468,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $duration_interval = get_workshop_duration( $post, 'interval' );
</span><span class="cx" style="display: block; padding: 0 10px"> $locales = get_locales_with_english_names();
</span><span class="cx" style="display: block; padding: 0 10px"> $captions = get_post_meta( $post->ID, 'video_caption_language' ) ?: array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $all_lessons = get_posts( array(
- 'post_type' => 'lesson',
- 'post_status' => 'publish',
- 'posts_per_page' => 999,
- 'orderby' => 'title',
- 'order' => 'asc',
- ) );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require get_views_path() . 'metabox-workshop-details.php';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,9 +554,6 @@
</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">- $lesson_id = filter_input( INPUT_POST, 'linked-lesson-id', FILTER_SANITIZE_NUMBER_INT );
- update_post_meta( $post_id, 'linked_lesson_id', $lesson_id );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $presenter_wporg_username = filter_input( INPUT_POST, 'presenter-wporg-username' );
</span><span class="cx" style="display: block; padding: 0 10px"> $presenter_usernames = array_map( 'trim', explode( ',', $presenter_wporg_username ) );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_post_meta( $post_id, 'presenter_wporg_username' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -649,7 +624,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function enqueue_editor_assets() {
</span><span class="cx" style="display: block; padding: 0 10px"> enqueue_expiration_date_assets();
</span><span class="cx" style="display: block; padding: 0 10px"> enqueue_language_meta_assets();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- enqueue_lesson_archive_excluded_meta_assets();
</del><span class="cx" style="display: block; padding: 0 10px"> enqueue_lesson_featured_meta_assets();
</span><span class="cx" style="display: block; padding: 0 10px"> enqueue_duration_meta_assets();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -708,31 +682,6 @@
</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">- * Enqueue scripts for the archive excluded lesson meta block.
- */
-function enqueue_lesson_archive_excluded_meta_assets() {
- global $typenow;
-
- if ( 'lesson' === $typenow ) {
- $script_asset_path = get_build_path() . 'lesson-archive-excluded-meta.asset.php';
- if ( ! file_exists( $script_asset_path ) ) {
- wp_die( 'You need to run `yarn start` or `yarn build` to build the required assets.' );
- }
-
- $script_asset = require( $script_asset_path );
- wp_enqueue_script(
- 'wporg-learn-lesson-archive-excluded-meta',
- get_build_url() . 'lesson-archive-excluded-meta.js',
- $script_asset['dependencies'],
- $script_asset['version'],
- true
- );
-
- wp_set_script_translations( 'wporg-learn-lesson-archive-excluded-meta', 'wporg-learn' );
- }
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Enqueue scripts for the featured lesson meta block.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function enqueue_lesson_featured_meta_assets() {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnviewsmetaboxworkshopdetailsphp"></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/metabox-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/metabox-workshop-details.php 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/metabox-workshop-details.php 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,8 +7,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var DateInterval $duration_interval */
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var array $locales */
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var array $captions */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/** @var array $all_lessons */
-/** @var array $selected_lessons */
</del><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"> <p>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,20 +74,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </select>
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p>
- <label for="workshop-linked-lesson-id"><?php esc_html_e( 'Linked Quiz', 'wporg_learn' ); ?></label>
- <select id="workshop-linked-lesson-id" name="linked-lesson-id" style="width: 100%;">
- <option value="" disabled hidden <?php selected( ! $post->linked_lesson_id ); ?>></option>
- <?php foreach ( $all_lessons as $lesson ) : ?>
- <option value="<?php echo esc_attr( $lesson->ID ); ?>" <?php selected( $lesson->ID, $post->linked_lesson_id ); ?>>
- <?php echo esc_html( get_the_title( $lesson->ID ) ); ?>
- </option>
- <?php endforeach; ?>
- </select>
-</p>
-
</del><span class="cx" style="display: block; padding: 0 10px"> <script>
</span><span class="cx" style="display: block; padding: 0 10px"> ( function( $ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '#workshop-video-language, #workshop-video-caption-language, #workshop-linked-lesson-id' ).select2();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '#workshop-video-language, #workshop-video-caption-language' ).select2();
</ins><span class="cx" style="display: block; padding: 0 10px"> } )( jQuery );
</span><span class="cx" style="display: block; padding: 0 10px"> </script>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnwebpackconfigjs"></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/webpack.config.js</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/webpack.config.js 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/webpack.config.js 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'course-status': './js/course-status/src/index.js',
</span><span class="cx" style="display: block; padding: 0 10px"> 'duration-meta': './js/duration-meta/index.js',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expiration-date': './js/expiration-date/index.js',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'lesson-archive-excluded-meta': './js/lesson-archive-excluded-meta/index.js',
</del><span class="cx" style="display: block; padding: 0 10px"> 'lesson-count': './js/lesson-count/src/index.js',
</span><span class="cx" style="display: block; padding: 0 10px"> 'lesson-featured-meta': './js/lesson-featured-meta/index.js',
</span><span class="cx" style="display: block; padding: 0 10px"> 'workshop-application-form': './js/workshop-application-form/src/index.js',
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024incqueryphp"></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-2024/inc/query.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-2024/inc/query.php 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,7 +6,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> namespace WordPressdotorg\Theme\Learn_2024\Query;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', __NAMESPACE__ . '\add_language_to_archive_queries' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'pre_get_posts', __NAMESPACE__ . '\add_excluded_to_lesson_archive_query' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'pre_get_posts', __NAMESPACE__ . '\filter_hidden_lessons_from_archive_and_search' );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', __NAMESPACE__ . '\filter_search_queries_by_post_type' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'request', __NAMESPACE__ . '\handle_all_level_query' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'jetpack_search_es_wp_query_args', __NAMESPACE__ . '\filter_jetpack_wp_search_query', 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,40 +46,15 @@
</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">- * Modify the query by adding meta query for excluding the lesson from the archive if set.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Modify lessons archive and search queries by adding a taxonomy query for filtering out hidden lessons.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Query $query The query object.
</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 add_excluded_to_lesson_archive_query( $query ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function filter_hidden_lessons_from_archive_and_search( $query ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Ensure this code runs only for the main query on lesson archive pages and search results.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_admin() && $query->is_main_query() && ( $query->is_archive( 'lesson' ) || $query->is_search() ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $meta_query = $query->get( 'meta_query', array() );
</del><span class="cx" style="display: block; padding: 0 10px"> $tax_query = $query->get( 'tax_query', 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">- $exclude_lessons_by_post_meta = array(
- 'relation' => 'OR',
- array(
- 'key' => '_lesson_archive_excluded',
- 'compare' => 'NOT EXISTS',
- ),
- array(
- 'key' => '_lesson_archive_excluded',
- 'value' => 'excluded',
- 'compare' => '!=',
- ),
- );
-
- // If there's an existing meta query, wrap both in an AND relation
- if ( ! empty( $meta_query ) ) {
- $meta_query = array(
- 'relation' => 'AND',
- $meta_query,
- $exclude_lessons_by_post_meta,
- );
- } else {
- $meta_query = $exclude_lessons_by_post_meta;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $exclude_lessons_by_taxonomy = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'taxonomy' => 'show',
</span><span class="cx" style="display: block; padding: 0 10px"> 'field' => 'slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +70,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tax_query = array( $exclude_lessons_by_taxonomy );
</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">- $query->set( 'meta_query', $meta_query );
</del><span class="cx" style="display: block; padding: 0 10px"> $query->set( 'tax_query', $tax_query );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglearn2024stylecss"></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-2024/style.css</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-2024/style.css 2024-08-19 22:26:56 UTC (rev 13980)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css 2024-08-20 00:45:15 UTC (rev 13981)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Author: WordPress.org
</span><span class="cx" style="display: block; padding: 0 10px"> * Author URI: http://wordpress.org/
</span><span class="cx" style="display: block; padding: 0 10px"> * Description: A theme for learn.wordpress.org, built in 2024.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Version: 1.0.0-fdd9e55
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Version: 1.0.0-3128a62
</ins><span class="cx" style="display: block; padding: 0 10px"> * License: GNU General Public License v2 or later
</span><span class="cx" style="display: block; padding: 0 10px"> * License URI: http://www.gnu.org/licenses/gpl-2.0.html
</span><span class="cx" style="display: block; padding: 0 10px"> * Text Domain: wporg-learn
</span></span></pre>
</div>
</div>
</body>
</html>