Ticket #35889: twenty-thirteen.2.patch
File twenty-thirteen.2.patch, 3.3 KB (added by , 9 years ago) |
---|
-
wp-content/themes/twentythirteen/inc/back-compat.php
3 3 * Twenty Thirteen back compat functionality 4 4 * 5 5 * Prevents Twenty Thirteen from running on WordPress versions prior to 3.6, 6 * since this theme is not meant to be backward compatible and relies on7 * many newfunctions and markup changes introduced in 3.6.6 * since this theme is not meant to be backward compatible beyond that and 7 * relies on many newer functions and markup changes introduced in 3.6. 8 8 * 9 9 * @package WordPress 10 10 * @subpackage Twenty_Thirteen … … 12 12 */ 13 13 14 14 /** 15 * Prevent switching to Twenty Thirteen on old versions of WordPress.15 * Prevent switching to Twenty Thirteen on unsupported versions of WordPress. 16 16 * 17 17 * Switches to the default theme. 18 18 * … … 29 29 * Add message for unsuccessful theme switch. 30 30 * 31 31 * Prints an update nag after an unsuccessful attempt to switch to 32 * Twenty Thirteen on WordPress versions prior to 3.6.32 * Twenty Thirteen on unsupported versions of WordPress. 33 33 * 34 34 * @since Twenty Thirteen 1.0 35 35 */ 36 36 function twentythirteen_upgrade_notice() { 37 $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'] ); 38 printf( '<div class="error"><p>%s</p></div>', $message ); 37 printf( '<div class="error"><p>%s</p></div>', twentythirteen_minimum_required_version_message() ); 39 38 } 40 39 41 40 /** 42 * Prevent the Customizer from being loaded on WordPress versions prior to 3.6.41 * Prevent the Customizer from being loaded on unsupported versions of WordPress. 43 42 * 44 43 * @since Twenty Thirteen 1.0 45 44 */ 46 45 function twentythirteen_customize() { 47 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']), '', array(46 wp_die( twentythirteen_minimum_required_version_message(), '', array( 48 47 'back_link' => true, 49 48 ) ); 50 49 } … … 51 50 add_action( 'load-customize.php', 'twentythirteen_customize' ); 52 51 53 52 /** 54 * Prevent the Theme Preview from being loaded on WordPress versions prior to 3.4.53 * Prevent the Theme Preview from being loaded on unsupported versions of WordPress. 55 54 * 56 55 * @since Twenty Thirteen 1.0 57 56 */ 58 57 function twentythirteen_preview() { 59 58 if ( isset( $_GET['preview'] ) ) { 60 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']) );59 wp_die( twentythirteen_minimum_required_version_message() ); 61 60 } 62 61 } 63 62 add_action( 'template_redirect', 'twentythirteen_preview' ); 63 64 /** 65 * Minimum required WordPress version message. 66 * 67 * @since Twenty Thirteen 1.9 68 * 69 * @global string $wp_version WordPress version. 70 * @return string 71 */ 72 function twentythirteen_minimum_required_version_message() { 73 $message = sprintf( 74 /* translators: %s: WordPress version */ 75 __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), 76 $GLOBALS['wp_version'] 77 ); 78 return $message; 79 }