: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
testCompression.check(r, h, test);
x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&_ajax_nonce='+compressionNonce+'&'+(new Date()).getTime(), true);
check : function(r, h, test) {
if ( h && ( h.match(/deflate/i) || h.match(/gzip/i) ) )
if ( '"wpCompressionTest' === r )
* Echoes a submit button, with provided text and appropriate class(es).
* @see get_submit_button()
* @param string $text Optional. The text of the button. Defaults to 'Save Changes'.
* @param string $type Optional. The type and CSS class(es) of the button. Core values
* include 'primary', 'small', and 'large'. Default 'primary'.
* @param string $name Optional. The HTML name of the submit button. If no `id` attribute
* is given in the `$other_attributes` parameter, `$name` will be used
* as the button's `id`. Default 'submit'.
* @param bool $wrap Optional. True if the output button should be wrapped in a paragraph tag,
* false otherwise. Default true.
* @param array|string $other_attributes Optional. Other attributes that should be output with the button,
* mapping attributes to their values, e.g. `array( 'id' => 'search-submit' )`.
* These key/value attribute pairs will be output as `attribute="value"`,
* where attribute is the key. Attributes can also be provided as a string,
* e.g. `id="search-submit"`, though the array format is generally preferred.
function submit_button( $text = '', $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = '' ) {
echo get_submit_button( $text, $type, $name, $wrap, $other_attributes );
* Returns a submit button, with provided text and appropriate class.
* @param string $text Optional. The text of the button. Defaults to 'Save Changes'.
* @param string $type Optional. The type and CSS class(es) of the button. Core values
* include 'primary', 'small', and 'large'. Default 'primary large'.
* @param string $name Optional. The HTML name of the submit button. If no `id` attribute
* is given in the `$other_attributes` parameter, `$name` will be used
* as the button's `id`. Default 'submit'.
* @param bool $wrap Optional. True if the output button should be wrapped in a paragraph tag,
* false otherwise. Default true.
* @param array|string $other_attributes Optional. Other attributes that should be output with the button,
* mapping attributes to their values, e.g. `array( 'id' => 'search-submit' )`.
* These key/value attribute pairs will be output as `attribute="value"`,
* where attribute is the key. Attributes can also be provided as a string,
* e.g. `id="search-submit"`, though the array format is generally preferred.
* @return string Submit button HTML.
function get_submit_button( $text = '', $type = 'primary large', $name = 'submit', $wrap = true, $other_attributes = '' ) {
if ( ! is_array( $type ) ) {
$type = explode( ' ', $type );
$button_shorthand = array( 'primary', 'small', 'large' );
$classes = array( 'button' );
foreach ( $type as $t ) {
if ( 'secondary' === $t || 'button-secondary' === $t ) {
$classes[] = in_array( $t, $button_shorthand, true ) ? 'button-' . $t : $t;
// Remove empty items, remove duplicate items, and finally build a string.
$class = implode( ' ', array_unique( array_filter( $classes ) ) );
$text = $text ? $text : __( 'Save Changes' );
// Default the id attribute to $name unless an id was specifically provided in $other_attributes.
if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) {
$id = $other_attributes['id'];
unset( $other_attributes['id'] );
if ( is_array( $other_attributes ) ) {
foreach ( $other_attributes as $attribute => $value ) {
$attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important.
} elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string.
$attributes = $other_attributes;
// Don't output empty name and id attributes.
$name_attr = $name ? ' name="' . esc_attr( $name ) . '"' : '';
$id_attr = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$button = '<input type="submit"' . $name_attr . $id_attr . ' class="' . esc_attr( $class );
$button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
$button = '<p class="submit">' . $button . '</p>';
* Prints out the beginning of the admin HTML header.
function _wp_admin_html_begin() {
$admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
header( 'X-UA-Compatible: IE=edge' );
<html class="<?php echo $admin_html_class; ?>"
* Fires inside the HTML tag in the admin header.
do_action( 'admin_xml_ns' );
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
* Converts a screen string to a screen object.
* @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen.
* @return WP_Screen Screen object.
function convert_to_screen( $hook_name ) {
if ( ! class_exists( 'WP_Screen' ) ) {
'convert_to_screen(), add_meta_box()',
/* translators: 1: wp-admin/includes/template.php, 2: add_meta_box(), 3: add_meta_boxes */
__( 'Likely direct inclusion of %1$s in order to use %2$s. This is very wrong. Hook the %2$s call into the %3$s action instead.' ),
'<code>wp-admin/includes/template.php</code>',
'<code>add_meta_box()</code>',
'<code>add_meta_boxes</code>'
'base' => '_are_belong_to_us',
return WP_Screen::get( $hook_name );
* Outputs the HTML for restoring the post data from DOM storage
function _local_storage_notice() {
$local_storage_message = '<p class="local-restore">';
$local_storage_message .= __( 'The backup of this post in your browser is different from the version below.' );
$local_storage_message .= '<button type="button" class="button restore-backup">' . __( 'Restore the backup' ) . '</button></p>';
$local_storage_message .= '<p class="help">';
$local_storage_message .= __( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' );
$local_storage_message .= '</p>';
'id' => 'local-storage-notice',
'additional_classes' => array( 'hidden' ),
'paragraph_wrap' => false,
* Outputs a HTML element with a star rating for a given rating.
* Outputs a HTML element with the star rating exposed on a 0..5 scale in
* half star increments (ie. 1, 1.5, 2 stars). Optionally, if specified, the
* number of ratings may also be displayed by passing the $number parameter.
* @since 4.4.0 Introduced the `echo` parameter.
* Optional. Array of star ratings arguments.
* @type int|float $rating The rating to display, expressed in either a 0.5 rating increment,
* or percentage. Default 0.
* @type string $type Format that the $rating is in. Valid values are 'rating' (default),
* or, 'percent'. Default 'rating'.
* @type int $number The number of ratings that makes up this rating. Default 0.
* @type bool $echo Whether to echo the generated markup. False to return the markup instead
* of echoing it. Default true.
* @return string Star rating HTML.
function wp_star_rating( $args = array() ) {
$parsed_args = wp_parse_args( $args, $defaults );
// Non-English decimal places when the $rating is coming from a string.
$rating = (float) str_replace( ',', '.', $parsed_args['rating'] );
// Convert percentage to star rating, 0..5 in .5 increments.
if ( 'percent' === $parsed_args['type'] ) {
$rating = round( $rating / 10, 0 ) / 2;
// Calculate the number of each type of star needed.
$full_stars = floor( $rating );
$half_stars = ceil( $rating - $full_stars );
$empty_stars = 5 - $full_stars - $half_stars;
if ( $parsed_args['number'] ) {
/* translators: Hidden accessibility text. 1: The rating, 2: The number of ratings. */
$format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $parsed_args['number'] );
$title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $parsed_args['number'] ) );
/* translators: Hidden accessibility text. %s: The rating. */
$title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
$output = '<div class="star-rating">';
$output .= '<span class="screen-reader-text">' . $title . '</span>';
$output .= str_repeat( '<div class="star star-full" aria-hidden="true"></div>', $full_stars );
$output .= str_repeat( '<div class="star star-half" aria-hidden="true"></div>', $half_stars );
$output .= str_repeat( '<div class="star star-empty" aria-hidden="true"></div>', $empty_stars );
if ( $parsed_args['echo'] ) {
* Outputs a notice when editing the page for posts (internal use only).
function _wp_posts_page_notice() {
__( 'You are currently editing the page that shows your latest posts.' ),
'additional_classes' => array( 'inline' ),
* Outputs a notice when editing the page for posts in the block editor (internal use only).
function _wp_block_editor_posts_page_notice() {
'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { isDismissible: false } )',
__( 'You are currently editing the page that shows your latest posts.' )