Title: _wp_admin_html_begin
Published: April 25, 2014
Last modified: August 20, 2026

---

# _wp_admin_html_begin()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#wp--skip-link--target)

Prints out the beginning of the admin HTML header.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#source)󠁿

    ```php
    function _wp_admin_html_begin() {
    	global $is_IE;

    	$admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';

    	if ( $is_IE ) {
    		header( 'X-UA-Compatible: IE=edge' );
    	}

    	?>
    <!DOCTYPE html>
    <html class="<?php echo $admin_html_class; ?>"
    	<?php
    	/**
    	 * Fires inside the HTML tag in the admin header.
    	 *
    	 * @since 2.2.0
    	 */
    	do_action( 'admin_xml_ns' );

    	language_attributes();
    	?>
    >
    <head>
    <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
    	<?php
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/template.php#L2658)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/template.php#L2658-L2684)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#hooks)󠁿

 [do_action( ‘admin_xml_ns’ )](https://developer.wordpress.org/reference/hooks/admin_xml_ns/)

Fires inside the HTML tag in the admin header.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#related)󠁿

| Uses | Description | 
| [language_attributes()](https://developer.wordpress.org/reference/functions/language_attributes/)`wp-includes/general-template.php` |

Displays the language attributes for the ‘html’ tag.

  | 
| [bloginfo()](https://developer.wordpress.org/reference/functions/bloginfo/)`wp-includes/general-template.php` |

Displays information about the current site.

  | 
| [is_admin_bar_showing()](https://developer.wordpress.org/reference/functions/is_admin_bar_showing/)`wp-includes/admin-bar.php` |

Determines whether the admin bar should be showing.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#)

| Used by | Description | 
| [iframe_header()](https://developer.wordpress.org/reference/functions/iframe_header/)`wp-admin/includes/template.php` |

Generic Iframe header for use with Thickbox.

  | 
| [wp_iframe()](https://developer.wordpress.org/reference/functions/wp_iframe/)`wp-admin/includes/media.php` |

Outputs the iframe to display the media upload page.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_wp_admin_html_begin/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_wp_admin_html_begin%2F)
before being able to contribute a note or feedback.