Making WordPress.org


Ignore:
Timestamp:
12/22/2021 06:17:43 PM (4 years ago)
Author:
iandunn
Message:

WordPress.org Learn: Sync with GitHub

File:
1 edited

Legend:

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

    r11384 r11400  
    226226 */
    227227function wporg_learn_get_lesson_plan_taxonomy_data( $post_id, $context ) {
    228     return array(
     228    $data = array(
    229229        array(
    230230            'icon'  => 'clock',
     
    252252        ),
    253253    );
     254
     255    $versions = wporg_learn_get_taxonomy_terms( $post_id, 'wporg_wp_version', $context );
     256    if ( $versions ) {
     257        $data[] = array(
     258            'icon'  => 'wordpress',
     259            'slug'  => 'wp_version',
     260            'label' => wporg_label_with_colon( get_taxonomy_labels( get_taxonomy( 'wporg_wp_version' ) )->singular_name ),
     261            'value' => $versions,
     262        );
     263    }
     264
     265    return $data;
    254266}
    255267
     
    449461        INPUT_GET,
    450462        array(
    451             'search'   => FILTER_SANITIZE_STRING,
    452             'captions' => FILTER_SANITIZE_STRING,
    453             'language' => FILTER_SANITIZE_STRING,
    454             'audience' => array(
     463            'search'     => FILTER_SANITIZE_STRING,
     464            'captions'   => FILTER_SANITIZE_STRING,
     465            'language'   => FILTER_SANITIZE_STRING,
     466            'audience'   => array(
    455467                'filter' => FILTER_VALIDATE_INT,
    456468                'flags'  => FILTER_REQUIRE_ARRAY,
    457469            ),
    458             'duration' => array(
     470            'duration'   => array(
    459471                'filter' => FILTER_VALIDATE_INT,
    460472                'flags'  => FILTER_REQUIRE_ARRAY,
    461473            ),
    462             'level'    => array(
     474            'level'      => array(
    463475                'filter' => FILTER_VALIDATE_INT,
    464476                'flags'  => FILTER_REQUIRE_ARRAY,
    465477            ),
    466             'series'   => FILTER_VALIDATE_INT,
    467             'topic'    => FILTER_VALIDATE_INT,
    468             'type'     => array(
     478            'series'     => FILTER_VALIDATE_INT,
     479            'topic'      => FILTER_VALIDATE_INT,
     480            'type'       => array(
    469481                'filter' => FILTER_VALIDATE_INT,
    470482                'flags'  => FILTER_REQUIRE_ARRAY,
    471483            ),
     484            'wp_version' => array(
     485                'filter' => FILTER_VALIDATE_INT,
     486                'flags'  => FILTER_FORCE_ARRAY,
     487            ),
    472488        ),
    473489        false
     
    475491
    476492    $entity_map = array(
    477         'captions' => 'video_caption_language',
    478         'language' => 'video_language',
    479         'audience' => 'audience',
    480         'duration' => 'duration',
    481         'level'    => 'level',
    482         'topic'    => 'topic',
    483         'type'     => 'instruction_type',
     493        'captions'   => 'video_caption_language',
     494        'language'   => 'video_language',
     495        'audience'   => 'audience',
     496        'duration'   => 'duration',
     497        'level'      => 'level',
     498        'topic'      => 'topic',
     499        'type'       => 'instruction_type',
     500        'wp_version' => 'wporg_wp_version',
    484501    );
    485502
     
    536553                case 'topic':
    537554                case 'type':
     555                case 'wp_version':
    538556                    if ( ! empty( $tax_query ) ) {
    539557                        $tax_query['relation'] = 'AND';
Note: See TracChangeset for help on using the changeset viewer.