wpcf7_apply_filters_deprecated()
Fires functions attached to a deprecated filter hook.
Хуки из функции
Возвращает
null. Ничего (null).
Использование
wpcf7_apply_filters_deprecated( $hook_name, $args, $version, $replacement );
- $hook_name(строка) (обязательный)
- The name of the filter hook.
- $args(массив) (обязательный)
- Array of additional function arguments to be passed to apply_filters().
- $version(строка) (обязательный)
- The version of Contact Form 7 that deprecated the hook.
- $replacement(строка)
- The hook that should have been used.
По умолчанию:''
Код wpcf7_apply_filters_deprecated() wpcf7 apply filters deprecated CF7 6.1.6
function wpcf7_apply_filters_deprecated( $hook_name, $args, $version, $replacement = '' ) {
if ( ! has_filter( $hook_name ) ) {
return $args[0];
}
if ( WP_DEBUG and apply_filters( 'deprecated_hook_trigger_error', true ) ) {
if ( $replacement ) {
wp_trigger_error(
'',
sprintf(
/* translators: 1: WordPress hook name, 2: version number, 3: alternative hook name */
__( 'Hook %1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s! Use %3$s instead.', 'contact-form-7' ),
$hook_name,
$version,
$replacement
),
E_USER_DEPRECATED
);
} else {
wp_trigger_error(
'',
sprintf(
/* translators: 1: WordPress hook name, 2: version number */
__( 'Hook %1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s with no alternative available.', 'contact-form-7' ),
$hook_name,
$version
),
E_USER_DEPRECATED
);
}
}
return apply_filters_ref_array( $hook_name, $args );
}