Making WordPress.org


Ignore:
Timestamp:
11/11/2021 03:53:36 AM (3 years ago)
Author:
tellyworth
Message:

WordPress.org Learn: Sync with GitHub

Props hlashbrooke, ronalfy.

https://github.com/WordPress/learn/compare/b0cc237f6c2787a04f305bfdd28e0bca92b9415a...376c877bea94e328f57a2c288bc4abc7d9ba43d4

File:
1 edited

Legend:

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

    r11279 r11323  
    276276            array(
    277277                'post_date' => 'DESC',
    278                 'ID' => 'ASC',
     278                'ID'        => 'ASC',
    279279            )
    280280        );
     
    360360         * grouping, there would be a separate row for each postmeta value for each workshop post.
    361361         */
    362         $clauses['fields']  .= ",
     362        $clauses['fields'] .= ",
    363363            MAX( IF( pmeta.meta_key = 'video_language' AND pmeta.meta_value LIKE '{$locale_root}%', 1, 0 ) ) AS has_language
    364364        ";
    365         $clauses['fields']  .= ",
     365        $clauses['fields'] .= ",
    366366            MAX( IF( pmeta.meta_key = 'video_caption_language' AND pmeta.meta_value LIKE '{$locale_root}%', 1, 0 ) ) AS has_caption
    367367        ";
    368         $clauses['join']    .= " INNER JOIN {$wpdb->postmeta} pmeta ON ( {$wpdb->posts}.ID = pmeta.post_id )";
     368        $clauses['join']   .= " INNER JOIN {$wpdb->postmeta} pmeta ON ( {$wpdb->posts}.ID = pmeta.post_id )";
    369369        // This orderby clause ensures that the workshops are sorted by the values in the calculated columns first.
    370370        $clauses['orderby'] = 'has_language DESC, has_caption DESC, ' . $clauses['orderby'];
     
    432432    $meta_query = array();
    433433    $tax_query = array();
     434
    434435    $is_filtered = false;
    435436
     
    512513 */
    513514function wporg_get_archive_query( $post_type, array $args = array() ) {
    514     $args = wp_parse_args( $args, array(
    515         'post_type'   => $post_type,
    516         'post_status' => 'publish',
    517     ) );
     515    $args = wp_parse_args(
     516        $args,
     517        array(
     518            'post_type'   => $post_type,
     519            'post_status' => 'publish',
     520        )
     521    );
    518522
    519523    return new WP_Query( $args );
     
    528532 */
    529533function wporg_learn_get_card_template_args( $post_id ) {
    530     $post = get_post( $post_id );
     534    $post      = get_post( $post_id );
    531535    $post_type = get_post_type( $post );
    532536
     
    549553
    550554            if ( is_user_logged_in() ) {
    551                 $completed    = count( Sensei()->course->get_completed_lesson_ids( $post_id, get_current_user_id() ) );
     555                $completed = count( Sensei()->course->get_completed_lesson_ids( $post_id, get_current_user_id() ) );
    552556
    553557                $args['meta'][] = array(
     
    924928
    925929/**
     930 * Register theme sidebars.
     931 */
     932function wporg_learn_register_sidebars() {
     933    // Register lesson plans sidebar.
     934    register_sidebar(
     935        array(
     936            'name'          => __( 'Lesson Plans', 'wporg-learn' ),
     937            'id'            => 'wporg-learn-lesson-plans',
     938            'before_widget' => '<div id="%1$s" class="block-widgets %2$s">',
     939            'after_widget'  => '</div>',
     940            'before_title'  => '<h4 class="widget-title">',
     941            'after_title'   => '<h4>',
     942        )
     943    );
     944
     945    // Register courses sidebar.
     946    register_sidebar(
     947        array(
     948            'name'          => __( 'Courses', 'wporg-learn' ),
     949            'id'            => 'wporg-learn-courses',
     950            'before_widget' => '<aside id="%1$s" class="widget %2$s">',
     951            'after_widget'  => '</aside>',
     952            'before_title'  => '<h4 class="widget-title">',
     953            'after_title'   => '</h4>',
     954        )
     955    );
     956
     957    // Register workshops sidebar.
     958    register_sidebar(
     959        array(
     960            'name'          => __( 'Workshops', 'wporg-learn' ),
     961            'id'            => 'wporg-learn-workshops',
     962            'before_widget' => '<aside id="%1$s" class="widget %2$s">',
     963            'after_widget'  => '</aside>',
     964            'before_title'  => '<h4 class="widget-title">',
     965            'after_title'   => '</h4>',
     966        )
     967    );
     968}
     969add_filter( 'widgets_init', 'wporg_learn_register_sidebars', 10 );
     970
     971/**
    926972 * Add fallback image to Jetpack when no featured image exists.
    927973 *
     
    934980}
    935981add_action( 'jetpack_open_graph_image_default', 'wporg_learn_return_default_image', 15, 1 );
     982
     983/**
     984 * Disable the News XML Sitemap generated by Jetpack
     985 */
     986add_filter( 'jetpack_news_sitemap_generate', '__return_false' );
Note: See TracChangeset for help on using the changeset viewer.