Edit File by line
/home/barbar84/public_h.../wp-admin/includes
File: theme-install.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress Theme Installation Administration API
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
$themes_allowedtags = array(
[8] Fix | Delete
'a' => array(
[9] Fix | Delete
'href' => array(),
[10] Fix | Delete
'title' => array(),
[11] Fix | Delete
'target' => array(),
[12] Fix | Delete
),
[13] Fix | Delete
'abbr' => array( 'title' => array() ),
[14] Fix | Delete
'acronym' => array( 'title' => array() ),
[15] Fix | Delete
'code' => array(),
[16] Fix | Delete
'pre' => array(),
[17] Fix | Delete
'em' => array(),
[18] Fix | Delete
'strong' => array(),
[19] Fix | Delete
'div' => array(),
[20] Fix | Delete
'p' => array(),
[21] Fix | Delete
'ul' => array(),
[22] Fix | Delete
'ol' => array(),
[23] Fix | Delete
'li' => array(),
[24] Fix | Delete
'h1' => array(),
[25] Fix | Delete
'h2' => array(),
[26] Fix | Delete
'h3' => array(),
[27] Fix | Delete
'h4' => array(),
[28] Fix | Delete
'h5' => array(),
[29] Fix | Delete
'h6' => array(),
[30] Fix | Delete
'img' => array(
[31] Fix | Delete
'src' => array(),
[32] Fix | Delete
'class' => array(),
[33] Fix | Delete
'alt' => array(),
[34] Fix | Delete
),
[35] Fix | Delete
);
[36] Fix | Delete
[37] Fix | Delete
$theme_field_defaults = array(
[38] Fix | Delete
'description' => true,
[39] Fix | Delete
'sections' => false,
[40] Fix | Delete
'tested' => true,
[41] Fix | Delete
'requires' => true,
[42] Fix | Delete
'rating' => true,
[43] Fix | Delete
'downloaded' => true,
[44] Fix | Delete
'downloadlink' => true,
[45] Fix | Delete
'last_updated' => true,
[46] Fix | Delete
'homepage' => true,
[47] Fix | Delete
'tags' => true,
[48] Fix | Delete
'num_ratings' => true,
[49] Fix | Delete
);
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Retrieve list of WordPress theme features (aka theme tags).
[53] Fix | Delete
*
[54] Fix | Delete
* @since 2.8.0
[55] Fix | Delete
*
[56] Fix | Delete
* @deprecated 3.1.0 Use get_theme_feature_list() instead.
[57] Fix | Delete
*
[58] Fix | Delete
* @return array
[59] Fix | Delete
*/
[60] Fix | Delete
function install_themes_feature_list() {
[61] Fix | Delete
_deprecated_function( __FUNCTION__, '3.1.0', 'get_theme_feature_list()' );
[62] Fix | Delete
[63] Fix | Delete
$cache = get_transient( 'wporg_theme_feature_list' );
[64] Fix | Delete
if ( ! $cache ) {
[65] Fix | Delete
set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
if ( $cache ) {
[69] Fix | Delete
return $cache;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
$feature_list = themes_api( 'feature_list', array() );
[73] Fix | Delete
if ( is_wp_error( $feature_list ) ) {
[74] Fix | Delete
return array();
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
set_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );
[78] Fix | Delete
[79] Fix | Delete
return $feature_list;
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
/**
[83] Fix | Delete
* Display search form for searching themes.
[84] Fix | Delete
*
[85] Fix | Delete
* @since 2.8.0
[86] Fix | Delete
*
[87] Fix | Delete
* @param bool $type_selector
[88] Fix | Delete
*/
[89] Fix | Delete
function install_theme_search_form( $type_selector = true ) {
[90] Fix | Delete
$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
[91] Fix | Delete
$term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
[92] Fix | Delete
if ( ! $type_selector ) {
[93] Fix | Delete
echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
[94] Fix | Delete
}
[95] Fix | Delete
?>
[96] Fix | Delete
<form id="search-themes" method="get">
[97] Fix | Delete
<input type="hidden" name="tab" value="search" />
[98] Fix | Delete
<?php if ( $type_selector ) : ?>
[99] Fix | Delete
<label class="screen-reader-text" for="typeselector"><?php _e( 'Type of search' ); ?></label>
[100] Fix | Delete
<select name="type" id="typeselector">
[101] Fix | Delete
<option value="term" <?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option>
[102] Fix | Delete
<option value="author" <?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>
[103] Fix | Delete
<option value="tag" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option>
[104] Fix | Delete
</select>
[105] Fix | Delete
<label class="screen-reader-text" for="s">
[106] Fix | Delete
<?php
[107] Fix | Delete
switch ( $type ) {
[108] Fix | Delete
case 'term':
[109] Fix | Delete
_e( 'Search by keyword' );
[110] Fix | Delete
break;
[111] Fix | Delete
case 'author':
[112] Fix | Delete
_e( 'Search by author' );
[113] Fix | Delete
break;
[114] Fix | Delete
case 'tag':
[115] Fix | Delete
_e( 'Search by tag' );
[116] Fix | Delete
break;
[117] Fix | Delete
}
[118] Fix | Delete
?>
[119] Fix | Delete
</label>
[120] Fix | Delete
<?php else : ?>
[121] Fix | Delete
<label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label>
[122] Fix | Delete
<?php endif; ?>
[123] Fix | Delete
<input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" />
[124] Fix | Delete
<?php submit_button( __( 'Search' ), '', 'search', false ); ?>
[125] Fix | Delete
</form>
[126] Fix | Delete
<?php
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Display tags filter for themes.
[131] Fix | Delete
*
[132] Fix | Delete
* @since 2.8.0
[133] Fix | Delete
*/
[134] Fix | Delete
function install_themes_dashboard() {
[135] Fix | Delete
install_theme_search_form( false );
[136] Fix | Delete
?>
[137] Fix | Delete
<h4><?php _e( 'Feature Filter' ); ?></h4>
[138] Fix | Delete
<p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
[139] Fix | Delete
[140] Fix | Delete
<form method="get">
[141] Fix | Delete
<input type="hidden" name="tab" value="search" />
[142] Fix | Delete
<?php
[143] Fix | Delete
$feature_list = get_theme_feature_list();
[144] Fix | Delete
echo '<div class="feature-filter">';
[145] Fix | Delete
[146] Fix | Delete
foreach ( (array) $feature_list as $feature_name => $features ) {
[147] Fix | Delete
$feature_name = esc_html( $feature_name );
[148] Fix | Delete
echo '<div class="feature-name">' . $feature_name . '</div>';
[149] Fix | Delete
[150] Fix | Delete
echo '<ol class="feature-group">';
[151] Fix | Delete
foreach ( $features as $feature => $feature_name ) {
[152] Fix | Delete
$feature_name = esc_html( $feature_name );
[153] Fix | Delete
$feature = esc_attr( $feature );
[154] Fix | Delete
?>
[155] Fix | Delete
[156] Fix | Delete
<li>
[157] Fix | Delete
<input type="checkbox" name="features[]" id="feature-id-<?php echo $feature; ?>" value="<?php echo $feature; ?>" />
[158] Fix | Delete
<label for="feature-id-<?php echo $feature; ?>"><?php echo $feature_name; ?></label>
[159] Fix | Delete
</li>
[160] Fix | Delete
[161] Fix | Delete
<?php } ?>
[162] Fix | Delete
</ol>
[163] Fix | Delete
<br class="clear" />
[164] Fix | Delete
<?php
[165] Fix | Delete
}
[166] Fix | Delete
?>
[167] Fix | Delete
[168] Fix | Delete
</div>
[169] Fix | Delete
<br class="clear" />
[170] Fix | Delete
<?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>
[171] Fix | Delete
</form>
[172] Fix | Delete
<?php
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
/**
[176] Fix | Delete
* @since 2.8.0
[177] Fix | Delete
*/
[178] Fix | Delete
function install_themes_upload() {
[179] Fix | Delete
?>
[180] Fix | Delete
<p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install or update it by uploading it here.' ); ?></p>
[181] Fix | Delete
<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>">
[182] Fix | Delete
<?php wp_nonce_field( 'theme-upload' ); ?>
[183] Fix | Delete
<label class="screen-reader-text" for="themezip"><?php _e( 'Theme zip file' ); ?></label>
[184] Fix | Delete
<input type="file" id="themezip" name="themezip" accept=".zip"/>
[185] Fix | Delete
<?php submit_button( __( 'Install Now' ), '', 'install-theme-submit', false ); ?>
[186] Fix | Delete
</form>
[187] Fix | Delete
<?php
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
/**
[191] Fix | Delete
* Prints a theme on the Install Themes pages.
[192] Fix | Delete
*
[193] Fix | Delete
* @deprecated 3.4.0
[194] Fix | Delete
*
[195] Fix | Delete
* @global WP_Theme_Install_List_Table $wp_list_table
[196] Fix | Delete
*
[197] Fix | Delete
* @param object $theme
[198] Fix | Delete
*/
[199] Fix | Delete
function display_theme( $theme ) {
[200] Fix | Delete
_deprecated_function( __FUNCTION__, '3.4.0' );
[201] Fix | Delete
global $wp_list_table;
[202] Fix | Delete
if ( ! isset( $wp_list_table ) ) {
[203] Fix | Delete
$wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );
[204] Fix | Delete
}
[205] Fix | Delete
$wp_list_table->prepare_items();
[206] Fix | Delete
$wp_list_table->single_row( $theme );
[207] Fix | Delete
}
[208] Fix | Delete
[209] Fix | Delete
/**
[210] Fix | Delete
* Display theme content based on theme list.
[211] Fix | Delete
*
[212] Fix | Delete
* @since 2.8.0
[213] Fix | Delete
*
[214] Fix | Delete
* @global WP_Theme_Install_List_Table $wp_list_table
[215] Fix | Delete
*/
[216] Fix | Delete
function display_themes() {
[217] Fix | Delete
global $wp_list_table;
[218] Fix | Delete
[219] Fix | Delete
if ( ! isset( $wp_list_table ) ) {
[220] Fix | Delete
$wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );
[221] Fix | Delete
}
[222] Fix | Delete
$wp_list_table->prepare_items();
[223] Fix | Delete
$wp_list_table->display();
[224] Fix | Delete
[225] Fix | Delete
}
[226] Fix | Delete
[227] Fix | Delete
/**
[228] Fix | Delete
* Display theme information in dialog box form.
[229] Fix | Delete
*
[230] Fix | Delete
* @since 2.8.0
[231] Fix | Delete
*
[232] Fix | Delete
* @global WP_Theme_Install_List_Table $wp_list_table
[233] Fix | Delete
*/
[234] Fix | Delete
function install_theme_information() {
[235] Fix | Delete
global $wp_list_table;
[236] Fix | Delete
[237] Fix | Delete
$theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) );
[238] Fix | Delete
[239] Fix | Delete
if ( is_wp_error( $theme ) ) {
[240] Fix | Delete
wp_die( $theme );
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
iframe_header( __( 'Theme Installation' ) );
[244] Fix | Delete
if ( ! isset( $wp_list_table ) ) {
[245] Fix | Delete
$wp_list_table = _get_list_table( 'WP_Theme_Install_List_Table' );
[246] Fix | Delete
}
[247] Fix | Delete
$wp_list_table->theme_installer_single( $theme );
[248] Fix | Delete
iframe_footer();
[249] Fix | Delete
exit;
[250] Fix | Delete
}
[251] Fix | Delete
[252] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function