_get_random_header_data [ WordPress Function ]
_get_random_header_data ( No parameters )
| Access: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_random_header_image, is_random_header_image, get_custom_header, get_theme_data, get_column_headers
Get random header image data from registered images in theme.
Source
<?php
function _get_random_header_data() {
static $_wp_random_header;
if ( empty( $_wp_random_header ) ) {
global $_wp_default_headers;
$header_image_mod = get_theme_mod( 'header_image', '' );
$headers = array();
if ( 'random-uploaded-image' == $header_image_mod )
$headers = get_uploaded_header_images();
elseif ( ! empty( $_wp_default_headers ) ) {
if ( 'random-default-image' == $header_image_mod ) {
$headers = $_wp_default_headers;
} else {
if ( current_theme_supports( '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, get_template_directory_uri(), get_stylesheet_directory_uri() );
$_wp_random_header->thumbnail_url = sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() );
}
return $_wp_random_header;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- get_random_header_image (WordPress Function) - WPSeek.com
Jul 5, 2011 ... Similar Functions: is_random_header_image, _get_random_header_data, get_header_image, get_uploaded_header_images, header_image ...
wpseek.com - get_custom_header (WordPress Function) - WPSeek.com
function get_custom_header() { $data = is_random_header_image()? _get_random_header_data() : get_theme_mod( 'header_image_data' ); $default = array( ...
wpseek.com - PHPXRef 0.7 : WordPress : Detail view of theme.php
_get_random_header_data() get_random_header_image() is_random_header_image() header_image() get_uploaded_header_images() get_custom_header() ...
phpxref.ftwr.co.uk - <?php /** * Theme, template, and stylesheet functions. * * @package ...
@since 3.4.0 * * @access private * * @return string Path to header image */ function _get_random_header_data() { static $_wp_random_header; if ( empty( ...
core.svn.wordpress.org