Changeset 23837
- Timestamp:
- 03/28/2013 06:45:56 AM (12 years ago)
- Location:
- trunk/wp-content/themes/twentythirteen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentythirteen/functions.php
r23816 r23837 597 597 * Adds back compat handling for WP versions pre-3.6. 598 598 */ 599 require( get_template_directory() . '/inc/back-compat.php' ); 599 if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) 600 require( get_template_directory() . '/inc/back-compat.php' ); -
trunk/wp-content/themes/twentythirteen/inc/back-compat.php
r23825 r23837 1 1 <?php 2 /** 3 * Prevents Twenty Thirteen from running on WordPress versions prior to 3.6. 4 * 5 * Twenty Thirteen is not meant to be backwards compatible, since it relies on 6 * a lot of new functions and markup changes that were introduced in 3.6. 7 * 8 * @package WordPress 9 * @subpackage Twenty_Thirteen 10 * @since Twenty Thirteen 1.0 11 */ 12 2 13 /** 3 14 * Prevent switching to Twenty Thirteen on old versions of WordPress. Switches 4 15 * to the previously activated theme or the default theme. 16 * 17 * @since Twenty Thirteen 1.0 18 * 19 * @param string $theme_name 20 * @param WP_Theme $theme 21 * @return void 5 22 */ 6 23 function twentythirteen_switch_theme( $theme_name, $theme ) { 7 if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '>=' ) )8 return;9 10 24 if ( 'twentythirteen' != $theme->template ) 11 25 switch_theme( $theme->template, $theme->stylesheet ); … … 18 32 add_action( 'after_switch_theme', 'twentythirteen_switch_theme', 10, 2 ); 19 33 34 /** 35 * Prints an update nag after an unsuccessful attempt to switch to 36 * Twenty Thirteen on WordPress versions prior to 3.6. 37 * 38 * @since Twenty Thirteen 1.0 39 * 40 * @return void 41 */ 20 42 function twentythirteen_upgrade_notice() { 21 $message = sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.' ), $GLOBALS['wp_version'] );43 $message = sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ); 22 44 printf( '<div class="error"><p>%s</p></div>', $message ); 23 45 } 46 47 /** 48 * Prevents the Customizer from being loaded on WordPress versions prior to 3.6. 49 * 50 * @since Twenty Thirteen 1.0 51 * 52 * @return void 53 */ 54 function twentythirteen_customize() { 55 wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ) . sprintf( ' <a href="javascript:history.go(-1);">%s</a>', __( 'Go back.', 'twentythirteen' ) ) ); 56 } 57 add_action( 'load-customize.php', 'twentythirteen_customize' );
Note: See TracChangeset
for help on using the changeset viewer.