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.../wp-inclu...
File: class-wp-theme.php
$this->cache_add(
[500] Fix | Delete
'theme',
[501] Fix | Delete
array(
[502] Fix | Delete
'block_template_folders' => $this->get_block_template_folders(),
[503] Fix | Delete
'block_theme' => $this->is_block_theme(),
[504] Fix | Delete
'headers' => $this->headers,
[505] Fix | Delete
'errors' => $this->errors,
[506] Fix | Delete
'stylesheet' => $this->stylesheet,
[507] Fix | Delete
'template' => $this->template,
[508] Fix | Delete
)
[509] Fix | Delete
);
[510] Fix | Delete
}
[511] Fix | Delete
return;
[512] Fix | Delete
}
[513] Fix | Delete
// Set the parent. Pass the current instance so we can do the checks above and assess errors.
[514] Fix | Delete
$this->parent = new WP_Theme( $this->template, isset( $theme_root_template ) ? $theme_root_template : $this->theme_root, $this );
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
if ( wp_paused_themes()->get( $this->stylesheet ) && ( ! is_wp_error( $this->errors ) || ! isset( $this->errors->errors['theme_paused'] ) ) ) {
[518] Fix | Delete
$this->errors = new WP_Error( 'theme_paused', __( 'This theme failed to load properly and was paused within the admin backend.' ) );
[519] Fix | Delete
}
[520] Fix | Delete
[521] Fix | Delete
// We're good. If we didn't retrieve from cache, set it.
[522] Fix | Delete
if ( ! is_array( $cache ) ) {
[523] Fix | Delete
$cache = array(
[524] Fix | Delete
'block_theme' => $this->is_block_theme(),
[525] Fix | Delete
'block_template_folders' => $this->get_block_template_folders(),
[526] Fix | Delete
'headers' => $this->headers,
[527] Fix | Delete
'errors' => $this->errors,
[528] Fix | Delete
'stylesheet' => $this->stylesheet,
[529] Fix | Delete
'template' => $this->template,
[530] Fix | Delete
);
[531] Fix | Delete
// If the parent theme is in another root, we'll want to cache this. Avoids an entire branch of filesystem calls above.
[532] Fix | Delete
if ( isset( $theme_root_template ) ) {
[533] Fix | Delete
$cache['theme_root_template'] = $theme_root_template;
[534] Fix | Delete
}
[535] Fix | Delete
$this->cache_add( 'theme', $cache );
[536] Fix | Delete
}
[537] Fix | Delete
}
[538] Fix | Delete
[539] Fix | Delete
/**
[540] Fix | Delete
* When converting the object to a string, the theme name is returned.
[541] Fix | Delete
*
[542] Fix | Delete
* @since 3.4.0
[543] Fix | Delete
*
[544] Fix | Delete
* @return string Theme name, ready for display (translated)
[545] Fix | Delete
*/
[546] Fix | Delete
public function __toString() {
[547] Fix | Delete
return (string) $this->display( 'Name' );
[548] Fix | Delete
}
[549] Fix | Delete
[550] Fix | Delete
/**
[551] Fix | Delete
* __isset() magic method for properties formerly returned by current_theme_info()
[552] Fix | Delete
*
[553] Fix | Delete
* @since 3.4.0
[554] Fix | Delete
*
[555] Fix | Delete
* @param string $offset Property to check if set.
[556] Fix | Delete
* @return bool Whether the given property is set.
[557] Fix | Delete
*/
[558] Fix | Delete
public function __isset( $offset ) {
[559] Fix | Delete
static $properties = array(
[560] Fix | Delete
'name',
[561] Fix | Delete
'title',
[562] Fix | Delete
'version',
[563] Fix | Delete
'parent_theme',
[564] Fix | Delete
'template_dir',
[565] Fix | Delete
'stylesheet_dir',
[566] Fix | Delete
'template',
[567] Fix | Delete
'stylesheet',
[568] Fix | Delete
'screenshot',
[569] Fix | Delete
'description',
[570] Fix | Delete
'author',
[571] Fix | Delete
'tags',
[572] Fix | Delete
'theme_root',
[573] Fix | Delete
'theme_root_uri',
[574] Fix | Delete
);
[575] Fix | Delete
[576] Fix | Delete
return in_array( $offset, $properties, true );
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
/**
[580] Fix | Delete
* __get() magic method for properties formerly returned by current_theme_info()
[581] Fix | Delete
*
[582] Fix | Delete
* @since 3.4.0
[583] Fix | Delete
*
[584] Fix | Delete
* @param string $offset Property to get.
[585] Fix | Delete
* @return mixed Property value.
[586] Fix | Delete
*/
[587] Fix | Delete
public function __get( $offset ) {
[588] Fix | Delete
switch ( $offset ) {
[589] Fix | Delete
case 'name':
[590] Fix | Delete
case 'title':
[591] Fix | Delete
return $this->get( 'Name' );
[592] Fix | Delete
case 'version':
[593] Fix | Delete
return $this->get( 'Version' );
[594] Fix | Delete
case 'parent_theme':
[595] Fix | Delete
return $this->parent() ? $this->parent()->get( 'Name' ) : '';
[596] Fix | Delete
case 'template_dir':
[597] Fix | Delete
return $this->get_template_directory();
[598] Fix | Delete
case 'stylesheet_dir':
[599] Fix | Delete
return $this->get_stylesheet_directory();
[600] Fix | Delete
case 'template':
[601] Fix | Delete
return $this->get_template();
[602] Fix | Delete
case 'stylesheet':
[603] Fix | Delete
return $this->get_stylesheet();
[604] Fix | Delete
case 'screenshot':
[605] Fix | Delete
return $this->get_screenshot( 'relative' );
[606] Fix | Delete
// 'author' and 'description' did not previously return translated data.
[607] Fix | Delete
case 'description':
[608] Fix | Delete
return $this->display( 'Description' );
[609] Fix | Delete
case 'author':
[610] Fix | Delete
return $this->display( 'Author' );
[611] Fix | Delete
case 'tags':
[612] Fix | Delete
return $this->get( 'Tags' );
[613] Fix | Delete
case 'theme_root':
[614] Fix | Delete
return $this->get_theme_root();
[615] Fix | Delete
case 'theme_root_uri':
[616] Fix | Delete
return $this->get_theme_root_uri();
[617] Fix | Delete
// For cases where the array was converted to an object.
[618] Fix | Delete
default:
[619] Fix | Delete
return $this->offsetGet( $offset );
[620] Fix | Delete
}
[621] Fix | Delete
}
[622] Fix | Delete
[623] Fix | Delete
/**
[624] Fix | Delete
* Method to implement ArrayAccess for keys formerly returned by get_themes()
[625] Fix | Delete
*
[626] Fix | Delete
* @since 3.4.0
[627] Fix | Delete
*
[628] Fix | Delete
* @param mixed $offset
[629] Fix | Delete
* @param mixed $value
[630] Fix | Delete
*/
[631] Fix | Delete
#[ReturnTypeWillChange]
[632] Fix | Delete
public function offsetSet( $offset, $value ) {}
[633] Fix | Delete
[634] Fix | Delete
/**
[635] Fix | Delete
* Method to implement ArrayAccess for keys formerly returned by get_themes()
[636] Fix | Delete
*
[637] Fix | Delete
* @since 3.4.0
[638] Fix | Delete
*
[639] Fix | Delete
* @param mixed $offset
[640] Fix | Delete
*/
[641] Fix | Delete
#[ReturnTypeWillChange]
[642] Fix | Delete
public function offsetUnset( $offset ) {}
[643] Fix | Delete
[644] Fix | Delete
/**
[645] Fix | Delete
* Method to implement ArrayAccess for keys formerly returned by get_themes()
[646] Fix | Delete
*
[647] Fix | Delete
* @since 3.4.0
[648] Fix | Delete
*
[649] Fix | Delete
* @param mixed $offset
[650] Fix | Delete
* @return bool
[651] Fix | Delete
*/
[652] Fix | Delete
#[ReturnTypeWillChange]
[653] Fix | Delete
public function offsetExists( $offset ) {
[654] Fix | Delete
static $keys = array(
[655] Fix | Delete
'Name',
[656] Fix | Delete
'Version',
[657] Fix | Delete
'Status',
[658] Fix | Delete
'Title',
[659] Fix | Delete
'Author',
[660] Fix | Delete
'Author Name',
[661] Fix | Delete
'Author URI',
[662] Fix | Delete
'Description',
[663] Fix | Delete
'Template',
[664] Fix | Delete
'Stylesheet',
[665] Fix | Delete
'Template Files',
[666] Fix | Delete
'Stylesheet Files',
[667] Fix | Delete
'Template Dir',
[668] Fix | Delete
'Stylesheet Dir',
[669] Fix | Delete
'Screenshot',
[670] Fix | Delete
'Tags',
[671] Fix | Delete
'Theme Root',
[672] Fix | Delete
'Theme Root URI',
[673] Fix | Delete
'Parent Theme',
[674] Fix | Delete
);
[675] Fix | Delete
[676] Fix | Delete
return in_array( $offset, $keys, true );
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
/**
[680] Fix | Delete
* Method to implement ArrayAccess for keys formerly returned by get_themes().
[681] Fix | Delete
*
[682] Fix | Delete
* Author, Author Name, Author URI, and Description did not previously return
[683] Fix | Delete
* translated data. We are doing so now as it is safe to do. However, as
[684] Fix | Delete
* Name and Title could have been used as the key for get_themes(), both remain
[685] Fix | Delete
* untranslated for back compatibility. This means that ['Name'] is not ideal,
[686] Fix | Delete
* and care should be taken to use `$theme::display( 'Name' )` to get a properly
[687] Fix | Delete
* translated header.
[688] Fix | Delete
*
[689] Fix | Delete
* @since 3.4.0
[690] Fix | Delete
*
[691] Fix | Delete
* @param mixed $offset
[692] Fix | Delete
* @return mixed
[693] Fix | Delete
*/
[694] Fix | Delete
#[ReturnTypeWillChange]
[695] Fix | Delete
public function offsetGet( $offset ) {
[696] Fix | Delete
switch ( $offset ) {
[697] Fix | Delete
case 'Name':
[698] Fix | Delete
case 'Title':
[699] Fix | Delete
/*
[700] Fix | Delete
* See note above about using translated data. get() is not ideal.
[701] Fix | Delete
* It is only for backward compatibility. Use display().
[702] Fix | Delete
*/
[703] Fix | Delete
return $this->get( 'Name' );
[704] Fix | Delete
case 'Author':
[705] Fix | Delete
return $this->display( 'Author' );
[706] Fix | Delete
case 'Author Name':
[707] Fix | Delete
return $this->display( 'Author', false );
[708] Fix | Delete
case 'Author URI':
[709] Fix | Delete
return $this->display( 'AuthorURI' );
[710] Fix | Delete
case 'Description':
[711] Fix | Delete
return $this->display( 'Description' );
[712] Fix | Delete
case 'Version':
[713] Fix | Delete
case 'Status':
[714] Fix | Delete
return $this->get( $offset );
[715] Fix | Delete
case 'Template':
[716] Fix | Delete
return $this->get_template();
[717] Fix | Delete
case 'Stylesheet':
[718] Fix | Delete
return $this->get_stylesheet();
[719] Fix | Delete
case 'Template Files':
[720] Fix | Delete
return $this->get_files( 'php', 1, true );
[721] Fix | Delete
case 'Stylesheet Files':
[722] Fix | Delete
return $this->get_files( 'css', 0, false );
[723] Fix | Delete
case 'Template Dir':
[724] Fix | Delete
return $this->get_template_directory();
[725] Fix | Delete
case 'Stylesheet Dir':
[726] Fix | Delete
return $this->get_stylesheet_directory();
[727] Fix | Delete
case 'Screenshot':
[728] Fix | Delete
return $this->get_screenshot( 'relative' );
[729] Fix | Delete
case 'Tags':
[730] Fix | Delete
return $this->get( 'Tags' );
[731] Fix | Delete
case 'Theme Root':
[732] Fix | Delete
return $this->get_theme_root();
[733] Fix | Delete
case 'Theme Root URI':
[734] Fix | Delete
return $this->get_theme_root_uri();
[735] Fix | Delete
case 'Parent Theme':
[736] Fix | Delete
return $this->parent() ? $this->parent()->get( 'Name' ) : '';
[737] Fix | Delete
default:
[738] Fix | Delete
return null;
[739] Fix | Delete
}
[740] Fix | Delete
}
[741] Fix | Delete
[742] Fix | Delete
/**
[743] Fix | Delete
* Returns errors property.
[744] Fix | Delete
*
[745] Fix | Delete
* @since 3.4.0
[746] Fix | Delete
*
[747] Fix | Delete
* @return WP_Error|false WP_Error if there are errors, or false.
[748] Fix | Delete
*/
[749] Fix | Delete
public function errors() {
[750] Fix | Delete
return is_wp_error( $this->errors ) ? $this->errors : false;
[751] Fix | Delete
}
[752] Fix | Delete
[753] Fix | Delete
/**
[754] Fix | Delete
* Determines whether the theme exists.
[755] Fix | Delete
*
[756] Fix | Delete
* A theme with errors exists. A theme with the error of 'theme_not_found',
[757] Fix | Delete
* meaning that the theme's directory was not found, does not exist.
[758] Fix | Delete
*
[759] Fix | Delete
* @since 3.4.0
[760] Fix | Delete
*
[761] Fix | Delete
* @return bool Whether the theme exists.
[762] Fix | Delete
*/
[763] Fix | Delete
public function exists() {
[764] Fix | Delete
return ! ( $this->errors() && in_array( 'theme_not_found', $this->errors()->get_error_codes(), true ) );
[765] Fix | Delete
}
[766] Fix | Delete
[767] Fix | Delete
/**
[768] Fix | Delete
* Returns reference to the parent theme.
[769] Fix | Delete
*
[770] Fix | Delete
* @since 3.4.0
[771] Fix | Delete
*
[772] Fix | Delete
* @return WP_Theme|false Parent theme, or false if the active theme is not a child theme.
[773] Fix | Delete
*/
[774] Fix | Delete
public function parent() {
[775] Fix | Delete
return isset( $this->parent ) ? $this->parent : false;
[776] Fix | Delete
}
[777] Fix | Delete
[778] Fix | Delete
/**
[779] Fix | Delete
* Perform reinitialization tasks.
[780] Fix | Delete
*
[781] Fix | Delete
* Prevents a callback from being injected during unserialization of an object.
[782] Fix | Delete
*/
[783] Fix | Delete
public function __wakeup() {
[784] Fix | Delete
if ( $this->parent && ! $this->parent instanceof self ) {
[785] Fix | Delete
throw new UnexpectedValueException();
[786] Fix | Delete
}
[787] Fix | Delete
if ( $this->headers && ! is_array( $this->headers ) ) {
[788] Fix | Delete
throw new UnexpectedValueException();
[789] Fix | Delete
}
[790] Fix | Delete
foreach ( $this->headers as $value ) {
[791] Fix | Delete
if ( ! is_string( $value ) ) {
[792] Fix | Delete
throw new UnexpectedValueException();
[793] Fix | Delete
}
[794] Fix | Delete
}
[795] Fix | Delete
$this->headers_sanitized = array();
[796] Fix | Delete
}
[797] Fix | Delete
[798] Fix | Delete
/**
[799] Fix | Delete
* Adds theme data to cache.
[800] Fix | Delete
*
[801] Fix | Delete
* Cache entries keyed by the theme and the type of data.
[802] Fix | Delete
*
[803] Fix | Delete
* @since 3.4.0
[804] Fix | Delete
*
[805] Fix | Delete
* @param string $key Type of data to store (theme, screenshot, headers, post_templates)
[806] Fix | Delete
* @param array|string $data Data to store
[807] Fix | Delete
* @return bool Return value from wp_cache_add()
[808] Fix | Delete
*/
[809] Fix | Delete
private function cache_add( $key, $data ) {
[810] Fix | Delete
return wp_cache_add( $key . '-' . $this->cache_hash, $data, 'themes', self::$cache_expiration );
[811] Fix | Delete
}
[812] Fix | Delete
[813] Fix | Delete
/**
[814] Fix | Delete
* Gets theme data from cache.
[815] Fix | Delete
*
[816] Fix | Delete
* Cache entries are keyed by the theme and the type of data.
[817] Fix | Delete
*
[818] Fix | Delete
* @since 3.4.0
[819] Fix | Delete
*
[820] Fix | Delete
* @param string $key Type of data to retrieve (theme, screenshot, headers, post_templates)
[821] Fix | Delete
* @return mixed Retrieved data
[822] Fix | Delete
*/
[823] Fix | Delete
private function cache_get( $key ) {
[824] Fix | Delete
return wp_cache_get( $key . '-' . $this->cache_hash, 'themes' );
[825] Fix | Delete
}
[826] Fix | Delete
[827] Fix | Delete
/**
[828] Fix | Delete
* Clears the cache for the theme.
[829] Fix | Delete
*
[830] Fix | Delete
* @since 3.4.0
[831] Fix | Delete
*/
[832] Fix | Delete
public function cache_delete() {
[833] Fix | Delete
foreach ( array( 'theme', 'screenshot', 'headers', 'post_templates' ) as $key ) {
[834] Fix | Delete
wp_cache_delete( $key . '-' . $this->cache_hash, 'themes' );
[835] Fix | Delete
}
[836] Fix | Delete
$this->template = null;
[837] Fix | Delete
$this->textdomain_loaded = null;
[838] Fix | Delete
$this->theme_root_uri = null;
[839] Fix | Delete
$this->parent = null;
[840] Fix | Delete
$this->errors = null;
[841] Fix | Delete
$this->headers_sanitized = null;
[842] Fix | Delete
$this->name_translated = null;
[843] Fix | Delete
$this->block_theme = null;
[844] Fix | Delete
$this->block_template_folders = null;
[845] Fix | Delete
$this->headers = array();
[846] Fix | Delete
$this->__construct( $this->stylesheet, $this->theme_root );
[847] Fix | Delete
$this->delete_pattern_cache();
[848] Fix | Delete
}
[849] Fix | Delete
[850] Fix | Delete
/**
[851] Fix | Delete
* Gets a raw, unformatted theme header.
[852] Fix | Delete
*
[853] Fix | Delete
* The header is sanitized, but is not translated, and is not marked up for display.
[854] Fix | Delete
* To get a theme header for display, use the display() method.
[855] Fix | Delete
*
[856] Fix | Delete
* Use the get_template() method, not the 'Template' header, for finding the template.
[857] Fix | Delete
* The 'Template' header is only good for what was written in the style.css, while
[858] Fix | Delete
* get_template() takes into account where WordPress actually located the theme and
[859] Fix | Delete
* whether it is actually valid.
[860] Fix | Delete
*
[861] Fix | Delete
* @since 3.4.0
[862] Fix | Delete
*
[863] Fix | Delete
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
[864] Fix | Delete
* @return string|array|false String or array (for Tags header) on success, false on failure.
[865] Fix | Delete
*/
[866] Fix | Delete
public function get( $header ) {
[867] Fix | Delete
if ( ! isset( $this->headers[ $header ] ) ) {
[868] Fix | Delete
return false;
[869] Fix | Delete
}
[870] Fix | Delete
[871] Fix | Delete
if ( ! isset( $this->headers_sanitized ) ) {
[872] Fix | Delete
$this->headers_sanitized = $this->cache_get( 'headers' );
[873] Fix | Delete
if ( ! is_array( $this->headers_sanitized ) ) {
[874] Fix | Delete
$this->headers_sanitized = array();
[875] Fix | Delete
}
[876] Fix | Delete
}
[877] Fix | Delete
[878] Fix | Delete
if ( isset( $this->headers_sanitized[ $header ] ) ) {
[879] Fix | Delete
return $this->headers_sanitized[ $header ];
[880] Fix | Delete
}
[881] Fix | Delete
[882] Fix | Delete
// If themes are a persistent group, sanitize everything and cache it. One cache add is better than many cache sets.
[883] Fix | Delete
if ( self::$persistently_cache ) {
[884] Fix | Delete
foreach ( array_keys( $this->headers ) as $_header ) {
[885] Fix | Delete
$this->headers_sanitized[ $_header ] = $this->sanitize_header( $_header, $this->headers[ $_header ] );
[886] Fix | Delete
}
[887] Fix | Delete
$this->cache_add( 'headers', $this->headers_sanitized );
[888] Fix | Delete
} else {
[889] Fix | Delete
$this->headers_sanitized[ $header ] = $this->sanitize_header( $header, $this->headers[ $header ] );
[890] Fix | Delete
}
[891] Fix | Delete
[892] Fix | Delete
return $this->headers_sanitized[ $header ];
[893] Fix | Delete
}
[894] Fix | Delete
[895] Fix | Delete
/**
[896] Fix | Delete
* Gets a theme header, formatted and translated for display.
[897] Fix | Delete
*
[898] Fix | Delete
* @since 3.4.0
[899] Fix | Delete
*
[900] Fix | Delete
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
[901] Fix | Delete
* @param bool $markup Optional. Whether to mark up the header. Defaults to true.
[902] Fix | Delete
* @param bool $translate Optional. Whether to translate the header. Defaults to true.
[903] Fix | Delete
* @return string|array|false Processed header. An array for Tags if `$markup` is false, string otherwise.
[904] Fix | Delete
* False on failure.
[905] Fix | Delete
*/
[906] Fix | Delete
public function display( $header, $markup = true, $translate = true ) {
[907] Fix | Delete
$value = $this->get( $header );
[908] Fix | Delete
if ( false === $value ) {
[909] Fix | Delete
return false;
[910] Fix | Delete
}
[911] Fix | Delete
[912] Fix | Delete
if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) ) {
[913] Fix | Delete
$translate = false;
[914] Fix | Delete
}
[915] Fix | Delete
[916] Fix | Delete
if ( $translate ) {
[917] Fix | Delete
$value = $this->translate_header( $header, $value );
[918] Fix | Delete
}
[919] Fix | Delete
[920] Fix | Delete
if ( $markup ) {
[921] Fix | Delete
$value = $this->markup_header( $header, $value, $translate );
[922] Fix | Delete
}
[923] Fix | Delete
[924] Fix | Delete
return $value;
[925] Fix | Delete
}
[926] Fix | Delete
[927] Fix | Delete
/**
[928] Fix | Delete
* Sanitizes a theme header.
[929] Fix | Delete
*
[930] Fix | Delete
* @since 3.4.0
[931] Fix | Delete
* @since 5.4.0 Added support for `Requires at least` and `Requires PHP` headers.
[932] Fix | Delete
* @since 6.1.0 Added support for `Update URI` header.
[933] Fix | Delete
*
[934] Fix | Delete
* @param string $header Theme header. Accepts 'Name', 'Description', 'Author', 'Version',
[935] Fix | Delete
* 'ThemeURI', 'AuthorURI', 'Status', 'Tags', 'RequiresWP', 'RequiresPHP',
[936] Fix | Delete
* 'UpdateURI'.
[937] Fix | Delete
* @param string $value Value to sanitize.
[938] Fix | Delete
* @return string|array An array for Tags header, string otherwise.
[939] Fix | Delete
*/
[940] Fix | Delete
private function sanitize_header( $header, $value ) {
[941] Fix | Delete
switch ( $header ) {
[942] Fix | Delete
case 'Status':
[943] Fix | Delete
if ( ! $value ) {
[944] Fix | Delete
$value = 'publish';
[945] Fix | Delete
break;
[946] Fix | Delete
}
[947] Fix | Delete
// Fall through otherwise.
[948] Fix | Delete
case 'Name':
[949] Fix | Delete
static $header_tags = array(
[950] Fix | Delete
'abbr' => array( 'title' => true ),
[951] Fix | Delete
'acronym' => array( 'title' => true ),
[952] Fix | Delete
'code' => true,
[953] Fix | Delete
'em' => true,
[954] Fix | Delete
'strong' => true,
[955] Fix | Delete
);
[956] Fix | Delete
[957] Fix | Delete
$value = wp_kses( $value, $header_tags );
[958] Fix | Delete
break;
[959] Fix | Delete
case 'Author':
[960] Fix | Delete
// There shouldn't be anchor tags in Author, but some themes like to be challenging.
[961] Fix | Delete
case 'Description':
[962] Fix | Delete
static $header_tags_with_a = array(
[963] Fix | Delete
'a' => array(
[964] Fix | Delete
'href' => true,
[965] Fix | Delete
'title' => true,
[966] Fix | Delete
),
[967] Fix | Delete
'abbr' => array( 'title' => true ),
[968] Fix | Delete
'acronym' => array( 'title' => true ),
[969] Fix | Delete
'code' => true,
[970] Fix | Delete
'em' => true,
[971] Fix | Delete
'strong' => true,
[972] Fix | Delete
);
[973] Fix | Delete
[974] Fix | Delete
$value = wp_kses( $value, $header_tags_with_a );
[975] Fix | Delete
break;
[976] Fix | Delete
case 'ThemeURI':
[977] Fix | Delete
case 'AuthorURI':
[978] Fix | Delete
$value = sanitize_url( $value );
[979] Fix | Delete
break;
[980] Fix | Delete
case 'Tags':
[981] Fix | Delete
$value = array_filter( array_map( 'trim', explode( ',', strip_tags( $value ) ) ) );
[982] Fix | Delete
break;
[983] Fix | Delete
case 'Version':
[984] Fix | Delete
case 'RequiresWP':
[985] Fix | Delete
case 'RequiresPHP':
[986] Fix | Delete
case 'UpdateURI':
[987] Fix | Delete
$value = strip_tags( $value );
[988] Fix | Delete
break;
[989] Fix | Delete
}
[990] Fix | Delete
[991] Fix | Delete
return $value;
[992] Fix | Delete
}
[993] Fix | Delete
[994] Fix | Delete
/**
[995] Fix | Delete
* Marks up a theme header.
[996] Fix | Delete
*
[997] Fix | Delete
* @since 3.4.0
[998] Fix | Delete
*
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function