get_custom_header example

/** * Creates image tag markup for a custom header image. * * @since 4.4.0 * * @param array $attr Optional. Additional attributes for the image tag. Can be used * to override the default attributes. Default empty. * @return string HTML image element markup or empty string on failure. */
function get_header_image_tag( $attr = array() ) {
    $header      = get_custom_header();
    $header->url = get_header_image();

    if ( ! $header->url ) {
        return '';
    }

    $width  = absint( $header->width );
    $height = absint( $header->height );
    $alt    = '';

    // Use alternative text assigned to the image, if available. Otherwise, leave it empty.
printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' )esc_url( home_url( '/' ) ) );
            ?> </p> </div> <?php } ?> <h2><?php _e( 'Header Image' ); ?></h2> <table class="form-table" role="presentation"> <tbody> <?php if ( get_custom_header() || display_header_text() ) : ?> <tr> <th scope="row"><?php _e( 'Preview' ); ?></th> <td> <?php             if ( $this->admin_image_div_callback ) {
                call_user_func( $this->admin_image_div_callback );
            } else {
                $custom_header = get_custom_header();
                $header_image  = get_header_image();

                if ( $header_image ) {
                    
Home | Imprint | This part of the site doesn't use cookies.