Marks up a theme header.
Parameters
$header
stringrequired- Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
$value
string|arrayrequired- Value to mark up. An array for Tags header, string otherwise.
$translate
stringrequired- Whether the header has been translated.
Source
private function markup_header( $header, $value, $translate ) {
switch ( $header ) {
case 'Name':
if ( empty( $value ) ) {
$value = esc_html( $this->get_stylesheet() );
}
break;
case 'Description':
$value = wptexturize( $value );
break;
case 'Author':
if ( $this->get( 'AuthorURI' ) ) {
$value = sprintf( '<a href="%1$s">%2$s</a>', $this->display( 'AuthorURI', true, $translate ), $value );
} elseif ( ! $value ) {
$value = __( 'Anonymous' );
}
break;
case 'Tags':
static $comma = null;
if ( ! isset( $comma ) ) {
$comma = wp_get_list_item_separator();
}
$value = implode( $comma, $value );
break;
case 'ThemeURI':
case 'AuthorURI':
$value = esc_url( $value );
break;
}
return $value;
}
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.