This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/inc/custom-header.php

57 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2017-01-27 12:22:02 +00:00
<?php
/**
* Custom header setup
2017-01-27 12:22:02 +00:00
*
* @package understrap
*/
2019-06-20 08:57:12 +00:00
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
2018-09-10 21:59:04 +00:00
add_action( 'after_setup_theme', 'understrap_custom_header_setup' );
2017-01-09 13:18:01 +00:00
2018-11-18 23:44:58 +00:00
if ( ! function_exists( 'understrap_custom_header_setup' ) ) {
function understrap_custom_header_setup() {
2017-01-09 13:18:01 +00:00
/**
* Filter UnderStrap custom-header support arguments.
*
* @since UnderStrap 0.5.2
*
* @param array $args {
* An array of custom-header support arguments.
*
2018-11-18 23:44:58 +00:00
* @type string $default-image Default image of the header.
* @type string $default_text_color Default color of the header text.
* @type int $width Width in pixels of the custom header image. Default 954.
* @type int $height Height in pixels of the custom header image. Default 1300.
* @type string $wp-head-callback Callback function used to styles the header image and text
* displayed on the blog.
2018-11-18 23:44:58 +00:00
* @type string $flex-height Flex support for height of header.
* }
*/
2018-11-18 23:44:58 +00:00
add_theme_support(
'custom-header',
apply_filters(
'understrap_custom_header_args',
array(
'default-image' => get_parent_theme_file_uri( '/img/header.jpg' ),
'width' => 2000,
'height' => 1200,
'flex-height' => true,
)
)
);
2018-11-18 23:44:58 +00:00
register_default_headers(
array(
'default-image' => array(
'url' => '%s/img/header.jpg',
'thumbnail_url' => '%s/img/header.jpg',
'description' => __( 'Default Header Image', 'understrap' ),
),
)
);
}
2018-11-18 23:44:58 +00:00
}