Edit File by line
/home/barbar84/public_h.../wp-conte.../themes/twentytw.../inc
File: back-compat.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Back compat functionality
[2] Fix | Delete
*
[3] Fix | Delete
* Prevents the theme from running on WordPress versions prior to 5.3,
[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 5.3.
[6] Fix | Delete
*
[7] Fix | Delete
* @package WordPress
[8] Fix | Delete
* @subpackage Twenty_Twenty_One
[9] Fix | Delete
* @since Twenty Twenty-One 1.0
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Display upgrade notice on theme switch.
[14] Fix | Delete
*
[15] Fix | Delete
* @since Twenty Twenty-One 1.0
[16] Fix | Delete
*
[17] Fix | Delete
* @return void
[18] Fix | Delete
*/
[19] Fix | Delete
function twenty_twenty_one_switch_theme() {
[20] Fix | Delete
add_action( 'admin_notices', 'twenty_twenty_one_upgrade_notice' );
[21] Fix | Delete
}
[22] Fix | Delete
add_action( 'after_switch_theme', 'twenty_twenty_one_switch_theme' );
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Adds a message for unsuccessful theme switch.
[26] Fix | Delete
*
[27] Fix | Delete
* Prints an update nag after an unsuccessful attempt to switch to
[28] Fix | Delete
* the theme on WordPress versions prior to 5.3.
[29] Fix | Delete
*
[30] Fix | Delete
* @since Twenty Twenty-One 1.0
[31] Fix | Delete
*
[32] Fix | Delete
* @global string $wp_version WordPress version.
[33] Fix | Delete
*
[34] Fix | Delete
* @return void
[35] Fix | Delete
*/
[36] Fix | Delete
function twenty_twenty_one_upgrade_notice() {
[37] Fix | Delete
echo '<div class="error"><p>';
[38] Fix | Delete
printf(
[39] Fix | Delete
/* translators: %s: WordPress Version. */
[40] Fix | Delete
esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
[41] Fix | Delete
esc_html( $GLOBALS['wp_version'] )
[42] Fix | Delete
);
[43] Fix | Delete
echo '</p></div>';
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* Prevents the Customizer from being loaded on WordPress versions prior to 5.3.
[48] Fix | Delete
*
[49] Fix | Delete
* @since Twenty Twenty-One 1.0
[50] Fix | Delete
*
[51] Fix | Delete
* @global string $wp_version WordPress version.
[52] Fix | Delete
*
[53] Fix | Delete
* @return void
[54] Fix | Delete
*/
[55] Fix | Delete
function twenty_twenty_one_customize() {
[56] Fix | Delete
wp_die(
[57] Fix | Delete
sprintf(
[58] Fix | Delete
/* translators: %s: WordPress Version. */
[59] Fix | Delete
esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
[60] Fix | Delete
esc_html( $GLOBALS['wp_version'] )
[61] Fix | Delete
),
[62] Fix | Delete
'',
[63] Fix | Delete
array(
[64] Fix | Delete
'back_link' => true,
[65] Fix | Delete
)
[66] Fix | Delete
);
[67] Fix | Delete
}
[68] Fix | Delete
add_action( 'load-customize.php', 'twenty_twenty_one_customize' );
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Prevents the Theme Preview from being loaded on WordPress versions prior to 5.3.
[72] Fix | Delete
*
[73] Fix | Delete
* @since Twenty Twenty-One 1.0
[74] Fix | Delete
*
[75] Fix | Delete
* @global string $wp_version WordPress version.
[76] Fix | Delete
*
[77] Fix | Delete
* @return void
[78] Fix | Delete
*/
[79] Fix | Delete
function twenty_twenty_one_preview() {
[80] Fix | Delete
if ( isset( $_GET['preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
[81] Fix | Delete
wp_die(
[82] Fix | Delete
sprintf(
[83] Fix | Delete
/* translators: %s: WordPress Version. */
[84] Fix | Delete
esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
[85] Fix | Delete
esc_html( $GLOBALS['wp_version'] )
[86] Fix | Delete
)
[87] Fix | Delete
);
[88] Fix | Delete
}
[89] Fix | Delete
}
[90] Fix | Delete
add_action( 'template_redirect', 'twenty_twenty_one_preview' );
[91] Fix | Delete
[92] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function