Making WordPress.org


Ignore:
Timestamp:
09/03/2024 11:18:21 PM (18 months ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@a4f5e38

File:
1 edited

Legend:

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

    r14017 r14019  
    3939// Attached at 11 to run after scripts are registered, but before they are enqueued.
    4040add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\defer_scripts', 11 );
     41add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\remove_sensei_course_archive_js', 100 );
    4142
    4243// Remove Jetpack CSS on frontend
     
    253254
    254255/**
     256 * Remove Sensei course archive JavaScript for performance.
     257 * Not needed as we don't display Sensei course order controls.
     258 */
     259function remove_sensei_course_archive_js() {
     260    if ( is_admin() || ! is_post_type_archive( 'course' ) ) {
     261        return;
     262    }
     263
     264    wp_dequeue_script( 'sensei-course-archive-js' );
     265    wp_deregister_script( 'sensei-course-archive-js' );
     266}
     267
     268/**
    255269 * Dequeue Sensei video scripts loaded on lessons archive.
    256270 * Sensei LMS and Sensei Pro both enqueue video player scripts for lesson posts,
Note: See TracChangeset for help on using the changeset viewer.