Making WordPress.org

Changeset 13944


Ignore:
Timestamp:
08/02/2024 12:26:40 AM (16 months ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@36bd656

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024
Files:
8 added
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/functions.php

    r13940 r13944  
    1414require_once __DIR__ . '/src/learning-pathway-header/index.php';
    1515require_once __DIR__ . '/src/lesson-grid/index.php';
     16require_once __DIR__ . '/src/lesson-standalone/index.php';
    1617require_once __DIR__ . '/src/search-results-context/index.php';
    1718require_once __DIR__ . '/src/sensei-progress-bar/index.php';
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/block-config.php

    r13940 r13944  
    5555    );
    5656
    57     $selected_slug = $wp_query->get( 'post_type' ) ? $wp_query->get( 'post_type' ) : 'any';
     57    $post_type = $wp_query->get( 'post_type' );
     58    $selected_slug = is_string( $post_type ) ? $post_type : 'any';
    5859    $label = $options[ $selected_slug ] ?? $options['any'];
    5960
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php

    r13943 r13944  
    88add_action( 'pre_get_posts', __NAMESPACE__ . '\add_language_to_archive_queries' );
    99add_action( 'pre_get_posts', __NAMESPACE__ . '\add_excluded_to_lesson_archive_query' );
     10add_action( 'pre_get_posts', __NAMESPACE__ . '\filter_search_queries_by_post_type' );
    1011add_filter( 'request', __NAMESPACE__ . '\handle_all_level_query' );
    1112
     
    8283
    8384/**
     85 * Filter search queries by post type.
     86 * Only include courses and lessons in search results unless post_type is set, eg. for an archive search.
     87 *
     88 * @param WP_Query $query The query object.
     89 * @return WP_Query The modified query object.
     90 */
     91function filter_search_queries_by_post_type( $query ) {
     92    if ( ! is_admin() && $query->is_search() && $query->is_main_query() ) {
     93        if ( ! $query->get( 'post_type' ) ) {
     94            $query->set( 'post_type', array( 'course', 'lesson' ) );
     95        }
     96    }
     97
     98    return $query;
     99}
     100
     101/**
    84102 * Modify the request.
    85103 *
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/package.json

    r13873 r13944  
    11{
    2     "name": "wporg-learn-2024",
    3     "version": "1.0.0",
    4     "description": "Theme for learn.wordpress.org",
     2    "name": "wporg-learn-2024",
     3    "version": "1.0.0",
     4    "description": "Theme for learn.wordpress.org",
    55    "author": "WordPress.org",
    66    "license": "GPL-2.0-or-later",
    77    "private": true,
    88    "devDependencies": {
     9        "@wordpress/icons": "^10.2.0",
    910        "@wordpress/scripts": "27.2.0",
    10         "rtlcss-webpack-plugin": "4.0.7",
    11         "@wordpress/icons": "^10.2.0",
    12         "react-dom": "^18.3.1"
     11        "react-dom": "^18.3.1",
     12        "rtlcss-webpack-plugin": "4.0.7"
    1313    },
    1414    "eslintConfig": {
     
    2828        "lint:css": "wp-scripts lint-style src/**/*.scss",
    2929        "format": "wp-scripts format src -- --config=../../../../.prettierrc.js"
     30    },
     31    "dependencies": {
     32        "lodash": "^4.17.21"
    3033    }
    3134}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css

    r13943 r13944  
    55 * Author URI: http://wordpress.org/
    66 * Description: A theme for learn.wordpress.org, built in 2024.
    7  * Version: 1.0.0-6f3ee52
     7 * Version: 1.0.0-f7d8461
    88 * License: GNU General Public License v2 or later
    99 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.