Make WordPress Core

Ticket #25049: 25049.patch

File 25049.patch, 3.1 KB (added by Clorith, 13 years ago)
  • functions.php

     
    156156 * @return void
    157157 */
    158158function twentythirteen_scripts_styles() {
    159         // Adds JavaScript to pages with the comment form to support sites with
    160         // threaded comments (when in use).
    161         if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    162                 wp_enqueue_script( 'comment-reply' );
     159    // Only enqueue theme elements if we are on the front end
     160    if ( ! is_admin() )
     161    {
     162        // Adds JavaScript to pages with the comment form to support sites with
     163        // threaded comments (when in use).
     164        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
     165            wp_enqueue_script( 'comment-reply' );
    163166
    164         // Adds Masonry to handle vertical alignment of footer widgets.
    165         if ( is_active_sidebar( 'sidebar-1' ) )
    166                 wp_enqueue_script( 'jquery-masonry' );
     167        // Adds Masonry to handle vertical alignment of footer widgets.
     168        if ( is_active_sidebar( 'sidebar-1' ) )
     169            wp_enqueue_script( 'jquery-masonry' );
    167170
    168         // Loads JavaScript file with functionality specific to Twenty Thirteen.
    169         wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2013-07-18', true );
     171        // Loads JavaScript file with functionality specific to Twenty Thirteen.
     172        wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2013-07-18', true );
    170173
    171         // Add Open Sans and Bitter fonts, used in the main stylesheet.
    172         wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
     174        // Add Open Sans and Bitter fonts, used in the main stylesheet.
     175        wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
    173176
    174         // Add Genericons font, used in the main stylesheet.
    175         wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' );
     177        // Add Genericons font, used in the main stylesheet.
     178        wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' );
    176179
    177         // Loads our main stylesheet.
    178         wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );
     180        // Loads our main stylesheet.
     181        wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );
    179182
    180         // Loads the Internet Explorer specific stylesheet.
    181         wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );
    182         wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
     183        // Loads the Internet Explorer specific stylesheet.
     184        wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );
     185        wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
     186    }
    183187}
    184188add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );
    185189