Making WordPress.org

Ticket #5687: 5687.diff

File 5687.diff, 1.6 KB (added by ryelle, 3 years ago)
  • functions.php

     
    110110        wp_enqueue_style( 'wporg-style', get_theme_file_uri( '/css/style.css' ), [ 'dashicons', 'open-sans' ], '20200403' );
    111111        wp_style_add_data( 'wporg-style', 'rtl', 'replace' );
    112112
    113         // phpcs:ignore Squiz.PHP.CommentedOutCode.Found, Squiz.Commenting.InlineComment.InvalidEndChar
    114         // wp_enqueue_script( 'wporg-navigation', get_template_directory_uri() . "/js/navigation$suffix.js", array(), '20151215', true );
    115113        wp_enqueue_script( 'wporg-plugins-skip-link-focus-fix', get_template_directory_uri() . "/js/skip-link-focus-fix$suffix.js", array(), '20151215', true );
    116114
    117115        if ( ! is_front_page() && is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
     
    133131add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\scripts' );
    134132
    135133/**
     134 * Set up any scripts and styles for use in the child themes.
     135 *
     136 * This is given an earlier priority to ensure the assets are registered before the child theme uses them.
     137 */
     138function register_assets() {
     139        $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
     140        $suffix       = $script_debug ? '' : '.min';
     141
     142        wp_register_script(
     143                'wporg-navigation',
     144                get_template_directory_uri() . "/js/navigation$suffix.js",
     145                array(),
     146                '20210331',
     147                true
     148        );
     149}
     150add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\register_assets', 5 );
     151
     152/**
    136153 * Filters an enqueued style's fully-qualified URL.
    137154 *
    138155 * @param string $src    The source URL of the enqueued style.