Making WordPress.org

Changeset 11336


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

WordPress.org Learn: sync with GitHub

Props hlashbrooke.

https://github.com/WordPress/learn/compare/376c877bea94e328f57a2c288bc4abc7d9ba43d4...2081edb762a0d21eba6d2299e8531db985b004c4

File:
1 edited

Legend:

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

    r11323 r11336  
    301301    if ( $query->is_main_query() && $query->is_search() ) {
    302302        $public_post_types = array_keys( get_post_types( array( 'public' => true ) ) );
    303         $omit_from_search = array( 'attachment', 'lesson', 'quiz', 'sensei_message' );
     303        $omit_from_search = array( 'attachment', 'lesson', 'quiz', 'sensei_message', 'meeting' );
    304304        $searchable_post_types = array_diff( $public_post_types, $omit_from_search );
    305305
     
    985985 */
    986986add_filter( 'jetpack_news_sitemap_generate', '__return_false' );
     987
     988/**
     989 * Redirect meeting posts to associated link
     990 *
     991 * @return void
     992 */
     993function wporg_learn_redirect_meetings() {
     994    global $post;
     995
     996    if ( is_singular( array( 'meeting' ) ) ) {
     997
     998        if ( ! empty( $post->ID ) ) {
     999
     1000            $redirect = wp_http_validate_url( get_post_meta( $post->ID, 'link', true ) );
     1001
     1002            if ( $redirect && wp_redirect( $redirect ) ) {
     1003                exit;
     1004            }
     1005        }
     1006    }
     1007
     1008}
     1009add_action( 'template_redirect', 'wporg_learn_redirect_meetings' );
Note: See TracChangeset for help on using the changeset viewer.