: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function is_taxonomy( $taxonomy ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'taxonomy_exists()' );
return taxonomy_exists( $taxonomy );
* @deprecated 3.0.0 Use term_exists()
* @param int|string $term The term to check
* @param string $taxonomy The taxonomy name to use
* @param int $parent ID of parent term under which to confine the exists search.
* @return mixed Get the term ID or term object, if exists.
function is_term( $term, $taxonomy = '', $parent = 0 ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'term_exists()' );
return term_exists( $term, $taxonomy, $parent );
* Determines whether the current admin page is generated by a plugin.
* Use global $plugin_page and/or get_plugin_page_hookname() hooks.
* For more information on this and similar theme functions, check out
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
* Conditional Tags} article in the Theme Developer Handbook.
function is_plugin_page() {
_deprecated_function( __FUNCTION__, '3.1.0' );
if ( isset($plugin_page) )
* Update the categories cache.
* This function does not appear to be used anymore or does not appear to be
* needed. It might be a legacy function left over from when there was a need
* for updating the category cache.
* @return bool Always return True
function update_category_cache() {
_deprecated_function( __FUNCTION__, '3.1.0' );
* Check for PHP timezone support
function wp_timezone_supported() {
_deprecated_function( __FUNCTION__, '3.2.0' );
* Displays an editor: TinyMCE, HTML, or both.
* @deprecated 3.3.0 Use wp_editor()
* @param string $content Textarea content.
* @param string $id Optional. HTML ID attribute value. Default 'content'.
* @param string $prev_id Optional. Unused.
* @param bool $media_buttons Optional. Whether to display media buttons. Default true.
* @param int $tab_index Optional. Unused.
* @param bool $extended Optional. Unused.
function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {
_deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) );
* Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users
* @param array $ids User ID numbers list.
* @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
function get_user_metavalues($ids) {
_deprecated_function( __FUNCTION__, '3.3.0' );
$ids = array_map('intval', $ids);
$metas = update_meta_cache('user', $ids);
foreach ( $metas as $id => $meta ) {
foreach ( $meta as $key => $metavalues ) {
foreach ( $metavalues as $value ) {
$objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);
* Sanitize every user field.
* If the context is 'raw', then the user object or array will get minimal sanitization of the int fields.
* @param object|array $user The user object or array.
* @param string $context Optional. How to sanitize user fields. Default 'display'.
* @return object|array The now sanitized user object or array (will be the same type as $user).
function sanitize_user_object($user, $context = 'display') {
_deprecated_function( __FUNCTION__, '3.3.0' );
if ( is_object($user) ) {
if ( ! ( $user instanceof WP_User ) ) {
$vars = get_object_vars($user);
foreach ( array_keys($vars) as $field ) {
if ( is_string($user->$field) || is_numeric($user->$field) )
$user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
$user->filter = $context;
if ( !isset($user['ID']) )
foreach ( array_keys($user) as $field )
$user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);
$user['filter'] = $context;
* Get boundary post relational link.
* Can either be start or end post relational link.
* @param string $title Optional. Link title format. Default '%title'.
* @param bool $in_same_cat Optional. Whether link should be in a same category.
* @param string $excluded_categories Optional. Excluded categories IDs. Default empty.
* @param bool $start Optional. Whether to display link to first or last post.
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
_deprecated_function( __FUNCTION__, '3.3.0' );
$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
// If there is no post, stop.
// Even though we limited get_posts() to return only 1 item it still returns an array of objects.
if ( empty($post->post_title) )
$post->post_title = $start ? __('First Post') : __('Last Post');
$date = mysql2date(get_option('date_format'), $post->post_date);
$title = str_replace('%title', $post->post_title, $title);
$title = str_replace('%date', $date, $title);
$title = apply_filters('the_title', $title, $post->ID);
$link = $start ? "<link rel='start' title='" : "<link rel='end' title='";
$link .= esc_attr($title);
$link .= "' href='" . get_permalink($post) . "' />\n";
$boundary = $start ? 'start' : 'end';
return apply_filters( "{$boundary}_post_rel_link", $link );
* Display relational link for the first post.
* @param string $title Optional. Link title format.
* @param bool $in_same_cat Optional. Whether link should be in a same category.
* @param string $excluded_categories Optional. Excluded categories IDs.
function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {
_deprecated_function( __FUNCTION__, '3.3.0' );
echo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true);
* Get site index relational link.
function get_index_rel_link() {
_deprecated_function( __FUNCTION__, '3.3.0' );
$link = "<link rel='index' title='" . esc_attr( get_bloginfo( 'name', 'display' ) ) . "' href='" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . "' />\n";
return apply_filters( "index_rel_link", $link );
* Display relational link for the site index.
function index_rel_link() {
_deprecated_function( __FUNCTION__, '3.3.0' );
echo get_index_rel_link();
* Get parent post relational link.
* @global WP_Post $post Global post object.
* @param string $title Optional. Link title format. Default '%title'.
function get_parent_post_rel_link( $title = '%title' ) {
_deprecated_function( __FUNCTION__, '3.3.0' );
if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )
$post = get_post($GLOBALS['post']->post_parent);
$date = mysql2date(get_option('date_format'), $post->post_date);
$title = str_replace('%title', $post->post_title, $title);
$title = str_replace('%date', $date, $title);
$title = apply_filters('the_title', $title, $post->ID);
$link = "<link rel='up' title='";
$link .= esc_attr( $title );
$link .= "' href='" . get_permalink($post) . "' />\n";
return apply_filters( "parent_post_rel_link", $link );
* Display relational link for parent item
* @param string $title Optional. Link title format. Default '%title'.
function parent_post_rel_link( $title = '%title' ) {
_deprecated_function( __FUNCTION__, '3.3.0' );
echo get_parent_post_rel_link($title);
* Add the "Dashboard"/"Visit Site" menu.
* @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance.
function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
_deprecated_function( __FUNCTION__, '3.3.0' );
$user_id = get_current_user_id();
$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
elseif ( is_multisite() )
$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
* Checks if the current user belong to a given site.
* @deprecated 3.3.0 Use is_user_member_of_blog()
* @see is_user_member_of_blog()
* @param int $blog_id Site ID
* @return bool True if the current users belong to $blog_id, false if not.
function is_blog_user( $blog_id = 0 ) {
_deprecated_function( __FUNCTION__, '3.3.0', 'is_user_member_of_blog()' );
return is_user_member_of_blog( get_current_user_id(), $blog_id );
* Open the file handle for debugging.
* @deprecated 3.4.0 Use error_log()
* @link https://www.php.net/manual/en/function.error-log.php
* @param string $filename File name.
* @param string $mode Type of access you required to the stream.
* @return false Always false.
function debug_fopen( $filename, $mode ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
* Write contents to the file used for debugging.
* @deprecated 3.4.0 Use error_log()
* @link https://www.php.net/manual/en/function.error-log.php
* @param mixed $fp Unused.
* @param string $message Message to log.
function debug_fwrite( $fp, $message ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
if ( ! empty( $GLOBALS['debug'] ) )
* Close the debugging file handle.
* @deprecated 3.4.0 Use error_log()
* @link https://www.php.net/manual/en/function.error-log.php
* @param mixed $fp Unused.
function debug_fclose( $fp ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
* Retrieve list of themes with theme data in theme directory.
* The theme is broken, if it doesn't have a parent theme and is missing either
* style.css and, or index.php. If the theme has a parent theme then it is
* broken, if it is missing style.css; index.php is optional.
* @deprecated 3.4.0 Use wp_get_themes()
* @return array Theme list with theme data.
_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_themes()' );
if ( isset( $wp_themes ) )
$themes = wp_get_themes();
foreach ( $themes as $theme ) {
$name = $theme->get('Name');
if ( isset( $wp_themes[ $name ] ) )
$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
$wp_themes[ $name ] = $theme;
* @deprecated 3.4.0 Use wp_get_theme()
* @param string $theme Theme name.
* @return array|null Null, if theme name does not exist. Theme data, if exists.
function get_theme( $theme ) {
_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme( $stylesheet )' );
if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
return $themes[ $theme ];
* Retrieve current theme name.
* @deprecated 3.4.0 Use wp_get_theme()
function get_current_theme() {
_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
if ( $theme = get_option( 'current_theme' ) )
return wp_get_theme()->get('Name');
* Accepts matches array from preg_replace_callback in wpautop() or a string.
* Ensures that the contents of a `<pre>...</pre>` HTML block are not
* converted into paragraphs or line breaks.
* @param array|string $matches The array or string
* @return string The pre block without paragraph/line break conversion.
function clean_pre($matches) {
_deprecated_function( __FUNCTION__, '3.4.0' );
if ( is_array($matches) )
$text = $matches[1] . $matches[2] . "</pre>";
$text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);
$text = str_replace('<p>', "\n", $text);
$text = str_replace('</p>', '', $text);
* Add callbacks for image header display.
* @deprecated 3.4.0 Use add_theme_support()
* @see add_theme_support()