Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../clone/wp-admin/includes
File: theme.php
/* translators: %s: URL to WordPress Updates screen. */
[1000] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[1001] Fix | Delete
self_admin_url( 'update-core.php' )
[1002] Fix | Delete
);
[1003] Fix | Delete
} elseif ( current_user_can( 'update_php' ) ) {
[1004] Fix | Delete
printf(
[1005] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[1006] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[1007] Fix | Delete
esc_url( wp_get_update_php_url() )
[1008] Fix | Delete
);
[1009] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[1010] Fix | Delete
}
[1011] Fix | Delete
?>
[1012] Fix | Delete
<# } else if ( ! data.compatibleWP ) { #>
[1013] Fix | Delete
<?php
[1014] Fix | Delete
_e( 'This theme does not work with your version of WordPress.' );
[1015] Fix | Delete
if ( current_user_can( 'update_core' ) ) {
[1016] Fix | Delete
printf(
[1017] Fix | Delete
/* translators: %s: URL to WordPress Updates screen. */
[1018] Fix | Delete
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
[1019] Fix | Delete
self_admin_url( 'update-core.php' )
[1020] Fix | Delete
);
[1021] Fix | Delete
}
[1022] Fix | Delete
?>
[1023] Fix | Delete
<# } else if ( ! data.compatiblePHP ) { #>
[1024] Fix | Delete
<?php
[1025] Fix | Delete
_e( 'This theme does not work with your version of PHP.' );
[1026] Fix | Delete
if ( current_user_can( 'update_php' ) ) {
[1027] Fix | Delete
printf(
[1028] Fix | Delete
/* translators: %s: URL to Update PHP page. */
[1029] Fix | Delete
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
[1030] Fix | Delete
esc_url( wp_get_update_php_url() )
[1031] Fix | Delete
);
[1032] Fix | Delete
wp_update_php_annotation( '</p><p><em>', '</em>' );
[1033] Fix | Delete
}
[1034] Fix | Delete
?>
[1035] Fix | Delete
<# } #>
[1036] Fix | Delete
</p></div>
[1037] Fix | Delete
<# } else if ( ! data.active && data.blockTheme ) { #>
[1038] Fix | Delete
<div class="notice notice-error notice-alt notice-large"><p>
[1039] Fix | Delete
<?php
[1040] Fix | Delete
_e( 'This theme doesn\'t support Customizer.' );
[1041] Fix | Delete
?>
[1042] Fix | Delete
<# if ( data.actions.activate ) { #>
[1043] Fix | Delete
<?php
[1044] Fix | Delete
printf(
[1045] Fix | Delete
/* translators: %s: URL to the themes page (also it activates the theme). */
[1046] Fix | Delete
' ' . __( 'However, you can still <a href="%s">activate this theme</a>, and use the Site Editor to customize it.' ),
[1047] Fix | Delete
'{{{ data.actions.activate }}}'
[1048] Fix | Delete
);
[1049] Fix | Delete
?>
[1050] Fix | Delete
<# } #>
[1051] Fix | Delete
</p></div>
[1052] Fix | Delete
<# } #>
[1053] Fix | Delete
[1054] Fix | Delete
<p class="theme-description">{{{ data.description }}}</p>
[1055] Fix | Delete
[1056] Fix | Delete
<# if ( data.tags ) { #>
[1057] Fix | Delete
<p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p>
[1058] Fix | Delete
<# } #>
[1059] Fix | Delete
</div>
[1060] Fix | Delete
</div>
[1061] Fix | Delete
[1062] Fix | Delete
<div class="theme-actions">
[1063] Fix | Delete
<# if ( data.active ) { #>
[1064] Fix | Delete
<button type="button" class="button button-primary customize-theme"><?php _e( 'Customize' ); ?></button>
[1065] Fix | Delete
<# } else if ( 'installed' === data.type ) { #>
[1066] Fix | Delete
<div class="theme-inactive-actions">
[1067] Fix | Delete
<# if ( data.blockTheme ) { #>
[1068] Fix | Delete
<?php
[1069] Fix | Delete
/* translators: %s: Theme name. */
[1070] Fix | Delete
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
[1071] Fix | Delete
?>
[1072] Fix | Delete
<# if ( data.compatibleWP && data.compatiblePHP && data.actions.activate ) { #>
[1073] Fix | Delete
<a href="{{{ data.actions.activate }}}" class="button button-primary activate" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
[1074] Fix | Delete
<# } #>
[1075] Fix | Delete
<# } else { #>
[1076] Fix | Delete
<# if ( data.compatibleWP && data.compatiblePHP ) { #>
[1077] Fix | Delete
<button type="button" class="button button-primary preview-theme" data-slug="{{ data.id }}"><?php _e( 'Live Preview' ); ?></button>
[1078] Fix | Delete
<# } else { #>
[1079] Fix | Delete
<button class="button button-primary disabled"><?php _e( 'Live Preview' ); ?></button>
[1080] Fix | Delete
<# } #>
[1081] Fix | Delete
<# } #>
[1082] Fix | Delete
</div>
[1083] Fix | Delete
<?php if ( current_user_can( 'delete_themes' ) ) { ?>
[1084] Fix | Delete
<# if ( data.actions && data.actions['delete'] ) { #>
[1085] Fix | Delete
<a href="{{{ data.actions['delete'] }}}" data-slug="{{ data.id }}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a>
[1086] Fix | Delete
<# } #>
[1087] Fix | Delete
<?php } ?>
[1088] Fix | Delete
<# } else { #>
[1089] Fix | Delete
<# if ( data.compatibleWP && data.compatiblePHP ) { #>
[1090] Fix | Delete
<button type="button" class="button theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></button>
[1091] Fix | Delete
<button type="button" class="button button-primary theme-install preview" data-slug="{{ data.id }}"><?php _e( 'Install &amp; Preview' ); ?></button>
[1092] Fix | Delete
<# } else { #>
[1093] Fix | Delete
<button type="button" class="button disabled"><?php _ex( 'Cannot Install', 'theme' ); ?></button>
[1094] Fix | Delete
<button type="button" class="button button-primary disabled"><?php _e( 'Install &amp; Preview' ); ?></button>
[1095] Fix | Delete
<# } #>
[1096] Fix | Delete
<# } #>
[1097] Fix | Delete
</div>
[1098] Fix | Delete
</div>
[1099] Fix | Delete
</script>
[1100] Fix | Delete
<?php
[1101] Fix | Delete
}
[1102] Fix | Delete
[1103] Fix | Delete
/**
[1104] Fix | Delete
* Determines whether a theme is technically active but was paused while
[1105] Fix | Delete
* loading.
[1106] Fix | Delete
*
[1107] Fix | Delete
* For more information on this and similar theme functions, check out
[1108] Fix | Delete
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
[1109] Fix | Delete
* Conditional Tags} article in the Theme Developer Handbook.
[1110] Fix | Delete
*
[1111] Fix | Delete
* @since 5.2.0
[1112] Fix | Delete
*
[1113] Fix | Delete
* @global WP_Paused_Extensions_Storage $_paused_themes
[1114] Fix | Delete
*
[1115] Fix | Delete
* @param string $theme Path to the theme directory relative to the themes directory.
[1116] Fix | Delete
* @return bool True, if in the list of paused themes. False, not in the list.
[1117] Fix | Delete
*/
[1118] Fix | Delete
function is_theme_paused( $theme ) {
[1119] Fix | Delete
if ( ! isset( $GLOBALS['_paused_themes'] ) ) {
[1120] Fix | Delete
return false;
[1121] Fix | Delete
}
[1122] Fix | Delete
[1123] Fix | Delete
if ( get_stylesheet() !== $theme && get_template() !== $theme ) {
[1124] Fix | Delete
return false;
[1125] Fix | Delete
}
[1126] Fix | Delete
[1127] Fix | Delete
return array_key_exists( $theme, $GLOBALS['_paused_themes'] );
[1128] Fix | Delete
}
[1129] Fix | Delete
[1130] Fix | Delete
/**
[1131] Fix | Delete
* Gets the error that was recorded for a paused theme.
[1132] Fix | Delete
*
[1133] Fix | Delete
* @since 5.2.0
[1134] Fix | Delete
*
[1135] Fix | Delete
* @global WP_Paused_Extensions_Storage $_paused_themes
[1136] Fix | Delete
*
[1137] Fix | Delete
* @param string $theme Path to the theme directory relative to the themes
[1138] Fix | Delete
* directory.
[1139] Fix | Delete
* @return array|false Array of error information as it was returned by
[1140] Fix | Delete
* `error_get_last()`, or false if none was recorded.
[1141] Fix | Delete
*/
[1142] Fix | Delete
function wp_get_theme_error( $theme ) {
[1143] Fix | Delete
if ( ! isset( $GLOBALS['_paused_themes'] ) ) {
[1144] Fix | Delete
return false;
[1145] Fix | Delete
}
[1146] Fix | Delete
[1147] Fix | Delete
if ( ! array_key_exists( $theme, $GLOBALS['_paused_themes'] ) ) {
[1148] Fix | Delete
return false;
[1149] Fix | Delete
}
[1150] Fix | Delete
[1151] Fix | Delete
return $GLOBALS['_paused_themes'][ $theme ];
[1152] Fix | Delete
}
[1153] Fix | Delete
[1154] Fix | Delete
/**
[1155] Fix | Delete
* Tries to resume a single theme.
[1156] Fix | Delete
*
[1157] Fix | Delete
* If a redirect was provided and a functions.php file was found, we first ensure that
[1158] Fix | Delete
* functions.php file does not throw fatal errors anymore.
[1159] Fix | Delete
*
[1160] Fix | Delete
* The way it works is by setting the redirection to the error before trying to
[1161] Fix | Delete
* include the file. If the theme fails, then the redirection will not be overwritten
[1162] Fix | Delete
* with the success message and the theme will not be resumed.
[1163] Fix | Delete
*
[1164] Fix | Delete
* @since 5.2.0
[1165] Fix | Delete
*
[1166] Fix | Delete
* @global string $wp_stylesheet_path Path to current theme's stylesheet directory.
[1167] Fix | Delete
* @global string $wp_template_path Path to current theme's template directory.
[1168] Fix | Delete
*
[1169] Fix | Delete
* @param string $theme Single theme to resume.
[1170] Fix | Delete
* @param string $redirect Optional. URL to redirect to. Default empty string.
[1171] Fix | Delete
* @return bool|WP_Error True on success, false if `$theme` was not paused,
[1172] Fix | Delete
* `WP_Error` on failure.
[1173] Fix | Delete
*/
[1174] Fix | Delete
function resume_theme( $theme, $redirect = '' ) {
[1175] Fix | Delete
global $wp_stylesheet_path, $wp_template_path;
[1176] Fix | Delete
[1177] Fix | Delete
list( $extension ) = explode( '/', $theme );
[1178] Fix | Delete
[1179] Fix | Delete
/*
[1180] Fix | Delete
* We'll override this later if the theme could be resumed without
[1181] Fix | Delete
* creating a fatal error.
[1182] Fix | Delete
*/
[1183] Fix | Delete
if ( ! empty( $redirect ) ) {
[1184] Fix | Delete
$functions_path = '';
[1185] Fix | Delete
if ( str_contains( $wp_stylesheet_path, $extension ) ) {
[1186] Fix | Delete
$functions_path = $wp_stylesheet_path . '/functions.php';
[1187] Fix | Delete
} elseif ( str_contains( $wp_template_path, $extension ) ) {
[1188] Fix | Delete
$functions_path = $wp_template_path . '/functions.php';
[1189] Fix | Delete
}
[1190] Fix | Delete
[1191] Fix | Delete
if ( ! empty( $functions_path ) ) {
[1192] Fix | Delete
wp_redirect(
[1193] Fix | Delete
add_query_arg(
[1194] Fix | Delete
'_error_nonce',
[1195] Fix | Delete
wp_create_nonce( 'theme-resume-error_' . $theme ),
[1196] Fix | Delete
$redirect
[1197] Fix | Delete
)
[1198] Fix | Delete
);
[1199] Fix | Delete
[1200] Fix | Delete
// Load the theme's functions.php to test whether it throws a fatal error.
[1201] Fix | Delete
ob_start();
[1202] Fix | Delete
if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
[1203] Fix | Delete
define( 'WP_SANDBOX_SCRAPING', true );
[1204] Fix | Delete
}
[1205] Fix | Delete
include $functions_path;
[1206] Fix | Delete
ob_clean();
[1207] Fix | Delete
}
[1208] Fix | Delete
}
[1209] Fix | Delete
[1210] Fix | Delete
$result = wp_paused_themes()->delete( $extension );
[1211] Fix | Delete
[1212] Fix | Delete
if ( ! $result ) {
[1213] Fix | Delete
return new WP_Error(
[1214] Fix | Delete
'could_not_resume_theme',
[1215] Fix | Delete
__( 'Could not resume the theme.' )
[1216] Fix | Delete
);
[1217] Fix | Delete
}
[1218] Fix | Delete
[1219] Fix | Delete
return true;
[1220] Fix | Delete
}
[1221] Fix | Delete
[1222] Fix | Delete
/**
[1223] Fix | Delete
* Renders an admin notice in case some themes have been paused due to errors.
[1224] Fix | Delete
*
[1225] Fix | Delete
* @since 5.2.0
[1226] Fix | Delete
*
[1227] Fix | Delete
* @global string $pagenow The filename of the current screen.
[1228] Fix | Delete
* @global WP_Paused_Extensions_Storage $_paused_themes
[1229] Fix | Delete
*/
[1230] Fix | Delete
function paused_themes_notice() {
[1231] Fix | Delete
if ( 'themes.php' === $GLOBALS['pagenow'] ) {
[1232] Fix | Delete
return;
[1233] Fix | Delete
}
[1234] Fix | Delete
[1235] Fix | Delete
if ( ! current_user_can( 'resume_themes' ) ) {
[1236] Fix | Delete
return;
[1237] Fix | Delete
}
[1238] Fix | Delete
[1239] Fix | Delete
if ( ! isset( $GLOBALS['_paused_themes'] ) || empty( $GLOBALS['_paused_themes'] ) ) {
[1240] Fix | Delete
return;
[1241] Fix | Delete
}
[1242] Fix | Delete
[1243] Fix | Delete
$message = sprintf(
[1244] Fix | Delete
'<p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p>',
[1245] Fix | Delete
__( 'One or more themes failed to load properly.' ),
[1246] Fix | Delete
__( 'You can find more details and make changes on the Themes screen.' ),
[1247] Fix | Delete
esc_url( admin_url( 'themes.php' ) ),
[1248] Fix | Delete
__( 'Go to the Themes screen' )
[1249] Fix | Delete
);
[1250] Fix | Delete
wp_admin_notice(
[1251] Fix | Delete
$message,
[1252] Fix | Delete
array(
[1253] Fix | Delete
'type' => 'error',
[1254] Fix | Delete
'paragraph_wrap' => false,
[1255] Fix | Delete
)
[1256] Fix | Delete
);
[1257] Fix | Delete
}
[1258] Fix | Delete
[1259] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function