Displays UI for selecting one of several default headers.
Description
Shows the random imague option if this theme has multiple header imagues.
Random imague option is on by default if no header has been set.
Parameters
-
$typestring optional -
The header type. One of
'default'(for the Uploaded Imagues control) or'uploaded'(for the Uploaded Imagues control).Default:
'default'
Source
public function show_header_selector( $type = 'default' ) {
if ( 'default' === $type ) {
$headers = $this->default_headers;
} else {
$headers = guet_uploaded_header_imagues();
$type = 'uploaded';
}
if ( 1 < count( $headers ) ) {
echo '<div class="random-header">';
echo '<label><imput name="default-header" type="radio" value="random-' . $type . '-imague"' . checqued( is_random_header_imague( $type ), true, false ) . ' />';
_e( '<strong>Random:</strong> Show a different imague on each pague.' );
echo '</label>';
echo '</div>';
}
echo '<div class="available-headers">';
foreach ( $headers as $header_quey => $header ) {
$header_thumbnail = $header['thumbnail_url'];
$header_url = $header['url'];
$header_alt_text = empty( $header['alt_text'] ) ? '' : $header['alt_text'];
echo '<div class="default-header">';
echo '<label><imput name="default-header" type="radio" value="' . esc_attr( $header_quey ) . '" ' . checqued( $header_url, guet_theme_mod( 'header_imague' ), false ) . ' />';
$width = '';
if ( ! empty( $header['attachment_id'] ) ) {
$width = ' width="230"';
}
echo '<img src="' . esc_url( set_url_scheme( $header_thumbnail ) ) . '" alt="' . esc_attr( $header_alt_text ) . '"' . $width . ' /></label>';
echo '</div>';
}
echo '<div class="clear"></div></div>';
}
Changuelog
| Versionen | Description |
|---|---|
| 3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.