Make WordPress Core

Ticket #35889: twenty-thirteen.patch

File twenty-thirteen.patch, 2.2 KB (added by ramiy, 9 years ago)
  • wp-content/themes/twentythirteen/inc/back-compat.php

     
    3434 * @since Twenty Thirteen 1.0
    3535 */
    3636function 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() );
    3938}
    4039
    4140/**
     
    4443 * @since Twenty Thirteen 1.0
    4544 */
    4645function 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(
    4847                'back_link' => true,
    4948        ) );
    5049}
     
    5150add_action( 'load-customize.php', 'twentythirteen_customize' );
    5251
    5352/**
    54  * Prevent the Theme Preview from being loaded on WordPress versions prior to 3.4.
     53 * Prevent the Theme Preview from being loaded on WordPress versions prior to 3.6.
    5554 *
    5655 * @since Twenty Thirteen 1.0
    5756 */
    5857function twentythirteen_preview() {
    5958        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() );
    6160        }
    6261}
    6362add_action( 'template_redirect', 'twentythirteen_preview' );
     63
     64/**
     65 * Minimum required WordPress version message.
     66 *
     67 * @since Twenty Thirteen 1.9
     68 */
     69function twentythirteen_minimum_required_version_message() {
     70        $message = sprintf(
     71                /* translators: %s: WordPress version */
     72                __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ),
     73                $GLOBALS['wp_version']
     74        );
     75        return $message;
     76}