: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes.
* @see wp_image_add_srcset_and_sizes()
* @param string $content The raw post content to be filtered.
* @return string Converted content with 'srcset' and 'sizes' attributes added to images.
function wp_make_content_images_responsive( $content ) {
_deprecated_function( __FUNCTION__, '5.5.0', 'wp_filter_content_tags()' );
// This will also add the `loading` attribute to `img` tags, if enabled.
return wp_filter_content_tags( $content );
* Turn register globals off.
function wp_unregister_GLOBALS() {
// register_globals was deprecated in PHP 5.3 and removed entirely in PHP 5.4.
_deprecated_function( __FUNCTION__, '5.5.0' );
* Does comment contain disallowed characters or words.
* @deprecated 5.5.0 Use wp_check_comment_disallowed_list() instead.
* Please consider writing more inclusive code.
* @param string $author The author of the comment
* @param string $email The email of the comment
* @param string $url The url used in the comment
* @param string $comment The comment content
* @param string $user_ip The comment author's IP address
* @param string $user_agent The author's browser user agent
* @return bool True if comment contains disallowed content, false if comment does not
function wp_blacklist_check( $author, $email, $url, $comment, $user_ip, $user_agent ) {
_deprecated_function( __FUNCTION__, '5.5.0', 'wp_check_comment_disallowed_list()' );
return wp_check_comment_disallowed_list( $author, $email, $url, $comment, $user_ip, $user_agent );
* Filters out `register_meta()` args based on an allowed list.
* `register_meta()` args may change over time, so requiring the allowed list
* to be explicitly turned off is a warranty seal of sorts.
* @deprecated 5.5.0 Use _wp_register_meta_args_allowed_list() instead.
* Please consider writing more inclusive code.
* @param array $args Arguments from `register_meta()`.
* @param array $default_args Default arguments for `register_meta()`.
* @return array Filtered arguments.
function _wp_register_meta_args_whitelist( $args, $default_args ) {
_deprecated_function( __FUNCTION__, '5.5.0', '_wp_register_meta_args_allowed_list()' );
return _wp_register_meta_args_allowed_list( $args, $default_args );
* Adds an array of options to the list of allowed options.
* @deprecated 5.5.0 Use add_allowed_options() instead.
* Please consider writing more inclusive code.
* @param array $new_options
* @param string|array $options
function add_option_whitelist( $new_options, $options = '' ) {
_deprecated_function( __FUNCTION__, '5.5.0', 'add_allowed_options()' );
return add_allowed_options( $new_options, $options );
* Removes a list of options from the allowed options list.
* @deprecated 5.5.0 Use remove_allowed_options() instead.
* Please consider writing more inclusive code.
* @param array $del_options
* @param string|array $options
function remove_option_whitelist( $del_options, $options = '' ) {
_deprecated_function( __FUNCTION__, '5.5.0', 'remove_allowed_options()' );
return remove_allowed_options( $del_options, $options );
* Adds slashes to only string values in an array of values.
* This should be used when preparing data for core APIs that expect slashed data.
* This should not be used to escape data going directly into an SQL query.
* @deprecated 5.6.0 Use wp_slash()
* @param mixed $value Scalar or array of scalars.
* @return mixed Slashes $value
function wp_slash_strings_only( $value ) {
return map_deep( $value, 'addslashes_strings_only' );
* Adds slashes only if the provided value is a string.
function addslashes_strings_only( $value ) {
return is_string( $value ) ? addslashes( $value ) : $value;
* Displays a `noindex` meta tag if required by the blog configuration.
* If a blog is marked as not being public then the `noindex` meta tag will be
* output to tell web robots not to index the page content.
* Typical usage is as a {@see 'wp_head'} callback:
* add_action( 'wp_head', 'noindex' );
* @deprecated 5.7.0 Use wp_robots_noindex() instead on 'wp_robots' filter.
_deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_noindex()' );
// If the blog is not public, tell robots to go away.
if ( '0' == get_option( 'blog_public' ) ) {
* Display a `noindex` meta tag.
* Outputs a `noindex` meta tag that tells web robots not to index the page content.
* Typical usage is as a {@see 'wp_head'} callback:
* add_action( 'wp_head', 'wp_no_robots' );
* @since 5.3.0 Echo `noindex,nofollow` if search engine visibility is discouraged.
* @deprecated 5.7.0 Use wp_robots_no_robots() instead on 'wp_robots' filter.
function wp_no_robots() {
_deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_no_robots()' );
if ( get_option( 'blog_public' ) ) {
echo "<meta name='robots' content='noindex,follow' />\n";
echo "<meta name='robots' content='noindex,nofollow' />\n";
* Display a `noindex,noarchive` meta tag and referrer `strict-origin-when-cross-origin` meta tag.
* Outputs a `noindex,noarchive` meta tag that tells web robots not to index or cache the page content.
* Outputs a referrer `strict-origin-when-cross-origin` meta tag that tells the browser not to send
* the full URL as a referrer to other sites when cross-origin assets are loaded.
* Typical usage is as a {@see 'wp_head'} callback:
* add_action( 'wp_head', 'wp_sensitive_page_meta' );
* @deprecated 5.7.0 Use wp_robots_sensitive_page() instead on 'wp_robots' filter
* and wp_strict_cross_origin_referrer() on 'wp_head' action.
* @see wp_robots_sensitive_page()
function wp_sensitive_page_meta() {
_deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_sensitive_page()' );
<meta name='robots' content='noindex,noarchive' />
wp_strict_cross_origin_referrer();
* Render inner blocks from the `core/columns` block for generating an excerpt.
* @deprecated 5.8.0 Use _excerpt_render_inner_blocks() introduced in 5.8.0.
* @see _excerpt_render_inner_blocks()
* @param array $columns The parsed columns block.
* @param array $allowed_blocks The list of allowed inner blocks.
* @return string The rendered inner blocks.
function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
_deprecated_function( __FUNCTION__, '5.8.0', '_excerpt_render_inner_blocks()' );
return _excerpt_render_inner_blocks( $columns, $allowed_blocks );
* Renders the duotone filter SVG and returns the CSS filter property to
* reference the rendered SVG.
* @deprecated 5.9.1 Use wp_get_duotone_filter_property() introduced in 5.9.1.
* @see wp_get_duotone_filter_property()
* @param array $preset Duotone preset value as seen in theme.json.
* @return string Duotone CSS filter property.
function wp_render_duotone_filter_preset( $preset ) {
_deprecated_function( __FUNCTION__, '5.9.1', 'wp_get_duotone_filter_property()' );
return wp_get_duotone_filter_property( $preset );
* Checks whether serialization of the current block's border properties should occur.
* @deprecated 6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0.
* @see wp_should_skip_block_supports_serialization()
* @param WP_Block_Type $block_type Block type.
* @return bool Whether serialization of the current block's border properties
function wp_skip_border_serialization( $block_type ) {
_deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );
$border_support = isset( $block_type->supports['__experimentalBorder'] )
? $block_type->supports['__experimentalBorder']
return is_array( $border_support ) &&
array_key_exists( '__experimentalSkipSerialization', $border_support ) &&
$border_support['__experimentalSkipSerialization'];
* Checks whether serialization of the current block's dimensions properties should occur.
* @deprecated 6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0.
* @see wp_should_skip_block_supports_serialization()
* @param WP_Block_type $block_type Block type.
* @return bool Whether to serialize spacing support styles & classes.
function wp_skip_dimensions_serialization( $block_type ) {
_deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );
$dimensions_support = isset( $block_type->supports['__experimentalDimensions'] )
? $block_type->supports['__experimentalDimensions']
return is_array( $dimensions_support ) &&
array_key_exists( '__experimentalSkipSerialization', $dimensions_support ) &&
$dimensions_support['__experimentalSkipSerialization'];
* Checks whether serialization of the current block's spacing properties should occur.
* @deprecated 6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0.
* @see wp_should_skip_block_supports_serialization()
* @param WP_Block_Type $block_type Block type.
* @return bool Whether to serialize spacing support styles & classes.
function wp_skip_spacing_serialization( $block_type ) {
_deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );
$spacing_support = isset( $block_type->supports['spacing'] )
? $block_type->supports['spacing']
return is_array( $spacing_support ) &&
array_key_exists( '__experimentalSkipSerialization', $spacing_support ) &&
$spacing_support['__experimentalSkipSerialization'];
* Inject the block editor assets that need to be loaded into the editor's iframe as an inline script.
function wp_add_iframed_editor_assets_html() {
_deprecated_function( __FUNCTION__, '6.0.0' );
* Retrieves thumbnail for an attachment.
* Note that this works only for the (very) old image metadata style where 'thumb' was set,
* and the 'sizes' array did not exist. This function returns false for the newer image metadata style
* despite that 'thumbnail' is present in the 'sizes' array.
* @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`.
* @return string|false Thumbnail file path on success, false on failure.
function wp_get_attachment_thumb_file( $post_id = 0 ) {
_deprecated_function( __FUNCTION__, '6.1.0' );
$post_id = (int) $post_id;
$post = get_post( $post_id );
// Use $post->ID rather than $post_id as get_post() may have used the global $post object.
$imagedata = wp_get_attachment_metadata( $post->ID );
if ( ! is_array( $imagedata ) ) {
$file = get_attached_file( $post->ID );
if ( ! empty( $imagedata['thumb'] ) ) {
$thumbfile = str_replace( wp_basename( $file ), $imagedata['thumb'], $file );
if ( file_exists( $thumbfile ) ) {
* Filters the attachment thumbnail file path.
* @param string $thumbfile File path to the attachment thumbnail.
* @param int $post_id Attachment ID.
return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
* Gets the path to a translation file for loading a textdomain just in time.
* Caches the retrieved results internally.
* @see _load_textdomain_just_in_time()
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
* @param bool $reset Whether to reset the internal cache. Used by the switch to locale functionality.
* @return string|false The path to the translation file or false if no translation file was found.
function _get_path_to_translation( $domain, $reset = false ) {
_deprecated_function( __FUNCTION__, '6.1.0', 'WP_Textdomain_Registry' );
static $available_translations = array();
$available_translations = array();
if ( ! isset( $available_translations[ $domain ] ) ) {
$available_translations[ $domain ] = _get_path_to_translation_from_lang_dir( $domain );
return $available_translations[ $domain ];
* Gets the path to a translation file in the languages directory for the current locale.
* Holds a cached list of available .mo files to improve performance.
* @see _get_path_to_translation()
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
* @return string|false The path to the translation file or false if no translation file was found.
function _get_path_to_translation_from_lang_dir( $domain ) {
_deprecated_function( __FUNCTION__, '6.1.0', 'WP_Textdomain_Registry' );
static $cached_mofiles = null;
if ( null === $cached_mofiles ) {
$cached_mofiles = array();
WP_LANG_DIR . '/plugins',
foreach ( $locations as $location ) {
$mofiles = glob( $location . '/*.mo' );
$cached_mofiles = array_merge( $cached_mofiles, $mofiles );
$locale = determine_locale();
$mofile = "{$domain}-{$locale}.mo";
$path = WP_LANG_DIR . '/plugins/' . $mofile;
if ( in_array( $path, $cached_mofiles, true ) ) {
$path = WP_LANG_DIR . '/themes/' . $mofile;
if ( in_array( $path, $cached_mofiles, true ) ) {
* Allows multiple block styles.
* @param array $metadata Metadata for registering a block type.
* @return array Metadata for registering a block type.
function _wp_multiple_block_styles( $metadata ) {
_deprecated_function( __FUNCTION__, '6.1.0' );
* Generates an inline style for a typography feature e.g. text decoration,
* text transform, and font style.
* @deprecated 6.1.0 Use wp_style_engine_get_styles() introduced in 6.1.0.
* @see wp_style_engine_get_styles()
* @param array $attributes Block's attributes.
* @param string $feature Key for the feature within the typography styles.
* @param string $css_property Slug for the CSS property the inline style sets.
* @return string CSS inline style.
function wp_typography_get_css_variable_inline_style( $attributes, $feature, $css_property ) {
_deprecated_function( __FUNCTION__, '6.1.0', 'wp_style_engine_get_styles()' );
// Retrieve current attribute value or skip if not found.
$style_value = _wp_array_get( $attributes, array( 'style', 'typography', $feature ), false );