Making WordPress.org


Ignore:
Timestamp:
11/20/2020 12:07:27 AM (6 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

​https://github.com/WordPress/learn/compare/a6529c2090ca8a1dcc9e36e27460f6cbb84e02ef...2c9bbc5fc4eefb1f1a367f7bb8afcd3da6ef32b0

File:
1 edited

Legend:

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

    r10422 r10458  
    202202function wporg_post_type_is_lesson() {
    203203        return get_post_type() == 'lesson-plan';
    204 }
    205 
    206 /**
    207  * Returns the custom field view_lesson_plan_slides_url, if it doesn't exists returns false
    208  *
    209  * @return string|bool
    210  */
    211 function wporg_get_slides_url() {
    212         return get_post_meta( get_the_ID(), 'view_lesson_plan_slides_url', true );
    213 }
    214 
    215 /**
    216  * Returns the custom field download_lesson_plan_slides_url, if it doesn't exists returns false
    217  *
    218  * @return string|bool
    219  */
    220 function wporg_get_download_slides_url() {
    221         return get_post_meta( get_the_ID(), 'download_lesson_plan_slides_url', true );
    222204}
    223205
    … …  
    622604        return $siblings[ $index ] ?? false;
    623605}
     606
     607/**
     608 * Robots "noindex" rules for specific parts of the Learn site.
     609 *
     610 * @param bool $noindex
     611 *
     612 * @return bool
     613 */
     614function wporg_learn_noindex( $noindex ) {
     615        if ( is_singular( 'quiz' ) ) {
     616                $noindex = true;
     617        }
     618
     619        return $noindex;
     620}
     621add_filter( 'wporg_noindex_request', 'wporg_learn_noindex' );
Note: See TracChangeset for help on using the changeset viewer.