Changeset 13999
- Timestamp:
- 08/27/2024 10:49:16 PM (10 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/locale-switcher/locale-switcher.php
r10880 r13999 109 109 $script_data['dependencies'], 110 110 $script_data['version'], 111 true111 array( 'strategy' => 'defer' ) 112 112 ); 113 113 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/locale.php
r13963 r13999 65 65 wp_enqueue_script( 66 66 'locale-notice', 67 get_build_url() . ' /locale-notice.js',67 get_build_url() . 'locale-notice.js', 68 68 array( 'jquery', 'utils' ), 69 69 filemtime( get_build_path() . '/locale-notice.js' ), 70 true70 array( 'strategy' => 'defer' ) 71 71 ); 72 72 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/functions.php
r13987 r13999 31 31 */ 32 32 add_action( 'after_setup_theme', __NAMESPACE__ . '\setup' ); 33 add_filter( 'wp_get_attachment_image_attributes', __NAMESPACE__ . '\eager_load_first_card_rows_images', 10, 3 ); 33 add_action( 'sensei_quiz_question_inside_after', __NAMESPACE__ . '\sensei_question_add_closing_fieldset' ); 34 // Attached at 50 to inject after title, description, etc, so that only answers are in the fieldset. 35 add_action( 'sensei_quiz_question_inside_before', __NAMESPACE__ . '\sensei_question_add_opening_fieldset', 50 ); 36 add_action( 'wp', __NAMESPACE__ . '\dequeue_lesson_archive_video_scripts', 20 ); 34 37 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' ); 35 38 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\maybe_enqueue_sensei_assets', 100 ); 36 39 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\defer_scripts', 11 ); 40 41 // Remove Jetpack CSS on frontend 42 add_filter( 'jetpack_implode_frontend_css', '__return_false', 99 ); 37 43 add_filter( 'post_thumbnail_html', __NAMESPACE__ . '\set_default_featured_image', 10, 5 ); 44 add_filter( 'search_template_hierarchy', __NAMESPACE__ . '\modify_search_template' ); 45 add_filter( 'sensei_learning_mode_lesson_status_icon', __NAMESPACE__ . '\modify_lesson_status_icon_add_aria', 10, 2 ); 38 46 add_filter( 'sensei_register_post_type_course', function( $args ) { 39 47 $args['has_archive'] = 'courses'; … … 45 53 } ); 46 54 add_filter( 'single_template_hierarchy', __NAMESPACE__ . '\modify_single_template' ); 47 add_filter( 'search_template_hierarchy', __NAMESPACE__ . '\modify_search_template' ); 55 add_filter( 'taxonomy_template_hierarchy', __NAMESPACE__ . '\modify_taxonomy_template_hierarchy' ); 56 add_filter( 'wp_get_attachment_image_attributes', __NAMESPACE__ . '\eager_load_first_card_rows_images', 10, 3 ); 48 57 add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' ); 49 58 add_filter( 'wporg_block_site_breadcrumbs', __NAMESPACE__ . '\set_site_breadcrumbs' ); 50 add_filter( 'taxonomy_template_hierarchy', __NAMESPACE__ . '\modify_taxonomy_template_hierarchy' );51 52 // Attached at 50 to inject after title, description, etc, so that only answers are in the fieldset.53 add_action( 'sensei_quiz_question_inside_before', __NAMESPACE__ . '\sensei_question_add_opening_fieldset', 50 );54 add_action( 'sensei_quiz_question_inside_after', __NAMESPACE__ . '\sensei_question_add_closing_fieldset' );55 add_filter( 'sensei_learning_mode_lesson_status_icon', __NAMESPACE__ . '\modify_lesson_status_icon_add_aria', 10, 2 );56 59 57 60 remove_filter( 'template_include', array( 'Sensei_Templates', 'template_loader' ), 10, 1 ); … … 186 189 187 190 /** 191 * Defer frontend script loading for performance optimization. 192 */ 193 function defer_scripts() { 194 if ( is_admin() ) { 195 return; 196 } 197 198 wp_script_add_data( 'jquery-core', 'strategy', 'defer' ); 199 wp_script_add_data( 'jquery-core', 'group', 0 ); 200 201 wp_script_add_data( 'jquery-migrate', 'strategy', 'defer' ); 202 wp_script_add_data( 'jquery-migrate', 'group', 0 ); 203 204 wp_script_add_data( 'jetpack-block-subscriptions', 'strategy', 'defer' ); 205 wp_script_add_data( 'jetpack-block-subscriptions', 'group', 0 ); 206 207 wp_script_add_data( 'utils', 'strategy', 'defer' ); 208 wp_script_add_data( 'utils', 'group', 0 ); 209 } 210 211 /** 212 * Dequeue Sensei video scripts loaded on lessons archive. 213 * Sensei LMS and Sensei Pro both enqueue video player scripts for lesson posts, 214 * but these are not needed on archives and cause performance issues. 215 * 216 * See class Sensei_Pro_Interactive_Blocks\Interactive_Blocks::enqueue_frontend_assets(). 217 * See class Sensei_Course_Video_Settings::enqueue_frontend_scripts(). 218 */ 219 function dequeue_lesson_archive_video_scripts() { 220 if ( is_admin() || ! is_post_type_archive( 'lesson' ) ) { 221 return; 222 } 223 224 global $wp_filter; 225 226 if ( isset( $wp_filter['wp_enqueue_scripts'] ) ) { 227 foreach ( $wp_filter['wp_enqueue_scripts']->callbacks as $priority => $callbacks ) { 228 foreach ( $callbacks as $key => $callback ) { 229 if ( is_array( $callback['function'] ) ) { 230 $caller = $callback['function'][0]; 231 $name = $callback['function'][1]; 232 233 if ( 234 ( 'enqueue_frontend_scripts' === $name || 'enqueue_frontend_assets' === $name ) 235 && is_object( $caller ) 236 && ( get_class( $caller ) === 'Sensei_Course_Video_Settings' || get_class( $caller ) === 'Sensei_Pro_Interactive_Blocks\Interactive_Blocks' ) 237 ) { 238 remove_action( 'wp_enqueue_scripts', $callback['function'], $priority ); 239 } 240 } 241 } 242 } 243 } 244 } 245 246 /** 188 247 * Customize the syntax highlighter style. 189 248 * See https://github.com/PrismJS/prism-themes. -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.php
r13938 r13999 20 20 $script_asset['dependencies'], 21 21 $script_asset['version'], 22 true22 array( 'strategy' => 'defer' ) 23 23 ); 24 24 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2024/style.css
r13995 r13999 5 5 * Author URI: http://wordpress.org/ 6 6 * Description: A theme for learn.wordpress.org, built in 2024. 7 * Version: 1.0.0- c3323057 * Version: 1.0.0-f526184 8 8 * License: GNU General Public License v2 or later 9 9 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.