Ticket #35889: twenty-fourteen.2.patch
File twenty-fourteen.2.patch, 3.4 KB (added by , 9 years ago) |
---|
-
wp-content/themes/twentyfourteen/inc/back-compat.php
3 3 * Twenty Fourteen back compat functionality 4 4 * 5 5 * Prevents Twenty Fourteen from running on WordPress versions prior to 3.6, 6 * since this theme is not meant to be backward compatible beyond that 7 * andrelies on many newer functions 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_Fourteen … … 12 12 */ 13 13 14 14 /** 15 * Prevent switching to Twenty Fourteen on old versions of WordPress.15 * Prevent switching to Twenty Fourteen 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 Fourteen on WordPress versions prior to 3.6.32 * Twenty Fourteen on unsupported versions of WordPress. 33 33 * 34 34 * @since Twenty Fourteen 1.0 35 35 */ 36 36 function twentyfourteen_upgrade_notice() { 37 $message = sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ); 38 printf( '<div class="error"><p>%s</p></div>', $message ); 37 printf( '<div class="error"><p>%s</p></div>', twentyfourteen_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 Fourteen 1.0 45 44 */ 46 45 function twentyfourteen_customize() { 47 wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version']), '', array(46 wp_die( twentyfourteen_minimum_required_version_message(), '', array( 48 47 'back_link' => true, 49 48 ) ); 50 49 } … … 51 50 add_action( 'load-customize.php', 'twentyfourteen_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 Fourteen 1.0 57 56 */ 58 57 function twentyfourteen_preview() { 59 58 if ( isset( $_GET['preview'] ) ) { 60 wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version']) );59 wp_die( twentyfourteen_minimum_required_version_message() ); 61 60 } 62 61 } 63 62 add_action( 'template_redirect', 'twentyfourteen_preview' ); 63 64 /** 65 * Minimum required WordPress version message. 66 * 67 * @since Twenty Fourteen 1.7 68 * 69 * @global string $wp_version WordPress version. 70 * @return string 71 */ 72 function twentyfourteen_minimum_required_version_message() { 73 $message = sprintf( 74 /* translators: %s: WordPress version */ 75 __( 'Twenty Fourteen 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 }