Action hook 'deprecated_constructor_run'

in WP Core File wp-includes/functions.php at line 5622

View Source

deprecated_constructor_run

Action Hook
Description
Fires when a deprecated constructor is called.

Hook Information

File Location wp-includes/functions.php View on GitHub
Hook Type Action
Line Number 5622

Hook Parameters

Type Name Description
string $class_name The class containing the deprecated constructor.
string $version The version of WordPress that deprecated the function.
string $parent_class The parent class calling the deprecated constructor.

Usage Examples

Basic Usage
<?php
// Hook into deprecated_constructor_run
add_action('deprecated_constructor_run', 'my_custom_function', 10, 3);

function my_custom_function($class_name, $version, $parent_class) {
    // Your custom code here
}

Source Code Context

wp-includes/functions.php:5622 - How this hook is used in WordPress core
<?php
5617  	 *
5618  	 * @param string $class_name   The class containing the deprecated constructor.
5619  	 * @param string $version      The version of WordPress that deprecated the function.
5620  	 * @param string $parent_class The parent class calling the deprecated constructor.
5621  	 */
5622  	do_action( 'deprecated_constructor_run', $class_name, $version, $parent_class );
5623  
5624  	/**
5625  	 * Filters whether to trigger an error for deprecated functions.
5626  	 *
5627  	 * `WP_DEBUG` must be true in addition to the filter evaluating to true.

PHP Documentation

<?php
/**
	 * Fires when a deprecated constructor is called.
	 *
	 * @since 4.3.0
	 * @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.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.