Making WordPress.org

Changeset 11966


Ignore:
Timestamp:
07/15/2022 12:25:33 AM (3 years ago)
Author:
dufresnesteven
Message:

Learn: Sync with git WordPress/learn@cb551b095dd6941eda68c26750e249d907044142

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/capabilities.php

    r11269 r11966  
    2727    $capability_types = array(
    2828        array( 'lesson_plan', 'lesson_plans' ),
    29         array( 'workshop', 'workshops' ),
     29        array( 'tutorial', 'tutorials' ),
    3030    );
    3131
     
    195195        $wr_role = add_role(
    196196            'workshop_reviewer',
    197             __( 'Workshop Reviewer', 'wporg-learn' ),
     197            __( 'Tutorial Reviewer', 'wporg-learn' ),
    198198            $role_caps
    199199        );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/events.php

    r11338 r11966  
    7070        SELECT *
    7171        FROM wporg_events
    72         WHERE meetup_url = 'https://www.meetup.com/wordpress-social-learning/'
     72        WHERE meetup_url = 'https://www.meetup.com/learn-wordpress-online-workshops/'
    7373        AND status = 'scheduled'
    7474        AND date_utc BETWEEN %s AND %s
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php

    r11269 r11966  
    8484
    8585/**
    86  * Register a Workshop post type.
     86 * Register a Tutorial post type.
    8787 */
    8888function register_workshop() {
    8989    $labels = array(
    90         'name'                  => _x( 'Workshops', 'Post Type General Name', 'wporg_learn' ),
    91         'singular_name'         => _x( 'Workshop', 'Post Type Singular Name', 'wporg_learn' ),
    92         'menu_name'             => __( 'Workshops', 'wporg_learn' ),
    93         'name_admin_bar'        => __( 'Workshop', 'wporg_learn' ),
    94         'archives'              => __( 'Workshop Archives', 'wporg_learn' ),
    95         'attributes'            => __( 'Workshop Attributes', 'wporg_learn' ),
    96         'parent_item_colon'     => __( 'Parent Workshop:', 'wporg_learn' ),
    97         'all_items'             => __( 'All Workshops', 'wporg_learn' ),
    98         'add_new_item'          => __( 'Add New Workshop', 'wporg_learn' ),
     90        'name'                  => _x( 'Tutorials', 'Post Type General Name', 'wporg_learn' ),
     91        'singular_name'         => _x( 'Tutorial', 'Post Type Singular Name', 'wporg_learn' ),
     92        'menu_name'             => __( 'Tutorials', 'wporg_learn' ),
     93        'name_admin_bar'        => __( 'Tutorial', 'wporg_learn' ),
     94        'archives'              => __( 'Tutorial Archives', 'wporg_learn' ),
     95        'attributes'            => __( 'Tutorial Attributes', 'wporg_learn' ),
     96        'parent_item_colon'     => __( 'Parent Tutorial:', 'wporg_learn' ),
     97        'all_items'             => __( 'All Tutorials', 'wporg_learn' ),
     98        'add_new_item'          => __( 'Add New Tutorial', 'wporg_learn' ),
    9999        'add_new'               => __( 'Add New', 'wporg_learn' ),
    100         'new_item'              => __( 'New Workshop', 'wporg_learn' ),
    101         'edit_item'             => __( 'Edit Workshop', 'wporg_learn' ),
    102         'update_item'           => __( 'Update Workshop', 'wporg_learn' ),
    103         'view_item'             => __( 'View Workshop', 'wporg_learn' ),
    104         'view_items'            => __( 'View Workshops', 'wporg_learn' ),
    105         'search_items'          => __( 'Search Workshops', 'wporg_learn' ),
    106         'not_found'             => __( 'No workshops found.', 'wporg_learn' ),
    107         'not_found_in_trash'    => __( 'No workshops found in Trash.', 'wporg_learn' ),
     100        'new_item'              => __( 'New Tutorial', 'wporg_learn' ),
     101        'edit_item'             => __( 'Edit Tutorial', 'wporg_learn' ),
     102        'update_item'           => __( 'Update Tutorial', 'wporg_learn' ),
     103        'view_item'             => __( 'View Tutorial', 'wporg_learn' ),
     104        'view_items'            => __( 'View Tutorials', 'wporg_learn' ),
     105        'search_items'          => __( 'Search Tutorials', 'wporg_learn' ),
     106        'not_found'             => __( 'No tutorials found.', 'wporg_learn' ),
     107        'not_found_in_trash'    => __( 'No tutorials found in Trash.', 'wporg_learn' ),
    108108        'featured_image'        => __( 'Featured image', 'wporg_learn' ),
    109109        'set_featured_image'    => __( 'Set featured image', 'wporg_learn' ),
    110110        'remove_featured_image' => __( 'Remove featured image', 'wporg_learn' ),
    111111        'use_featured_image'    => __( 'Use as featured image', 'wporg_learn' ),
    112         'insert_into_item'      => __( 'Insert into workshop', 'wporg_learn' ),
    113         'uploaded_to_this_item' => __( 'Uploaded to this workshop', 'wporg_learn' ),
    114         'items_list'            => __( 'Workshops list', 'wporg_learn' ),
    115         'items_list_navigation' => __( 'Workshops list navigation', 'wporg_learn' ),
    116         'filter_items_list'     => __( 'Filter workshops list', 'wporg_learn' ),
     112        'insert_into_item'      => __( 'Insert into tutorial', 'wporg_learn' ),
     113        'uploaded_to_this_item' => __( 'Uploaded to this tutorial', 'wporg_learn' ),
     114        'items_list'            => __( 'Tutorials list', 'wporg_learn' ),
     115        'items_list_navigation' => __( 'Tutorials list navigation', 'wporg_learn' ),
     116        'filter_items_list'     => __( 'Filter tutorials list', 'wporg_learn' ),
    117117    );
    118118
     
    129129
    130130    $args = array(
    131         'label'               => __( 'Workshop', 'wporg_learn' ),
    132         'description'         => __( 'WordPress.org Training Workshop', 'wporg_learn' ),
     131        'label'               => __( 'Tutorial', 'wporg_learn' ),
     132        'description'         => __( 'WordPress.org Training Tutorial', 'wporg_learn' ),
    133133        'labels'              => $labels,
    134134        'supports'            => $supports,
     
    138138        'show_ui'             => true,
    139139        'show_in_menu'        => true,
    140         'has_archive'         => 'workshops',
     140        'has_archive'         => 'tutorials',
    141141        'menu_position'       => 6,
    142142        'menu_icon'           => 'dashicons-desktop',
     
    146146        'exclude_from_search' => false,
    147147        'publicly_queryable'  => true,
    148         'capability_type'     => array( 'workshop', 'workshops' ),
     148        'capability_type'     => array( 'tutorial', 'tutorials' ),
    149149        'map_meta_cap'        => true,
    150150        'show_in_rest'        => true,
    151         'rewrite'             => array( 'slug' => 'workshop' ),
     151        'rewrite'             => array( 'slug' => 'tutorial' ),
    152152        'template'            => generate_workshop_template_structure(),
    153153    );
     
    170170            'core/paragraph',
    171171            array(
    172                 'placeholder' => __( 'Describe what the workshop is about.', 'wporg-learn' ),
     172                'placeholder' => __( 'Describe what the tutorial is about.', 'wporg-learn' ),
    173173            ),
    174174        ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php

    r11413 r11966  
    345345function register_workshop_series() {
    346346    $labels = array(
    347         'name'                       => _x( 'Workshop Series', 'taxonomy general name', 'wporg-learn' ),
    348         'singular_name'              => _x( 'Workshop Series', 'taxonomy singular name', 'wporg-learn' ),
     347        'name'                       => _x( 'Tutorial Series', 'taxonomy general name', 'wporg-learn' ),
     348        'singular_name'              => _x( 'Tutorial Series', 'taxonomy singular name', 'wporg-learn' ),
    349349        'menu_name'                  => __( 'Series', 'wporg-learn' ),
    350350        'all_items'                  => __( 'All Series', 'wporg-learn' ),
     
    371371        'public'            => true,
    372372        'rewrite'           => array(
    373             'slug' => 'workshops',
     373            'slug' => 'tutorials',
    374374        ),
    375375        'show_ui'           => true,
     
    391391function register_workshop_topic() {
    392392    $labels = array(
    393         'name'                       => _x( 'Topics', 'Topic Plans associated to workshop.', 'wporg-learn' ),
     393        'name'                       => _x( 'Topics', 'Topic Plans associated to tutorial.', 'wporg-learn' ),
    394394        'singular_name'              => _x( 'Topic', 'Taxonomy Singular Name', 'wporg-learn' ),
    395395        'menu_name'                  => __( 'Topics', 'wporg-learn' ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-workshop-details.php

    r11546 r11966  
    2828                            $url = '';
    2929                            if ( ! empty( $field['param'] ) ) {
    30                                 $url = trailingslashit( site_url() ) . 'workshops/?' . $key . '=' . $field['param'][ $field_key ];
     30                                $url = trailingslashit( site_url() ) . 'tutorials/?' . $key . '=' . $field['param'][ $field_key ];
    3131                            }
    3232
     
    7878        <a
    7979            class="wp-block-button__link"
    80             href="https://learn.wordpress.org/social-learning/"
     80            href="https://learn.wordpress.org/online-workshops/"
    8181            style="border-radius:5px"
    8282        >
    83             <?php esc_html_e( 'Join a Social Learning Space', 'wporg-learn' ); ?>
     83            <?php esc_html_e( 'Join a live Online Workshop', 'wporg-learn' ); ?>
    8484        </a>
    8585    </div>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/form-workshop-application.php

    r10926 r11966  
    9191        <fieldset class="section">
    9292            <legend>
    93                 <?php esc_html_e( 'Workshop Details', 'wporg-learn' ); ?>
     93                <?php esc_html_e( 'Tutorial Details', 'wporg-learn' ); ?>
    9494            </legend>
    9595            <?php
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/front-page.php

    r11697 r11966  
    1212        <section class="quick-intro">
    1313            <div class="shapes">
    14                 <a class="parallelogram workshops" href="/workshops/">
     14                <a class="parallelogram workshops" href="/tutorials/">
    1515                    <p class="dashicons-before dashicons-desktop">
    16                         <strong><?php esc_html_e( 'Workshops', 'wporg-learn' ); ?></strong>
     16                        <strong><?php esc_html_e( 'Tutorials', 'wporg-learn' ); ?></strong>
    1717                        <?php
    18                         esc_html_e( 'Workshops are a great way to get hands-on with WordPress. Here are some workshops for you to level up your WordPress skills.', 'wporg-learn' );
     18                        esc_html_e( 'Tutorials are a great way to get hands-on with WordPress. Here are some tutorials for you to level up your WordPress skills.', 'wporg-learn' );
    1919                        ?>
    20                         <u><?php esc_html_e( 'Browse Workshops', 'wporg-learn' ); ?></u>
     20                        <u><?php esc_html_e( 'Browse Tutorials', 'wporg-learn' ); ?></u>
    2121                    </p>
    2222                </a>
     
    6363        <section>
    6464            <div class="row align-middle between section-heading">
    65                 <h2 class="h4 section-heading_title"><?php esc_html_e( 'Recent Workshops', 'wporg-learn' ); ?></h2>
    66                 <a class="section-heading_link" href="/workshops/"><span aria-hidden="true"><?php esc_html_e( 'View All Workshops', 'wporg-learn' ); ?></span><span class="screen-reader-text"><?php esc_html_e( 'View All Workshops', 'wporg-learn' ); ?></span></a>
     65                <h2 class="h4 section-heading_title"><?php esc_html_e( 'Recent Tutorials', 'wporg-learn' ); ?></h2>
     66                <a class="section-heading_link" href="/tutorials/"><span aria-hidden="true"><?php esc_html_e( 'View All Tutorials', 'wporg-learn' ); ?></span><span class="screen-reader-text"><?php esc_html_e( 'View All Tutorials', 'wporg-learn' ); ?></span></a>
    6767            </div>
    6868
     
    8787                <div class="row align-middle between section-heading">
    8888                    <h2 class="h4 section-heading_title">
    89                         <?php esc_html_e( 'Upcoming Social Learning Spaces', 'wporg-learn' ); ?>
     89                        <?php esc_html_e( 'Upcoming Online Workshops', 'wporg-learn' ); ?>
    9090                    </h2>
    91                     <a class="section-heading_link" href="/social-learning/">
    92                         <?php esc_html_e( 'View All Social Learning Spaces', 'wporg-learn' ); ?>
     91                    <a class="section-heading_link" href="/online-workshops/">
     92                        <?php esc_html_e( 'View All Online Workshops', 'wporg-learn' ); ?>
    9393                    </a>
    9494                </div>
     
    101101                    <?php
    102102                    printf(
    103                         wp_kses_post( __( 'Want to facilitate a social learning space? <a href="%s">Apply to become a facilitator</a>.', 'wporg-learn' ) ),
    104                         'https://learn.wordpress.org/social-learning/'
     103                        wp_kses_post( __( 'Want to facilitate an online workshop? <a href="%s">Apply to become a facilitator</a>.', 'wporg-learn' ) ),
     104                        'https://learn.wordpress.org/online-workshops/'
    105105                    );
    106106                    ?>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php

    r11961 r11966  
    11421142
    11431143/**
     1144 * Redirect old pages to their new homes.
     1145 *
     1146 * @return void
     1147 */
     1148function wporg_learn_redirect_old_urls() {
     1149    if ( ! is_404() ) {
     1150        return;
     1151    }
     1152
     1153    $redirects = array(
     1154        // Source => Destination, any characters after the source will be appended to the destination.
     1155        '/workshop/'                      => '/tutorial/',
     1156        '/workshops'                      => '/tutorials',
     1157        '/social-learning'                => '/online-workshops',
     1158        '/workshop-presenter-application' => '/tutorial-presenter-application',
     1159    );
     1160
     1161    // Use `REQUEST_URI` rather than `$wp->request`, to get the entire source URI including url parameters.
     1162    $request = $_SERVER['REQUEST_URI'] ?? '';
     1163
     1164    foreach ( $redirects as $source => $destination ) {
     1165        if ( str_starts_with( $request, $source ) ) {
     1166            $redirect = $destination;
     1167
     1168            // Append any extra request parameters.
     1169            if ( strlen( $request ) > strlen( $source ) ) {
     1170                $redirect .= substr( $request, strlen( $source ) );
     1171            }
     1172
     1173            wp_safe_redirect( $redirect );
     1174            die();
     1175        }
     1176    }
     1177}
     1178add_action( 'template_redirect', 'wporg_learn_redirect_old_urls' );
     1179
     1180/**
    11441181 * Add file MIME types for upload.
    11451182 *
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php

    r11517 r11966  
    2727
    2828$menu_items = array(
    29     '/workshops/'    => __( 'Workshops', 'wporg-learn' ),
     29    '/tutorials/'    => __( 'Tutorials', 'wporg-learn' ),
     30    '/online-workshops/' => __( 'Online Workshops', 'wporg-learn' ),
    3031    '/courses/'    => __( 'Courses', 'wporg-learn' ),
    3132    '/lesson-plans/' => __( 'Lesson Plans', 'wporg-learn' ),
    32     '/social-learning/' => __( 'Social Learning', 'wporg-learn' ),
    3333    '/contribute/' => __( 'Contribute', 'wporg-learn' ),
    3434);
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-discussion-event-short-item.php

    r11961 r11966  
    2323    <div class="wp-block-button is-style-primary">
    2424        <a class="wp-block-button__link" href="<?php echo esc_attr( $args['url'] ); ?>" style="border-radius:5px">
    25             <?php esc_html_e( 'Join this space', 'wporg-learn' ); ?><span class="screen-reader-text"><?php echo sprintf( ': %s', esc_html( $args['title'] ) ); ?></span>
     25            <?php esc_html_e( 'Join this workshop', 'wporg-learn' ); ?><span class="screen-reader-text"><?php echo sprintf( ': %s', esc_html( $args['title'] ) ); ?></span>
    2626        </a>
    2727    </div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-submit-idea-cta.php

    r11309 r11966  
    1616        <div aria-hidden="true" class="content-icon"><span class="dashicons dashicons-<?php echo esc_attr( $args['icon'] ); ?>"></span></div>
    1717    <?php endif; ?>
    18     <h2><?php esc_html_e( 'Have an Idea for a Workshop? Let us know!', 'wporg-learn' ); ?></h2>
    19     <a class="button button-primary button-large" href="https://learn.wordpress.org/workshop-presenter-application/"><span aria-hidden="true"><?php esc_html_e( 'Submit an Idea', 'wporg-learn' ); ?></span><span class="screen-reader-text"><?php esc_html_e( 'Submit Workshop Idea', 'wporg-learn' ); ?></span></a>
     18    <h2><?php esc_html_e( 'Have an Idea for a Tutorial? Let us know!', 'wporg-learn' ); ?></h2>
     19    <a class="button button-primary button-large" href="https://learn.wordpress.org/tutorial-presenter-application/"><span aria-hidden="true"><?php esc_html_e( 'Submit an Idea', 'wporg-learn' ); ?></span><span class="screen-reader-text"><?php esc_html_e( 'Submit Tutorial Idea', 'wporg-learn' ); ?></span></a>
    2020</section>
Note: See TracChangeset for help on using the changeset viewer.