Making WordPress.org

Changeset 14031


Ignore:
Timestamp:
09/09/2024 04:54:04 AM (3 months ago)
Author:
adamwood
Message:

Make 2024: Fix style enqueuing order

See https://github.com/WordPress/wordpress.org/issues/363

File:
1 edited

Legend:

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

    r14025 r14031  
    3232
    3333/**
    34  * Enqueue scripts and styles.
    35  *
    36  * Enqueue existing wordpress.org/support stylesheets
    37  * @link https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/style
    38  */
    39 function wporg_breathe_scripts() {
     34 * Enqueue styles.
     35 */
     36function wporg_breathe_styles() {
    4037    wp_dequeue_style( 'wp4-styles' );
     38    wp_dequeue_style( 'breathe-style' );
     39    wp_enqueue_style( 'p2-breathe', get_template_directory_uri() . '/style.css' );
    4140
    4241    wp_enqueue_style(
     
    4645        filemtime( get_theme_root() . '/wporg-parent-2021/build/style.css' )
    4746    );
     47
    4848    wp_enqueue_style(
    4949        'wporg-parent-2021-block-styles',
     
    5353    );
    5454
     55    wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), filemtime( __DIR__ . '/style.css' ) );
     56
    5557    // Preload the heading font(s).
    5658    if ( is_callable( 'global_fonts_preload' ) ) {
     
    6163    }
    6264}
    63 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\wporg_breathe_scripts' );
     65add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\wporg_breathe_styles', 11 );
    6466
    6567/**
     
    269271    bloginfo( 'name' );
    270272}
    271 
    272 function styles() {
    273     wp_dequeue_style( 'breathe-style' );
    274     wp_enqueue_style( 'p2-breathe', get_template_directory_uri() . '/style.css' );
    275 
    276     wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), filemtime( __DIR__ . '/style.css' ) );
    277 }
    278 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 );
    279273
    280274function scripts() {
Note: See TracChangeset for help on using the changeset viewer.