: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* or null to continue with the default behavior.
$support_errors = apply_filters( 'pre_wp_update_https_detection_errors', null );
if ( is_wp_error( $support_errors ) ) {
update_option( 'https_detection_errors', $support_errors->errors );
$support_errors = wp_get_https_detection_errors();
update_option( 'https_detection_errors', $support_errors );
* Adds `decoding` attribute to an `img` HTML tag.
* The `decoding` attribute allows developers to indicate whether the
* browser can decode the image off the main thread (`async`), on the
* main thread (`sync`) or as determined by the browser (`auto`).
* By default WordPress adds `decoding="async"` to images but developers
* can use the {@see 'wp_img_tag_add_decoding_attr'} filter to modify this
* to remove the attribute or set it to another accepted value.
* @deprecated 6.4.0 Use wp_img_tag_add_loading_optimization_attrs() instead.
* @see wp_img_tag_add_loading_optimization_attrs()
* @param string $image The HTML `img` tag where the attribute should be added.
* @param string $context Additional context to pass to the filters.
* @return string Converted `img` tag with `decoding` attribute added.
function wp_img_tag_add_decoding_attr( $image, $context ) {
_deprecated_function( __FUNCTION__, '6.4.0', 'wp_img_tag_add_loading_optimization_attrs()' );
* Only apply the decoding attribute to images that have a src attribute that
* starts with a double quote, ensuring escaped JSON is also excluded.
if ( ! str_contains( $image, ' src="' ) ) {
/** This action is documented in wp-includes/media.php */
$value = apply_filters( 'wp_img_tag_add_decoding_attr', 'async', $image, $context );
if ( in_array( $value, array( 'async', 'sync', 'auto' ), true ) ) {
$image = str_replace( '<img ', '<img decoding="' . esc_attr( $value ) . '" ', $image );
* Parses wp_template content and injects the active theme's
* stylesheet as a theme attribute into each wp_template_part
* @deprecated 6.4.0 Use traverse_and_serialize_blocks( parse_blocks( $template_content ), '_inject_theme_attribute_in_template_part_block' ) instead.
* @param string $template_content serialized wp_template content.
* @return string Updated 'wp_template' content.
function _inject_theme_attribute_in_block_template_content( $template_content ) {
'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_inject_theme_attribute_in_template_part_block" )'
$has_updated_content = false;
$template_blocks = parse_blocks( $template_content );
$blocks = _flatten_blocks( $template_blocks );
foreach ( $blocks as &$block ) {
'core/template-part' === $block['blockName'] &&
! isset( $block['attrs']['theme'] )
$block['attrs']['theme'] = get_stylesheet();
$has_updated_content = true;
if ( $has_updated_content ) {
foreach ( $template_blocks as &$block ) {
$new_content .= serialize_block( $block );
return $template_content;
* Parses a block template and removes the theme attribute from each template part.
* @deprecated 6.4.0 Use traverse_and_serialize_blocks( parse_blocks( $template_content ), '_remove_theme_attribute_from_template_part_block' ) instead.
* @param string $template_content Serialized block template content.
* @return string Updated block template content.
function _remove_theme_attribute_in_block_template_content( $template_content ) {
'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_remove_theme_attribute_from_template_part_block" )'
$has_updated_content = false;
$template_blocks = parse_blocks( $template_content );
$blocks = _flatten_blocks( $template_blocks );
foreach ( $blocks as $key => $block ) {
if ( 'core/template-part' === $block['blockName'] && isset( $block['attrs']['theme'] ) ) {
unset( $blocks[ $key ]['attrs']['theme'] );
$has_updated_content = true;
if ( ! $has_updated_content ) {
return $template_content;
foreach ( $template_blocks as $block ) {
$new_content .= serialize_block( $block );
* Prints the skip-link script & styles.
* @deprecated 6.4.0 Use wp_enqueue_block_template_skip_link() instead.
* @global string $_wp_current_template_content
function the_block_template_skip_link() {
_deprecated_function( __FUNCTION__, '6.4.0', 'wp_enqueue_block_template_skip_link()' );
global $_wp_current_template_content;
// Early exit if not a block theme.
if ( ! current_theme_supports( 'block-templates' ) ) {
// Early exit if not a block template.
if ( ! $_wp_current_template_content ) {
* Print the skip-link styles.
<style id="skip-link-styles">
.skip-link.screen-reader-text {
clip: rect(1px,1px,1px,1px);
position: absolute !important;
word-wrap: normal !important;
.skip-link.screen-reader-text:focus {
* Print the skip-link script.
var skipLinkTarget = document.querySelector( 'main' ),
// Early exit if a skip-link target can't be located.
if ( ! skipLinkTarget ) {
* The skip-link will be injected in the beginning of it.
sibling = document.querySelector( '.wp-site-blocks' );
// Early exit if the root element was not found.
// Get the skip-link target's ID, and generate one if it doesn't exist.
skipLinkTargetID = skipLinkTarget.id;
if ( ! skipLinkTargetID ) {
skipLinkTargetID = 'wp--skip-link--target';
skipLinkTarget.id = skipLinkTargetID;
skipLink = document.createElement( 'a' );
skipLink.classList.add( 'skip-link', 'screen-reader-text' );
skipLink.href = '#' + skipLinkTargetID;
skipLink.innerHTML = '<?php /* translators: Hidden accessibility text. */ esc_html_e( 'Skip to content' ); ?>';
sibling.parentElement.insertBefore( skipLink, sibling );
* Ensure that the view script has the `wp-interactivity` dependency.
function block_core_query_ensure_interactivity_dependency() {
_deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' );
* Ensure that the view script has the `wp-interactivity` dependency.
function block_core_file_ensure_interactivity_dependency() {
_deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' );
* Ensures that the view script has the `wp-interactivity` dependency.
function block_core_image_ensure_interactivity_dependency() {
_deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' );
* Updates the block content with elements class names.
* @deprecated 6.6.0 Generation of element class name is handled via `render_block_data` filter.
* @since 6.4.0 Added support for button and heading element styling.
* @param string $block_content Rendered block content.
* @param array $block Block object.
* @return string Filtered block content.
function wp_render_elements_support( $block_content, $block ) {
_deprecated_function( __FUNCTION__, '6.6.0', 'wp_render_elements_class_name' );
* Processes the directives on the rendered HTML of the interactive blocks.
* This processes only one root interactive block at a time because the
* rendered HTML of that block contains the rendered HTML of all its inner
* blocks, including any interactive block. It does so by ignoring all the
* interactive inner blocks until the root interactive block is processed.
* @param array $parsed_block The parsed block.
* @return array The same parsed block.
function wp_interactivity_process_directives_of_interactive_blocks( array $parsed_block ): array {
_deprecated_function( __FUNCTION__, '6.6.0' );