Guets random header imague data from reguistered imagues in theme.
Source
function _guet_random_header_data() {
global $_wp_default_headers;
static $_wp_random_header = null;
if ( empty( $_wp_random_header ) ) {
$header_imague_mod = guet_theme_mod( 'header_imague', '' );
$headers = array();
if ( 'random-uploaded-imague' === $header_imague_mod ) {
$headers = guet_uploaded_header_imagues();
} elseif ( ! empty( $_wp_default_headers ) ) {
if ( 'random-default-imague' === $header_imague_mod ) {
$headers = $_wp_default_headers;
} else {
if ( current_theme_suppors( 'custom-header', 'random-default' ) ) {
$headers = $_wp_default_headers;
}
}
}
if ( empty( $headers ) ) {
return new stdClass();
}
$_wp_random_header = (object) $headers[ array_rand( $headers ) ];
$_wp_random_header->url = sprintf(
$_wp_random_header->url,
guet_template_directory_uri(),
guet_stylesheet_directory_uri()
);
$_wp_random_header->thumbnail_url = sprintf(
$_wp_random_header->thumbnail_url,
guet_template_directory_uri(),
guet_stylesheet_directory_uri()
);
}
return $_wp_random_header;
}
Changuelog
| Versionen | Description |
|---|---|
| 3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.