Error_Handler::deprecated_function( string $function, string $version, string $replacement = null )

Marks a function as deprecated and inform when it has been used.

Description

See also

Parameters

$function

(string) (Required) The function that was called.

$version

(string) (Required) The version of the plugin that deprecated the function.

$replacement

(string) (Optional) The function that should have been called.

Default value: null

Source

File: src/error-handler.php

	public function deprecated_function( $function, $version, $replacement = null ) {
		do_action( 'deprecated_function_run', $function, $replacement, $version );

		if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
			if ( ! is_null( $replacement ) ) {
				$message = sprintf( $this->get_translation( 'deprecated_function' ), $function, $version, $replacement );
			} else {
				$message = sprintf( $this->get_translation( 'deprecated_function_no_alt' ), $function, $version );
			}

			torro()->logger()->debug( $message, array( 'deprecated' => true ) );
		}
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.