: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Fires when a deprecated function is called.
* @param string $function_name The function that was called.
* @param string $replacement The function that should have been called.
* @param string $version The version of WordPress that deprecated the function.
do_action( 'deprecated_function_run', $function_name, $replacement, $version );
* Filters whether to trigger an error for deprecated functions.
* @param bool $trigger Whether to trigger the error for deprecated functions. Default true.
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
/* translators: 1: PHP function name, 2: Version number, 3: Alternative function name. */
__( 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
/* translators: 1: PHP function name, 2: Version number. */
__( 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
wp_trigger_error( '', $message, E_USER_DEPRECATED );
* Marks a constructor as deprecated and informs when it has been used.
* Similar to _deprecated_function(), but with different strings. Used to
* remove PHP4-style constructors.
* The current behavior is to trigger a user error if `WP_DEBUG` is true.
* This function is to be used in every PHP4-style constructor method that is deprecated.
* @since 4.5.0 Added the `$parent_class` parameter.
* @since 5.4.0 This function is no longer marked as "private".
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
* @param string $class_name The class containing the deprecated constructor.
* @param string $version The version of WordPress that deprecated the function.
* @param string $parent_class Optional. The parent class calling the deprecated constructor.
function _deprecated_constructor( $class_name, $version, $parent_class = '' ) {
* Fires when a deprecated constructor is called.
* @since 4.5.0 Added the `$parent_class` parameter.
* @param string $class_name The class containing the deprecated constructor.
* @param string $version The version of WordPress that deprecated the function.
* @param string $parent_class The parent class calling the deprecated constructor.
do_action( 'deprecated_constructor_run', $class_name, $version, $parent_class );
* Filters whether to trigger an error for deprecated functions.
* `WP_DEBUG` must be true in addition to the filter evaluating to true.
* @param bool $trigger Whether to trigger the error for deprecated functions. Default true.
if ( WP_DEBUG && apply_filters( 'deprecated_constructor_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
/* translators: 1: PHP class name, 2: PHP parent class name, 3: Version number, 4: __construct() method. */
__( 'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ),
'<code>__construct()</code>'
/* translators: 1: PHP class name, 2: Version number, 3: __construct() method. */
__( 'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
'<code>__construct()</code>'
'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.',
'<code>__construct()</code>'
'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
'<code>__construct()</code>'
wp_trigger_error( '', $message, E_USER_DEPRECATED );
* Marks a class as deprecated and informs when it has been used.
* There is a {@see 'deprecated_class_run'} hook that will be called that can be used
* to get the backtrace up to what file and function called the deprecated class.
* The current behavior is to trigger a user error if `WP_DEBUG` is true.
* This function is to be used in the class constructor for every deprecated class.
* See {@see _deprecated_constructor()} for deprecating PHP4-style constructors.
* @param string $class_name The name of the class being instantiated.
* @param string $version The version of WordPress that deprecated the class.
* @param string $replacement Optional. The class or function that should have been called.
function _deprecated_class( $class_name, $version, $replacement = '' ) {
* Fires when a deprecated class is called.
* @param string $class_name The name of the class being instantiated.
* @param string $replacement The class or function that should have been called.
* @param string $version The version of WordPress that deprecated the class.
do_action( 'deprecated_class_run', $class_name, $replacement, $version );
* Filters whether to trigger an error for a deprecated class.
* @param bool $trigger Whether to trigger an error for a deprecated class. Default true.
if ( WP_DEBUG && apply_filters( 'deprecated_class_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
/* translators: 1: PHP class name, 2: Version number, 3: Alternative class or function name. */
__( 'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
/* translators: 1: PHP class name, 2: Version number. */
__( 'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
'Class %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
'Class %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
wp_trigger_error( '', $message, E_USER_DEPRECATED );
* Marks a file as deprecated and inform when it has been used.
* There is a {@see 'deprecated_file_included'} hook that will be called that can be used
* to get the backtrace up to what file and function included the deprecated file.
* The current behavior is to trigger a user error if `WP_DEBUG` is true.
* This function is to be used in every file that is deprecated.
* @since 5.4.0 This function is no longer marked as "private".
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
* @param string $file The file that was included.
* @param string $version The version of WordPress that deprecated the file.
* @param string $replacement Optional. The file that should have been included based on ABSPATH.
* @param string $message Optional. A message regarding the change. Default empty string.
function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
* Fires when a deprecated file is called.
* @param string $file The file that was called.
* @param string $replacement The file that should have been included based on ABSPATH.
* @param string $version The version of WordPress that deprecated the file.
* @param string $message A message regarding the change.
do_action( 'deprecated_file_included', $file, $replacement, $version, $message );
* Filters whether to trigger an error for deprecated files.
* @param bool $trigger Whether to trigger the error for deprecated files. Default true.
if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
$message = empty( $message ) ? '' : ' ' . $message;
if ( function_exists( '__' ) ) {
/* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */
__( 'File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
/* translators: 1: PHP file name, 2: Version number. */
__( 'File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
'File %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.',
'File %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.',
wp_trigger_error( '', $message, E_USER_DEPRECATED );
* Marks a function argument as deprecated and inform when it has been used.
* This function is to be used whenever a deprecated function argument is used.
* Before this function is called, the argument must be checked for whether it was
* used by comparing it to its default value or evaluating whether it is empty.
* if ( ! empty( $deprecated ) ) {
* _deprecated_argument( __FUNCTION__, '3.0.0' );
* There is a {@see 'deprecated_argument_run'} hook that will be called that can be used
* to get the backtrace up to what file and function used the deprecated argument.
* The current behavior is to trigger a user error if WP_DEBUG is true.
* @since 5.4.0 This function is no longer marked as "private".
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
* @param string $function_name The function that was called.
* @param string $version The version of WordPress that deprecated the argument used.
* @param string $message Optional. A message regarding the change. Default empty string.
function _deprecated_argument( $function_name, $version, $message = '' ) {
* Fires when a deprecated argument is called.
* @param string $function_name The function that was called.
* @param string $message A message regarding the change.
* @param string $version The version of WordPress that deprecated the argument used.
do_action( 'deprecated_argument_run', $function_name, $message, $version );
* Filters whether to trigger an error for deprecated arguments.
* @param bool $trigger Whether to trigger the error for deprecated arguments. Default true.
if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
if ( function_exists( '__' ) ) {
/* translators: 1: PHP function name, 2: Version number, 3: Optional message regarding the change. */
__( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ),
/* translators: 1: PHP function name, 2: Version number. */
__( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s',
'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.',
wp_trigger_error( '', $message, E_USER_DEPRECATED );
* Marks a deprecated action or filter hook as deprecated and throws a notice.
* Use the {@see 'deprecated_hook_run'} action to get the backtrace describing where
* the deprecated hook was called.
* Default behavior is to trigger a user error if `WP_DEBUG` is true.
* This function is called by the do_action_deprecated() and apply_filters_deprecated()
* functions, and so generally does not need to be called directly.
* @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
* @param string $hook The hook that was used.
* @param string $version The version of WordPress that deprecated the hook.
* @param string $replacement Optional. The hook that should have been used. Default empty string.
* @param string $message Optional. A message regarding the change. Default empty.
function _deprecated_hook( $hook, $version, $replacement = '', $message = '' ) {
* Fires when a deprecated hook is called.
* @param string $hook The hook that was called.
* @param string $replacement The hook that should be used as a replacement.
* @param string $version The version of WordPress that deprecated the argument used.
* @param string $message A message regarding the change.
do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );
* Filters whether to trigger deprecated hook errors.
* @param bool $trigger Whether to trigger deprecated hook errors. Requires
* `WP_DEBUG` to be defined true.
if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) {
$message = empty( $message ) ? '' : ' ' . $message;
/* translators: 1: WordPress hook name, 2: Version number, 3: Alternative hook name. */
__( 'Hook %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ),
/* translators: 1: WordPress hook name, 2: Version number. */
__( 'Hook %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ),
wp_trigger_error( '', $message, E_USER_DEPRECATED );
* Marks something as being incorrectly called.
* There is a {@see 'doing_it_wrong_run'} hook that will be called that can be used
* to get the backtrace up to what file and function called the deprecated function.
* The current behavior is to trigger a user error if `WP_DEBUG` is true.
* @since 5.4.0 This function is no longer marked as "private".
* @param string $function_name The function that was called.
* @param string $message A message explaining what has been done incorrectly.
* @param string $version The version of WordPress where the message was added.
function _doing_it_wrong( $function_name, $message, $version ) {
* Fires when the given function is being used incorrectly.
* @param string $function_name The function that was called.
* @param string $message A message explaining what has been done incorrectly.
* @param string $version The version of WordPress where the message was added.
do_action( 'doing_it_wrong_run', $function_name, $message, $version );
* Filters whether to trigger an error for _doing_it_wrong() calls.
* @since 5.1.0 Added the $function_name, $message and $version parameters.
* @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.
* @param string $function_name The function that was called.
* @param string $message A message explaining what has been done incorrectly.
* @param string $version The version of WordPress where the message was added.
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function_name, $message, $version ) ) {
if ( function_exists( '__' ) ) {
/* translators: %s: Version number. */
$version = sprintf( __( '(This message was added in version %s.)' ), $version );
$message .= ' ' . sprintf(
/* translators: %s: Documentation URL. */
__( 'Please see <a href="%s">Debugging in WordPress</a> for more information.' ),