Making WordPress.org


Ignore:
Timestamp:
01/11/2018 06:52:58 PM (9 years ago)
Author:
obenland
Message:

Themes: Sync Theme Dir styles with Plugin Dir

Brings details like button color or link decorations in sync with recent updates to w.org.

Props Shital Patel for initial patch.
Fixes #3297, #3298.

File:
1 edited

Legend:

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

    r6327 r6347  
    2626        remove_action( 'template_redirect', 'redirect_canonical' );
    2727        remove_action( 'template_redirect', 'wp_old_slug_redirect' );
     28
     29        add_theme_support( 'wp4-styles' );
    2830}
    2931add_action( 'after_setup_theme', 'wporg_themes_setup' );
     
    4143        }
    4244
    43         $stylesheet = get_stylesheet_uri();
    44         if ( is_rtl() ) {
    45                 $stylesheet = str_replace( '.css', '-rtl.css', $stylesheet );
    46         }
    47         wp_enqueue_style( 'wporg-themes', $stylesheet, array(), 13 );
     45        $rtl = is_rtl() ? '-rtl' : '';
     46        wp_enqueue_style( 'wporg-themes', get_stylesheet_directory_uri() . "/css/style{$rtl}.css", [ 'open-sans', 'dashicons' ], 13 );
    4847
    4948        if ( ! is_singular( 'page' ) ) {
     
    9291        // No Jetpack styles needed.
    9392        add_filter( 'jetpack_implode_frontend_css', '__return_false' );
    94 
    95         // No dashicons needed.
    96         wp_deregister_style( 'dashicons' );
    97         wp_register_style( 'dashicons', '' );
    9893
    9994        /*
Note: See TracChangeset for help on using the changeset viewer.