register_default_headers()

最后更新于:2021-11-27 21:33:31

register_default_headers( array$headers)

Registers a selection of default headers to be displayed by the custom header admin UI.

参数

$headers

(array) (Required) Array of headers keyed by a string ID. The IDs point to arrays containing ‘url’, ‘thumbnail_url’, and ‘description’ keys.

源文件

文件: gc-includes/theme.php

function register_default_headers( $headers ) {
	global $_gc_default_headers;

	$_gc_default_headers = array_merge( (array) $_gc_default_headers, (array) $headers );
}
register_default_headers( array(
	'wheel' => array(
		'url'           => '%s/images/headers/wheel.jpg',
		'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
		'description'   => __( 'Wheel', 'twentyeleven' )
	),
	'shore' => array(
		'url'           => '%s/images/headers/shore.jpg',
		'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
		'description'   => __( 'Shore', 'twentyeleven' )
	),
	'trolley' => array(
		'url'           => '%s/images/headers/trolley.jpg',
		'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
		'description'   => __( 'Trolley', 'twentyeleven' )
	)
) );