Making WordPress.org


Ignore:
Timestamp:
02/05/2014 08:08:56 PM (11 years ago)
Author:
nacin
Message:

WP.org P2: Re-register P2's iPhone styles with a media query, to avoid it from being served to desktops in caching situations. fixes #309.

File:
1 edited

Legend:

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

    r378 r379  
    1010    wp_deregister_style( 'p2' );
    1111    wp_register_style( 'p2', get_template_directory_uri() . '/style.css' );
    12     wp_enqueue_style( 'wporg-p2', get_stylesheet_uri(), array( 'p2' ), '2014-02-05a' );
     12    wp_enqueue_style( 'wporg-p2', get_stylesheet_uri(), array( 'p2' ), '2014-02-05b' );
    1313}
    1414
     
    6565}
    6666
    67  
     67function wporg_p2_iphone_style_override() {
     68    if ( p2_is_iphone() ) {
     69        wp_deregister_style( 'p2-iphone-style' );
     70    }
     71    wp_enqueue_style(
     72        'p2-iphone-style',
     73        get_template_directory_uri() . '/style-iphone.css',
     74        array(),
     75        '20120402',
     76        '(max-width: 320px)'
     77    );
     78}
     79add_action( 'wp_enqueue_scripts', 'wporg_p2_iphone_style_override', 1001 );
     80
Note: See TracChangeset for help on using the changeset viewer.