Edit File by line
/home/barbar84/public_h.../wp-conte.../themes/twentyni.../inc
File: back-compat.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Twenty Nineteen back compat functionality
[2] Fix | Delete
*
[3] Fix | Delete
* Prevents Twenty Nineteen from running on WordPress versions prior to 4.7,
[4] Fix | Delete
* since this theme is not meant to be backward compatible beyond that and
[5] Fix | Delete
* relies on many newer functions and markup changes introduced in 4.7.
[6] Fix | Delete
*
[7] Fix | Delete
* @package WordPress
[8] Fix | Delete
* @subpackage Twenty_Nineteen
[9] Fix | Delete
* @since Twenty Nineteen 1.0.0
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Prevent switching to Twenty Nineteen on old versions of WordPress.
[14] Fix | Delete
*
[15] Fix | Delete
* Switches to the default theme.
[16] Fix | Delete
*
[17] Fix | Delete
* @since Twenty Nineteen 1.0.0
[18] Fix | Delete
*/
[19] Fix | Delete
function twentynineteen_switch_theme() {
[20] Fix | Delete
switch_theme( WP_DEFAULT_THEME );
[21] Fix | Delete
unset( $_GET['activated'] );
[22] Fix | Delete
add_action( 'admin_notices', 'twentynineteen_upgrade_notice' );
[23] Fix | Delete
}
[24] Fix | Delete
add_action( 'after_switch_theme', 'twentynineteen_switch_theme' );
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* Adds a message for unsuccessful theme switch.
[28] Fix | Delete
*
[29] Fix | Delete
* Prints an update nag after an unsuccessful attempt to switch to
[30] Fix | Delete
* Twenty Nineteen on WordPress versions prior to 4.7.
[31] Fix | Delete
*
[32] Fix | Delete
* @since Twenty Nineteen 1.0.0
[33] Fix | Delete
*
[34] Fix | Delete
* @global string $wp_version WordPress version.
[35] Fix | Delete
*/
[36] Fix | Delete
function twentynineteen_upgrade_notice() {
[37] Fix | Delete
/* translators: %s: WordPress version. */
[38] Fix | Delete
$message = sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] );
[39] Fix | Delete
printf( '<div class="error"><p>%s</p></div>', $message );
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* Prevents the Customizer from being loaded on WordPress versions prior to 4.7.
[44] Fix | Delete
*
[45] Fix | Delete
* @since Twenty Nineteen 1.0.0
[46] Fix | Delete
*
[47] Fix | Delete
* @global string $wp_version WordPress version.
[48] Fix | Delete
*/
[49] Fix | Delete
function twentynineteen_customize() {
[50] Fix | Delete
wp_die(
[51] Fix | Delete
sprintf(
[52] Fix | Delete
/* translators: %s: WordPress version. */
[53] Fix | Delete
__( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ),
[54] Fix | Delete
$GLOBALS['wp_version']
[55] Fix | Delete
),
[56] Fix | Delete
'',
[57] Fix | Delete
array(
[58] Fix | Delete
'back_link' => true,
[59] Fix | Delete
)
[60] Fix | Delete
);
[61] Fix | Delete
}
[62] Fix | Delete
add_action( 'load-customize.php', 'twentynineteen_customize' );
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7.
[66] Fix | Delete
*
[67] Fix | Delete
* @since Twenty Nineteen 1.0.0
[68] Fix | Delete
*
[69] Fix | Delete
* @global string $wp_version WordPress version.
[70] Fix | Delete
*/
[71] Fix | Delete
function twentynineteen_preview() {
[72] Fix | Delete
if ( isset( $_GET['preview'] ) ) {
[73] Fix | Delete
/* translators: %s: WordPress version. */
[74] Fix | Delete
wp_die( sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ) );
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
add_action( 'template_redirect', 'twentynineteen_preview' );
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function