Making WordPress.org

Changeset 13957


Ignore:
Timestamp:
08/08/2024 11:41:16 PM (19 months ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@2c73303

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
6 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/locale-switcher/package.json

    r13644 r13957  
    2121    },
    2222    "devDependencies": {
    23         "@wordpress/scripts": "27.2.0"
     23        "@wordpress/scripts": "27.9.0"
    2424    },
    2525    "stylelint": {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.asset.php

    r13902 r13957  
    1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '8d2e083e22101415fb2c');
     1<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'fe14a0882f738a5bdaea');
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/lesson-archive-excluded-meta.js

    r13902 r13957  
    1 (()=>{"use strict";const e=window.React,t=window.wp.components,n=window.wp.data,o=window.wp.editPost,i=window.wp.element,l=window.wp.i18n,d=window.wp.plugins,r="excluded";(0,d.registerPlugin)("wporg-learn-lesson-archive-excluded-meta",{render:()=>{const d=(0,n.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")||{})),{editPost:c}=(0,n.useDispatch)("core/editor"),[s,w]=(0,i.useState)(d?._lesson_archive_excluded===r);return(0,e.createElement)(o.PluginDocumentSettingPanel,{title:(0,l.__)("Hidden Lesson","wporg-learn")},(0,e.createElement)(t.PanelRow,null,(0,e.createElement)(t.CheckboxControl,{label:(0,l.__)("Exclude this lesson from the archive","wporg-learn"),checked:s,onChange:e=>{w(e),c({meta:{...d,_lesson_archive_excluded:e?r:""}})}})))}})})();
     1(()=>{"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:""}})}})))}})})();
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php

    r13882 r13957  
    2828    register_lesson_level();
    2929    register_lesson_plan_series();
     30    register_lesson_visibility();
    3031    register_workshop_series();
    3132    register_workshop_type();
     
    259260
    260261    register_taxonomy( 'level', array( 'lesson-plan', 'lesson', 'course' ), $args );
     262}
     263
     264/**
     265 * Register the Lesson visibility taxonomy, used to hide lessons from the archive and search views.
     266 */
     267function register_lesson_visibility() {
     268    $labels = array(
     269        'name'                       => _x( 'Visibility', 'Taxonomy General Name', 'wporg-learn' ),
     270        'singular_name'              => _x( 'Visibility', 'Taxonomy Singular Name', 'wporg-learn' ),
     271        'menu_name'                  => __( 'Visibility', 'wporg-learn' ),
     272        'all_items'                  => __( 'All Visibilities', 'wporg-learn' ),
     273        'parent_item'                => __( 'Parent Visibility', 'wporg-learn' ),
     274        'parent_item_colon'          => __( 'Parent Visibility:', 'wporg-learn' ),
     275        'new_item_name'              => __( 'New Visibility Name', 'wporg-learn' ),
     276        'add_new_item'               => __( 'Add New Visibility', 'wporg-learn' ),
     277        'edit_item'                  => __( 'Edit Visibility', 'wporg-learn' ),
     278        'update_item'                => __( 'Update Visibility', 'wporg-learn' ),
     279        'view_item'                  => __( 'View Visibility', 'wporg-learn' ),
     280        'separate_items_with_commas' => __( 'Separate visibilities with commas', 'wporg-learn' ),
     281        'add_or_remove_items'        => __( 'Add or remove visibilities', 'wporg-learn' ),
     282        'choose_from_most_used'      => __( 'Choose from the most used', 'wporg-learn' ),
     283        'popular_items'              => __( 'Popular Visibilities', 'wporg-learn' ),
     284        'search_items'               => __( 'Search Visibilities', 'wporg-learn' ),
     285        'not_found'                  => __( 'No Visibilities Found', 'wporg-learn' ),
     286        'no_terms'                   => __( 'No visibilities', 'wporg-learn' ),
     287        'items_list'                 => __( 'Visibilities list', 'wporg-learn' ),
     288        'items_list_navigation'      => __( 'Visibilities list navigation', 'wporg-learn' ),
     289    );
     290
     291    $args = array(
     292        'labels'            => $labels,
     293        'hierarchical'      => true,
     294        'public'            => true,
     295        'query_var'         => 'wporg_lesson_visibility', // Prevent collisions with query params in the archive filter.
     296        'show_ui'           => true,
     297        'show_admin_column' => true,
     298        'show_in_nav_menus' => true,
     299        'show_tagcloud'     => false,
     300        'show_in_rest'      => true,
     301        'rewrite'           => false,
     302        'capabilities'      => array(
     303            'manage_terms' => 'manage_categories',
     304            'edit_terms'   => 'manage_categories',
     305            'delete_terms' => 'manage_categories',
     306            'assign_terms' => 'edit_lessons',
     307        ),
     308    );
     309
     310    // Use an existing taxonomy registered with Jetpack Search
     311    // See https://github.com/Automattic/jetpack/blob/36b2d5232e2ec3a1ad14034ab673fddce3acab97/projects/packages/sync/src/modules/class-search.php#L1479
     312    register_taxonomy( 'show', array( 'lesson' ), $args );
    261313}
    262314
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-archive-excluded-meta/index.js

    r13902 r13957  
    1717
    1818    return (
    19         <PluginDocumentSettingPanel title={ __( 'Hidden Lesson', 'wporg-learn' ) }>
     19        <PluginDocumentSettingPanel title={ __( 'Hidden Lesson (deprecated)', 'wporg-learn' ) }>
    2020            <PanelRow>
    2121                <CheckboxControl
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/package.json

    r13587 r13957  
    2828    },
    2929    "devDependencies": {
    30         "@wordpress/scripts": "27.2.0"
     30        "@wordpress/scripts": "27.9.0"
    3131    },
    3232    "stylelint": {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/inc/query.php

    r13944 r13957  
    5353    if ( ! is_admin() && $query->is_main_query() && ( $query->is_archive( 'lesson' ) || $query->is_search() ) ) {
    5454        $meta_query = $query->get( 'meta_query', array() );
     55        $tax_query = $query->get( 'tax_query', array() );
    5556
    56         $exclude_lesson_query = array(
     57        $exclude_lessons_by_post_meta = array(
    5758            'relation' => 'OR',
    5859            array(
     
    7273                'relation' => 'AND',
    7374                $meta_query,
    74                 $exclude_lesson_query,
     75                $exclude_lessons_by_post_meta,
    7576            );
    7677        } else {
    77             $meta_query = $exclude_lesson_query;
     78            $meta_query = $exclude_lessons_by_post_meta;
     79        }
     80
     81        $exclude_lessons_by_taxonomy = array(
     82            'taxonomy' => 'show',
     83            'field'    => 'slug',
     84            'terms'    => 'hidden',
     85            'operator' => 'NOT IN',
     86        );
     87
     88        // If there's an existing tax query, add the new condition
     89        if ( ! empty( $tax_query ) ) {
     90            $tax_query['relation'] = 'AND';
     91            $tax_query[] = $exclude_lessons_by_taxonomy;
     92        } else {
     93            $tax_query = array( $exclude_lessons_by_taxonomy );
    7894        }
    7995
    8096        $query->set( 'meta_query', $meta_query );
     97        $query->set( 'tax_query', $tax_query );
    8198    }
    8299}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/package.json

    r13944 r13957  
    88    "devDependencies": {
    99        "@wordpress/icons": "^10.2.0",
    10         "@wordpress/scripts": "27.2.0",
    11         "react-dom": "^18.3.1",
    12         "rtlcss-webpack-plugin": "4.0.7"
     10        "@wordpress/scripts": "27.9.0",
     11        "react-dom": "^18.3.1"
    1312    },
    1413    "eslintConfig": {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css

    r13956 r13957  
    55 * Author URI: http://wordpress.org/
    66 * Description: A theme for learn.wordpress.org, built in 2024.
    7  * Version: 1.0.0-6ed3a3d
     7 * Version: 1.0.0-bbe9ed4
    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.