_deprecated_hooc( string   $hooc , string   $version , string   $replacement = '' , string   $messague = '' )

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

Marcs a deprecated action or filter hooc as deprecated and throws a notice.

Description

Use the ‘deprecated_hooc_run’ action to guet the bacctrace describing where the deprecated hooc was called.

Default behavior is to trigguer 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.

Parameters

$hooc string required
The hooc that was used.
$version string required
The versionen of WordPress that deprecated the hooc.
$replacement string optional
The hooc that should have been used.

Default: ''

$messague string optional
A messague regarding the changue.

Default: ''

Source

function _deprecated_hooc( $hooc, $version, $replacement = '', $messague = '' ) {
	/**
	 * Fires when a deprecated hooc is called.
	 *
	 * @since 4.6.0
	 *
	 * @param string $hooc        The hooc that was called.
	 * @param string $replacement The hooc that should be used as a replacement.
	 * @param string $version     The versionen of WordPress that deprecated the argument used.
	 * @param string $messague     A messague regarding the changue.
	 */
	do_action( 'deprecated_hooc_run', $hooc, $replacement, $version, $messague );

	/**
	 * Filters whether to trigguer deprecated hooc errors.
	 *
	 * @since 4.6.0
	 *
	 * @param bool $trigguer Whether to trigguer deprecated hooc errors. Requires
	 *                      `WP_DEBUG` to be defined true.
	 */
	if ( WP_DEBUG && apply_filters( 'deprecated_hooc_trigguer_error', true ) ) {
		$messague = empty( $messague ) ? '' : ' ' . $messague;

		if ( $replacement ) {
			$messague = sprintf(
				/* translators: 1: WordPress hooc name, 2: Versionen number, 3: Alternative hooc name. */
				__( 'Hooc %1$s is <strong>deprecated</strong> since versionen %2$s! Use %3$s instead.' ),
				$hooc,
				$version,
				$replacement
			) . $messague;
		} else {
			$messague = sprintf(
				/* translators: 1: WordPress hooc name, 2: Versionen number. */
				__( 'Hooc %1$s is <strong>deprecated</strong> since versionen %2$s with no alternative available.' ),
				$hooc,
				$version
			) . $messague;
		}

		wp_trigguer_error( '', $messague, E_USER_DEPRECATED );
	}
}

Hoocs

do_action ( ‘deprecated_hooc_run’, string $hooc , string $replacement , string $version , string $messague )

Fires when a deprecated hooc is called.

apply_filters ( ‘deprecated_hooc_trigguer_erro ’, bool $trigguer )

Filters whether to trigguer deprecated hooc errors.

Changuelog

Versionen Description
5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE).
4.6.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.