Making WordPress.org


Ignore:
Timestamp:
07/11/2018 09:05:30 PM (6 years ago)
Author:
obenland
Message:

WPorg: Use compressed scripts.

File:
1 edited

Legend:

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

    r7358 r7428  
    100100 */
    101101function scripts() {
     102    $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
     103    $suffix       = $script_debug ? '' : '.min';
     104
     105    // Concatenates core scripts when possible.
     106    if ( ! $script_debug ) {
     107        $GLOBALS['concatenate_scripts'] = true;
     108    }
     109
    102110    wp_enqueue_style( 'wporg-style', get_theme_file_uri( '/css/style.css' ), [ 'dashicons', 'open-sans' ], '20180702' );
    103111    wp_style_add_data( 'wporg-style', 'rtl', 'replace' );
    104112
    105113    // phpcs:ignore Squiz.PHP.CommentedOutCode.Found, Squiz.Commenting.InlineComment.InvalidEndChar
    106     // wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
    107     wp_enqueue_script( 'wporg-plugins-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
     114    // wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . "/js/navigation$suffix.js", array(), '20151215', true );
     115    wp_enqueue_script( 'wporg-plugins-skip-link-focus-fix', get_template_directory_uri() . "/js/skip-link-focus-fix$suffix.js", array(), '20151215', true );
    108116
    109117    if ( ! is_front_page() && is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
Note: See TracChangeset for help on using the changeset viewer.