Ticket #18302: 18302.9.diff
File 18302.9.diff, 7.5 KB (added by , 12 years ago) |
---|
-
wp-includes/link-template.php
2071 2071 } 2072 2072 2073 2073 /** 2074 * Retrieve the url of the template file. 2075 * 2076 * Searches in the stylesheet directory before the template directory so themes 2077 * which inherit from a parent theme can just overload one file. 2078 * 2079 * @since 3.5.0 2080 * 2081 * @param string $file Template file to search for. 2082 * @param boolean $overrideable Template file to search for. 2083 * @return string The URI of the file if one is located. 2084 */ 2085 function theme_url( $file = '', $overrideable = true ) { 2086 $file = ltrim( $file, '/' ); 2087 2088 if ( empty( $file ) || ( false !== strpos( $file, '..' ) ) ) { 2089 $url = get_stylesheet_directory_uri(); 2090 } elseif ( $overrideable && is_child_theme() && file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { 2091 $url = trailingslashit( get_stylesheet_directory_uri() ) . $file; 2092 } else { 2093 $url = trailingslashit( get_template_directory_uri() ) . $file; 2094 } 2095 2096 return apply_filters( 'theme_url', $url, $file, $overrideable ); 2097 } 2098 2099 /** 2074 2100 * Retrieve the site url for the current network. 2075 2101 * 2076 2102 * Returns the site url with the appropriate protocol, 'https' if -
wp-content/themes/twentytwelve/header.php
22 22 <link rel="profile" href="http://gmpg.org/xfn/11" /> 23 23 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 24 24 <!--[if lt IE 9]> 25 <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>25 <script src="<?php echo theme_url( 'js/html5.js' ); ?>" type="text/javascript"></script> 26 26 <![endif]--> 27 27 <?php wp_head(); ?> 28 28 </head> -
wp-content/themes/twentytwelve/functions.php
98 98 /* 99 99 * Adds JavaScript for handling the navigation menu hide-and-show behavior. 100 100 */ 101 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120824', true );101 wp_enqueue_script( 'twentytwelve-navigation', theme_url( '/js/navigation.js' ), array(), '20120824', true ); 102 102 103 103 /* 104 104 * Loads our special font CSS file. … … 427 427 * @since Twenty Twelve 1.0 428 428 */ 429 429 function twentytwelve_customize_preview_js() { 430 wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true );430 wp_enqueue_script( 'twentytwelve-customizer', theme_url( 'js/theme-customizer.js' ), array( 'customize-preview' ), '20120827', true ); 431 431 } 432 432 add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' ); -
wp-content/themes/twentyeleven/showcase.php
15 15 */ 16 16 17 17 // Enqueue showcase script for the slider 18 wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '2011-04-28' );18 wp_enqueue_script( 'twentyeleven-showcase', theme_url( 'js/showcase.js' ), array( 'jquery' ), '2011-04-28' ); 19 19 20 20 get_header(); ?> 21 21 -
wp-content/themes/twentyeleven/header.php
49 49 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> 50 50 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 51 51 <!--[if lt IE 9]> 52 <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>52 <script src="<?php echo theme_url( 'js/html5.js' ); ?>" type="text/javascript"></script> 53 53 <![endif]--> 54 54 <?php 55 55 /* We add some JavaScript to pages with the comment form -
wp-content/themes/twentyeleven/inc/theme-options.php
16 16 * 17 17 */ 18 18 function twentyeleven_admin_enqueue_scripts( $hook_suffix ) { 19 wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );20 wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' );19 wp_enqueue_style( 'twentyeleven-theme-options', theme_url( 'inc/theme-options.css' ), false, '2011-04-28' ); 20 wp_enqueue_script( 'twentyeleven-theme-options', theme_url( 'inc/theme-options.js' ), array( 'farbtastic' ), '2011-06-10' ); 21 21 wp_enqueue_style( 'farbtastic' ); 22 22 } 23 23 add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_admin_enqueue_scripts' ); … … 147 147 'light' => array( 148 148 'value' => 'light', 149 149 'label' => __( 'Light', 'twentyeleven' ), 150 'thumbnail' => get_template_directory_uri() . '/inc/images/light.png',150 'thumbnail' => theme_url( 'inc/images/light.png' ), 151 151 'default_link_color' => '#1b8be0', 152 152 ), 153 153 'dark' => array( 154 154 'value' => 'dark', 155 155 'label' => __( 'Dark', 'twentyeleven' ), 156 'thumbnail' => get_template_directory_uri() . '/inc/images/dark.png',156 'thumbnail' => theme_url( 'inc/images/dark.png' ), 157 157 'default_link_color' => '#e4741f', 158 158 ), 159 159 ); … … 171 171 'content-sidebar' => array( 172 172 'value' => 'content-sidebar', 173 173 'label' => __( 'Content on left', 'twentyeleven' ), 174 'thumbnail' => get_template_directory_uri() . '/inc/images/content-sidebar.png',174 'thumbnail' => theme_url( 'inc/images/content-sidebar.png' ), 175 175 ), 176 176 'sidebar-content' => array( 177 177 'value' => 'sidebar-content', 178 178 'label' => __( 'Content on right', 'twentyeleven' ), 179 'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content.png',179 'thumbnail' => theme_url( 'inc/images/sidebar-content.png' ), 180 180 ), 181 181 'content' => array( 182 182 'value' => 'content', 183 183 'label' => __( 'One-column, no sidebar', 'twentyeleven' ), 184 'thumbnail' => get_template_directory_uri() . '/inc/images/content.png',184 'thumbnail' => theme_url( 'inc/images/content.png' ), 185 185 ), 186 186 ); 187 187 … … 362 362 $color_scheme = $options['color_scheme']; 363 363 364 364 if ( 'dark' == $color_scheme ) 365 wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );365 wp_enqueue_style( 'dark', theme_url( 'colors/dark.css' ), array(), null ); 366 366 367 367 do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme ); 368 368 } … … 526 526 * @since Twenty Eleven 1.3 527 527 */ 528 528 function twentyeleven_customize_preview_js() { 529 wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20120523', true );529 wp_enqueue_script( 'twentyeleven-customizer', theme_url( 'inc/theme-customizer.js' ), array( 'customize-preview' ), '20120523', true ); 530 530 } 531 531 add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' ); 532 No newline at end of file