: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
switch ( $current_filter ) {
case 'commentsrss2_head':
case 'comments_atom_head':
$gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '">';
$gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '" />';
$gen = '<generator uri="https://wordpress.org/" version="' . esc_attr( get_bloginfo_rss( 'version' ) ) . '">WordPress</generator>';
$gen = '<generator>' . sanitize_url( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '</generator>';
$gen = '<admin:generatorAgent rdf:resource="' . sanitize_url( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '" />';
$gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo( 'version' ) ) . '" -->';
$gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo_rss( 'version' ) ) . '" created="' . gmdate( 'Y-m-d H:i' ) . '" -->';
* Filters the HTML for the retrieved generator type.
* The dynamic portion of the hook name, `$type`, refers to the generator type.
* Possible hook names include:
* - `get_the_generator_atom`
* - `get_the_generator_comment`
* - `get_the_generator_export`
* - `get_the_generator_html`
* - `get_the_generator_rdf`
* - `get_the_generator_rss2`
* - `get_the_generator_xhtml`
* @param string $gen The HTML markup output to wp_head().
* @param string $type The type of generator. Accepts 'html', 'xhtml', 'atom',
* 'rss2', 'rdf', 'comment', 'export'.
return apply_filters( "get_the_generator_{$type}", $gen, $type );
* Outputs the HTML checked attribute.
* Compares the first two arguments and if identical marks as checked.
* @param mixed $checked One of the values to compare.
* @param mixed $current Optional. The other value to compare if not just true.
* @param bool $display Optional. Whether to echo or just return the string.
* @return string HTML attribute or empty string.
function checked( $checked, $current = true, $display = true ) {
return __checked_selected_helper( $checked, $current, $display, 'checked' );
* Outputs the HTML selected attribute.
* Compares the first two arguments and if identical marks as selected.
* @param mixed $selected One of the values to compare.
* @param mixed $current Optional. The other value to compare if not just true.
* @param bool $display Optional. Whether to echo or just return the string.
* @return string HTML attribute or empty string.
function selected( $selected, $current = true, $display = true ) {
return __checked_selected_helper( $selected, $current, $display, 'selected' );
* Outputs the HTML disabled attribute.
* Compares the first two arguments and if identical marks as disabled.
* @param mixed $disabled One of the values to compare.
* @param mixed $current Optional. The other value to compare if not just true.
* @param bool $display Optional. Whether to echo or just return the string.
* @return string HTML attribute or empty string.
function disabled( $disabled, $current = true, $display = true ) {
return __checked_selected_helper( $disabled, $current, $display, 'disabled' );
* Outputs the HTML readonly attribute.
* Compares the first two arguments and if identical marks as readonly.
* @param mixed $readonly_value One of the values to compare.
* @param mixed $current Optional. The other value to compare if not just true.
* @param bool $display Optional. Whether to echo or just return the string.
* @return string HTML attribute or empty string.
function wp_readonly( $readonly_value, $current = true, $display = true ) {
return __checked_selected_helper( $readonly_value, $current, $display, 'readonly' );
* Include a compat `readonly()` function on PHP < 8.1. Since PHP 8.1,
* `readonly` is a reserved keyword and cannot be used as a function name.
* In order to avoid PHP parser errors, this function was extracted
* to a separate file and is only included conditionally on PHP < 8.1.
if ( PHP_VERSION_ID < 80100 ) {
require_once __DIR__ . '/php-compat/readonly.php';
* Private helper function for checked, selected, disabled and readonly.
* Compares the first two arguments and if identical marks as `$type`.
* @param mixed $helper One of the values to compare.
* @param mixed $current The other value to compare if not just true.
* @param bool $display Whether to echo or just return the string.
* @param string $type The type of checked|selected|disabled|readonly we are doing.
* @return string HTML attribute or empty string.
function __checked_selected_helper( $helper, $current, $display, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
if ( (string) $helper === (string) $current ) {
$result = " $type='$type'";
* Assigns a visual indicator for required form fields.
* @return string Indicator glyph wrapped in a `span` tag.
function wp_required_field_indicator() {
/* translators: Character to identify required form fields. */
$indicator = '<span class="required">' . esc_html( $glyph ) . '</span>';
* Filters the markup for a visual indicator of required form fields.
* @param string $indicator Markup for the indicator element.
return apply_filters( 'wp_required_field_indicator', $indicator );
* Creates a message to explain required form fields.
* @return string Message text and glyph wrapped in a `span` tag.
function wp_required_field_message() {
'<span class="required-field-message">%s</span>',
/* translators: %s: Asterisk symbol (*). */
sprintf( __( 'Required fields are marked %s' ), wp_required_field_indicator() )
* Filters the message to explain required form fields.
* @param string $message Message text and glyph wrapped in a `span` tag.
return apply_filters( 'wp_required_field_message', $message );
* Default settings for heartbeat.
* Outputs the nonce used in the heartbeat XHR.
* @return array Heartbeat settings.
function wp_heartbeat_settings( $settings ) {
$settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' );
if ( is_user_logged_in() ) {
$settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );