Edit File by line
/home/barbar84/public_h.../wp-admin/network
File: themes.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Multisite themes administration panel.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Multisite
[5] Fix | Delete
* @since 3.1.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/** Load WordPress Administration Bootstrap */
[9] Fix | Delete
require_once __DIR__ . '/admin.php';
[10] Fix | Delete
[11] Fix | Delete
if ( ! current_user_can( 'manage_network_themes' ) ) {
[12] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
[16] Fix | Delete
$pagenum = $wp_list_table->get_pagenum();
[17] Fix | Delete
[18] Fix | Delete
$action = $wp_list_table->current_action();
[19] Fix | Delete
[20] Fix | Delete
$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
[21] Fix | Delete
[22] Fix | Delete
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
[23] Fix | Delete
$temp_args = array(
[24] Fix | Delete
'enabled',
[25] Fix | Delete
'disabled',
[26] Fix | Delete
'deleted',
[27] Fix | Delete
'error',
[28] Fix | Delete
'enabled-auto-update',
[29] Fix | Delete
'disabled-auto-update',
[30] Fix | Delete
);
[31] Fix | Delete
[32] Fix | Delete
$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
[33] Fix | Delete
$referer = remove_query_arg( $temp_args, wp_get_referer() );
[34] Fix | Delete
[35] Fix | Delete
if ( $action ) {
[36] Fix | Delete
switch ( $action ) {
[37] Fix | Delete
case 'enable':
[38] Fix | Delete
check_admin_referer( 'enable-theme_' . $_GET['theme'] );
[39] Fix | Delete
WP_Theme::network_enable_theme( $_GET['theme'] );
[40] Fix | Delete
if ( false === strpos( $referer, '/network/themes.php' ) ) {
[41] Fix | Delete
wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
[42] Fix | Delete
} else {
[43] Fix | Delete
wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );
[44] Fix | Delete
}
[45] Fix | Delete
exit;
[46] Fix | Delete
case 'disable':
[47] Fix | Delete
check_admin_referer( 'disable-theme_' . $_GET['theme'] );
[48] Fix | Delete
WP_Theme::network_disable_theme( $_GET['theme'] );
[49] Fix | Delete
wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) );
[50] Fix | Delete
exit;
[51] Fix | Delete
case 'enable-selected':
[52] Fix | Delete
check_admin_referer( 'bulk-themes' );
[53] Fix | Delete
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
[54] Fix | Delete
if ( empty( $themes ) ) {
[55] Fix | Delete
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
[56] Fix | Delete
exit;
[57] Fix | Delete
}
[58] Fix | Delete
WP_Theme::network_enable_theme( (array) $themes );
[59] Fix | Delete
wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );
[60] Fix | Delete
exit;
[61] Fix | Delete
case 'disable-selected':
[62] Fix | Delete
check_admin_referer( 'bulk-themes' );
[63] Fix | Delete
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
[64] Fix | Delete
if ( empty( $themes ) ) {
[65] Fix | Delete
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
[66] Fix | Delete
exit;
[67] Fix | Delete
}
[68] Fix | Delete
WP_Theme::network_disable_theme( (array) $themes );
[69] Fix | Delete
wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );
[70] Fix | Delete
exit;
[71] Fix | Delete
case 'update-selected':
[72] Fix | Delete
check_admin_referer( 'bulk-themes' );
[73] Fix | Delete
[74] Fix | Delete
if ( isset( $_GET['themes'] ) ) {
[75] Fix | Delete
$themes = explode( ',', $_GET['themes'] );
[76] Fix | Delete
} elseif ( isset( $_POST['checked'] ) ) {
[77] Fix | Delete
$themes = (array) $_POST['checked'];
[78] Fix | Delete
} else {
[79] Fix | Delete
$themes = array();
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
$title = __( 'Update Themes' );
[83] Fix | Delete
$parent_file = 'themes.php';
[84] Fix | Delete
[85] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[86] Fix | Delete
[87] Fix | Delete
echo '<div class="wrap">';
[88] Fix | Delete
echo '<h1>' . esc_html( $title ) . '</h1>';
[89] Fix | Delete
[90] Fix | Delete
$url = self_admin_url( 'update.php?action=update-selected-themes&amp;themes=' . urlencode( implode( ',', $themes ) ) );
[91] Fix | Delete
$url = wp_nonce_url( $url, 'bulk-update-themes' );
[92] Fix | Delete
[93] Fix | Delete
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
[94] Fix | Delete
echo '</div>';
[95] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[96] Fix | Delete
exit;
[97] Fix | Delete
case 'delete-selected':
[98] Fix | Delete
if ( ! current_user_can( 'delete_themes' ) ) {
[99] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to delete themes for this site.' ) );
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
check_admin_referer( 'bulk-themes' );
[103] Fix | Delete
[104] Fix | Delete
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
[105] Fix | Delete
[106] Fix | Delete
if ( empty( $themes ) ) {
[107] Fix | Delete
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
[108] Fix | Delete
exit;
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
$themes = array_diff( $themes, array( get_option( 'stylesheet' ), get_option( 'template' ) ) );
[112] Fix | Delete
[113] Fix | Delete
if ( empty( $themes ) ) {
[114] Fix | Delete
wp_safe_redirect( add_query_arg( 'error', 'main', $referer ) );
[115] Fix | Delete
exit;
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
$theme_info = array();
[119] Fix | Delete
foreach ( $themes as $key => $theme ) {
[120] Fix | Delete
$theme_info[ $theme ] = wp_get_theme( $theme );
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
require ABSPATH . 'wp-admin/update.php';
[124] Fix | Delete
[125] Fix | Delete
$parent_file = 'themes.php';
[126] Fix | Delete
[127] Fix | Delete
if ( ! isset( $_REQUEST['verify-delete'] ) ) {
[128] Fix | Delete
wp_enqueue_script( 'jquery' );
[129] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[130] Fix | Delete
$themes_to_delete = count( $themes );
[131] Fix | Delete
?>
[132] Fix | Delete
<div class="wrap">
[133] Fix | Delete
<?php if ( 1 === $themes_to_delete ) : ?>
[134] Fix | Delete
<h1><?php _e( 'Delete Theme' ); ?></h1>
[135] Fix | Delete
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This theme may be active on other sites in the network.' ); ?></p></div>
[136] Fix | Delete
<p><?php _e( 'You are about to remove the following theme:' ); ?></p>
[137] Fix | Delete
<?php else : ?>
[138] Fix | Delete
<h1><?php _e( 'Delete Themes' ); ?></h1>
[139] Fix | Delete
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These themes may be active on other sites in the network.' ); ?></p></div>
[140] Fix | Delete
<p><?php _e( 'You are about to remove the following themes:' ); ?></p>
[141] Fix | Delete
<?php endif; ?>
[142] Fix | Delete
<ul class="ul-disc">
[143] Fix | Delete
<?php
[144] Fix | Delete
foreach ( $theme_info as $theme ) {
[145] Fix | Delete
echo '<li>' . sprintf(
[146] Fix | Delete
/* translators: 1: Theme name, 2: Theme author. */
[147] Fix | Delete
_x( '%1$s by %2$s', 'theme' ),
[148] Fix | Delete
'<strong>' . $theme->display( 'Name' ) . '</strong>',
[149] Fix | Delete
'<em>' . $theme->display( 'Author' ) . '</em>'
[150] Fix | Delete
) . '</li>';
[151] Fix | Delete
}
[152] Fix | Delete
?>
[153] Fix | Delete
</ul>
[154] Fix | Delete
<?php if ( 1 === $themes_to_delete ) : ?>
[155] Fix | Delete
<p><?php _e( 'Are you sure you want to delete this theme?' ); ?></p>
[156] Fix | Delete
<?php else : ?>
[157] Fix | Delete
<p><?php _e( 'Are you sure you want to delete these themes?' ); ?></p>
[158] Fix | Delete
<?php endif; ?>
[159] Fix | Delete
<form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" style="display:inline;">
[160] Fix | Delete
<input type="hidden" name="verify-delete" value="1" />
[161] Fix | Delete
<input type="hidden" name="action" value="delete-selected" />
[162] Fix | Delete
<?php
[163] Fix | Delete
[164] Fix | Delete
foreach ( (array) $themes as $theme ) {
[165] Fix | Delete
echo '<input type="hidden" name="checked[]" value="' . esc_attr( $theme ) . '" />';
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
wp_nonce_field( 'bulk-themes' );
[169] Fix | Delete
[170] Fix | Delete
if ( 1 === $themes_to_delete ) {
[171] Fix | Delete
submit_button( __( 'Yes, delete this theme' ), '', 'submit', false );
[172] Fix | Delete
} else {
[173] Fix | Delete
submit_button( __( 'Yes, delete these themes' ), '', 'submit', false );
[174] Fix | Delete
}
[175] Fix | Delete
[176] Fix | Delete
?>
[177] Fix | Delete
</form>
[178] Fix | Delete
<?php $referer = wp_get_referer(); ?>
[179] Fix | Delete
<form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
[180] Fix | Delete
<?php submit_button( __( 'No, return me to the theme list' ), '', 'submit', false ); ?>
[181] Fix | Delete
</form>
[182] Fix | Delete
</div>
[183] Fix | Delete
<?php
[184] Fix | Delete
[185] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[186] Fix | Delete
exit;
[187] Fix | Delete
} // End if verify-delete.
[188] Fix | Delete
[189] Fix | Delete
foreach ( $themes as $theme ) {
[190] Fix | Delete
$delete_result = delete_theme(
[191] Fix | Delete
$theme,
[192] Fix | Delete
esc_url(
[193] Fix | Delete
add_query_arg(
[194] Fix | Delete
array(
[195] Fix | Delete
'verify-delete' => 1,
[196] Fix | Delete
'action' => 'delete-selected',
[197] Fix | Delete
'checked' => $_REQUEST['checked'],
[198] Fix | Delete
'_wpnonce' => $_REQUEST['_wpnonce'],
[199] Fix | Delete
),
[200] Fix | Delete
network_admin_url( 'themes.php' )
[201] Fix | Delete
)
[202] Fix | Delete
)
[203] Fix | Delete
);
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
$paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;
[207] Fix | Delete
wp_redirect(
[208] Fix | Delete
add_query_arg(
[209] Fix | Delete
array(
[210] Fix | Delete
'deleted' => count( $themes ),
[211] Fix | Delete
'paged' => $paged,
[212] Fix | Delete
's' => $s,
[213] Fix | Delete
),
[214] Fix | Delete
network_admin_url( 'themes.php' )
[215] Fix | Delete
)
[216] Fix | Delete
);
[217] Fix | Delete
exit;
[218] Fix | Delete
case 'enable-auto-update':
[219] Fix | Delete
case 'disable-auto-update':
[220] Fix | Delete
case 'enable-auto-update-selected':
[221] Fix | Delete
case 'disable-auto-update-selected':
[222] Fix | Delete
if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) {
[223] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to change themes automatic update settings.' ) );
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
if ( 'enable-auto-update' === $action || 'disable-auto-update' === $action ) {
[227] Fix | Delete
check_admin_referer( 'updates' );
[228] Fix | Delete
} else {
[229] Fix | Delete
if ( empty( $_POST['checked'] ) ) {
[230] Fix | Delete
// Nothing to do.
[231] Fix | Delete
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
[232] Fix | Delete
exit;
[233] Fix | Delete
}
[234] Fix | Delete
[235] Fix | Delete
check_admin_referer( 'bulk-themes' );
[236] Fix | Delete
}
[237] Fix | Delete
[238] Fix | Delete
$auto_updates = (array) get_site_option( 'auto_update_themes', array() );
[239] Fix | Delete
[240] Fix | Delete
if ( 'enable-auto-update' === $action ) {
[241] Fix | Delete
$auto_updates[] = $_GET['theme'];
[242] Fix | Delete
$auto_updates = array_unique( $auto_updates );
[243] Fix | Delete
$referer = add_query_arg( 'enabled-auto-update', 1, $referer );
[244] Fix | Delete
} elseif ( 'disable-auto-update' === $action ) {
[245] Fix | Delete
$auto_updates = array_diff( $auto_updates, array( $_GET['theme'] ) );
[246] Fix | Delete
$referer = add_query_arg( 'disabled-auto-update', 1, $referer );
[247] Fix | Delete
} else {
[248] Fix | Delete
// Bulk enable/disable.
[249] Fix | Delete
$themes = (array) wp_unslash( $_POST['checked'] );
[250] Fix | Delete
[251] Fix | Delete
if ( 'enable-auto-update-selected' === $action ) {
[252] Fix | Delete
$auto_updates = array_merge( $auto_updates, $themes );
[253] Fix | Delete
$auto_updates = array_unique( $auto_updates );
[254] Fix | Delete
$referer = add_query_arg( 'enabled-auto-update', count( $themes ), $referer );
[255] Fix | Delete
} else {
[256] Fix | Delete
$auto_updates = array_diff( $auto_updates, $themes );
[257] Fix | Delete
$referer = add_query_arg( 'disabled-auto-update', count( $themes ), $referer );
[258] Fix | Delete
}
[259] Fix | Delete
}
[260] Fix | Delete
[261] Fix | Delete
$all_items = wp_get_themes();
[262] Fix | Delete
[263] Fix | Delete
// Remove themes that don't exist or have been deleted since the option was last updated.
[264] Fix | Delete
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );
[265] Fix | Delete
[266] Fix | Delete
update_site_option( 'auto_update_themes', $auto_updates );
[267] Fix | Delete
[268] Fix | Delete
wp_safe_redirect( $referer );
[269] Fix | Delete
exit;
[270] Fix | Delete
default:
[271] Fix | Delete
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
[272] Fix | Delete
if ( empty( $themes ) ) {
[273] Fix | Delete
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
[274] Fix | Delete
exit;
[275] Fix | Delete
}
[276] Fix | Delete
check_admin_referer( 'bulk-themes' );
[277] Fix | Delete
[278] Fix | Delete
/** This action is documented in wp-admin/network/site-themes.php */
[279] Fix | Delete
$referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $themes ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[280] Fix | Delete
[281] Fix | Delete
wp_safe_redirect( $referer );
[282] Fix | Delete
exit;
[283] Fix | Delete
}
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
$wp_list_table->prepare_items();
[287] Fix | Delete
[288] Fix | Delete
add_thickbox();
[289] Fix | Delete
[290] Fix | Delete
add_screen_option( 'per_page' );
[291] Fix | Delete
[292] Fix | Delete
get_current_screen()->add_help_tab(
[293] Fix | Delete
array(
[294] Fix | Delete
'id' => 'overview',
[295] Fix | Delete
'title' => __( 'Overview' ),
[296] Fix | Delete
'content' =>
[297] Fix | Delete
'<p>' . __( 'This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.' ) . '</p>' .
[298] Fix | Delete
'<p>' . __( 'If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site&#8217;s Appearance > Themes screen.' ) . '</p>' .
[299] Fix | Delete
'<p>' . __( 'Themes can be enabled on a site by site basis by the network admin on the Edit Site screen (which has a Themes tab); get there via the Edit action link on the All Sites screen. Only network admins are able to install or edit themes.' ) . '</p>',
[300] Fix | Delete
)
[301] Fix | Delete
);
[302] Fix | Delete
[303] Fix | Delete
$help_sidebar_autoupdates = '';
[304] Fix | Delete
[305] Fix | Delete
if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) {
[306] Fix | Delete
get_current_screen()->add_help_tab(
[307] Fix | Delete
array(
[308] Fix | Delete
'id' => 'plugins-themes-auto-updates',
[309] Fix | Delete
'title' => __( 'Auto-updates' ),
[310] Fix | Delete
'content' =>
[311] Fix | Delete
'<p>' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' .
[312] Fix | Delete
'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>',
[313] Fix | Delete
)
[314] Fix | Delete
);
[315] Fix | Delete
[316] Fix | Delete
$help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/support/article/plugins-themes-auto-updates/">Learn more: Auto-updates documentation</a>' ) . '</p>';
[317] Fix | Delete
}
[318] Fix | Delete
[319] Fix | Delete
get_current_screen()->set_help_sidebar(
[320] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[321] Fix | Delete
'<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Themes_Screen">Documentation on Network Themes</a>' ) . '</p>' .
[322] Fix | Delete
$help_sidebar_autoupdates .
[323] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[324] Fix | Delete
);
[325] Fix | Delete
[326] Fix | Delete
get_current_screen()->set_screen_reader_content(
[327] Fix | Delete
array(
[328] Fix | Delete
'heading_views' => __( 'Filter themes list' ),
[329] Fix | Delete
'heading_pagination' => __( 'Themes list navigation' ),
[330] Fix | Delete
'heading_list' => __( 'Themes list' ),
[331] Fix | Delete
)
[332] Fix | Delete
);
[333] Fix | Delete
[334] Fix | Delete
$title = __( 'Themes' );
[335] Fix | Delete
$parent_file = 'themes.php';
[336] Fix | Delete
[337] Fix | Delete
wp_enqueue_script( 'updates' );
[338] Fix | Delete
wp_enqueue_script( 'theme-preview' );
[339] Fix | Delete
[340] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[341] Fix | Delete
[342] Fix | Delete
?>
[343] Fix | Delete
[344] Fix | Delete
<div class="wrap">
[345] Fix | Delete
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
[346] Fix | Delete
[347] Fix | Delete
<?php if ( current_user_can( 'install_themes' ) ) : ?>
[348] Fix | Delete
<a href="theme-install.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'theme' ); ?></a>
[349] Fix | Delete
<?php endif; ?>
[350] Fix | Delete
[351] Fix | Delete
<?php
[352] Fix | Delete
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
[353] Fix | Delete
echo '<span class="subtitle">';
[354] Fix | Delete
printf(
[355] Fix | Delete
/* translators: %s: Search query. */
[356] Fix | Delete
__( 'Search results for: %s' ),
[357] Fix | Delete
'<strong>' . esc_html( $s ) . '</strong>'
[358] Fix | Delete
);
[359] Fix | Delete
echo '</span>';
[360] Fix | Delete
}
[361] Fix | Delete
?>
[362] Fix | Delete
[363] Fix | Delete
<hr class="wp-header-end">
[364] Fix | Delete
[365] Fix | Delete
<?php
[366] Fix | Delete
if ( isset( $_GET['enabled'] ) ) {
[367] Fix | Delete
$enabled = absint( $_GET['enabled'] );
[368] Fix | Delete
if ( 1 === $enabled ) {
[369] Fix | Delete
$message = __( 'Theme enabled.' );
[370] Fix | Delete
} else {
[371] Fix | Delete
/* translators: %s: Number of themes. */
[372] Fix | Delete
$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
[373] Fix | Delete
}
[374] Fix | Delete
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
[375] Fix | Delete
} elseif ( isset( $_GET['disabled'] ) ) {
[376] Fix | Delete
$disabled = absint( $_GET['disabled'] );
[377] Fix | Delete
if ( 1 === $disabled ) {
[378] Fix | Delete
$message = __( 'Theme disabled.' );
[379] Fix | Delete
} else {
[380] Fix | Delete
/* translators: %s: Number of themes. */
[381] Fix | Delete
$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
[382] Fix | Delete
}
[383] Fix | Delete
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
[384] Fix | Delete
} elseif ( isset( $_GET['deleted'] ) ) {
[385] Fix | Delete
$deleted = absint( $_GET['deleted'] );
[386] Fix | Delete
if ( 1 === $deleted ) {
[387] Fix | Delete
$message = __( 'Theme deleted.' );
[388] Fix | Delete
} else {
[389] Fix | Delete
/* translators: %s: Number of themes. */
[390] Fix | Delete
$message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
[391] Fix | Delete
}
[392] Fix | Delete
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
[393] Fix | Delete
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
[394] Fix | Delete
$enabled = absint( $_GET['enabled-auto-update'] );
[395] Fix | Delete
if ( 1 === $enabled ) {
[396] Fix | Delete
$message = __( 'Theme will be auto-updated.' );
[397] Fix | Delete
} else {
[398] Fix | Delete
/* translators: %s: Number of themes. */
[399] Fix | Delete
$message = _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled );
[400] Fix | Delete
}
[401] Fix | Delete
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
[402] Fix | Delete
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
[403] Fix | Delete
$disabled = absint( $_GET['disabled-auto-update'] );
[404] Fix | Delete
if ( 1 === $disabled ) {
[405] Fix | Delete
$message = __( 'Theme will no longer be auto-updated.' );
[406] Fix | Delete
} else {
[407] Fix | Delete
/* translators: %s: Number of themes. */
[408] Fix | Delete
$message = _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled );
[409] Fix | Delete
}
[410] Fix | Delete
echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
[411] Fix | Delete
} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
[412] Fix | Delete
echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
[413] Fix | Delete
} elseif ( isset( $_GET['error'] ) && 'main' === $_GET['error'] ) {
[414] Fix | Delete
echo '<div class="error notice is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
[415] Fix | Delete
}
[416] Fix | Delete
[417] Fix | Delete
?>
[418] Fix | Delete
[419] Fix | Delete
<form method="get">
[420] Fix | Delete
<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
[421] Fix | Delete
</form>
[422] Fix | Delete
[423] Fix | Delete
<?php
[424] Fix | Delete
$wp_list_table->views();
[425] Fix | Delete
[426] Fix | Delete
if ( 'broken' === $status ) {
[427] Fix | Delete
echo '<p class="clear">' . __( 'The following themes are installed but incomplete.' ) . '</p>';
[428] Fix | Delete
}
[429] Fix | Delete
?>
[430] Fix | Delete
[431] Fix | Delete
<form id="bulk-action-form" method="post">
[432] Fix | Delete
<input type="hidden" name="theme_status" value="<?php echo esc_attr( $status ); ?>" />
[433] Fix | Delete
<input type="hidden" name="paged" value="<?php echo esc_attr( $page ); ?>" />
[434] Fix | Delete
[435] Fix | Delete
<?php $wp_list_table->display(); ?>
[436] Fix | Delete
</form>
[437] Fix | Delete
[438] Fix | Delete
</div>
[439] Fix | Delete
[440] Fix | Delete
<?php
[441] Fix | Delete
wp_print_request_filesystem_credentials_modal();
[442] Fix | Delete
wp_print_admin_notice_templates();
[443] Fix | Delete
wp_print_update_row_templates();
[444] Fix | Delete
[445] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[446] Fix | Delete
[447] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function