wpcf7_admin_updated_message()
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wpcf7_admin_updated_message( $page, $action, $object );
- $page(обязательный)
- .
- $action(обязательный)
- .
- $object(обязательный)
- .
Код wpcf7_admin_updated_message() wpcf7 admin updated message CF7 6.1.5
function wpcf7_admin_updated_message( $page, $action, $object ) {
if ( ! in_array( $page, array( 'wpcf7', 'wpcf7-new' ), true ) ) {
return;
}
$message_type = wpcf7_superglobal_request( 'message' );
if ( ! $message_type ) {
return;
}
$notice_type = 'success';
if ( 'created' === $message_type ) {
$message = __( 'Contact form created.', 'contact-form-7' );
} elseif ( 'saved' === $message_type ) {
$message = __( 'Contact form saved.', 'contact-form-7' );
} elseif ( 'deleted' === $message_type ) {
$message = __( 'Contact form deleted.', 'contact-form-7' );
} elseif ( 'failed' === $message_type ) {
$notice_type = 'error';
$message = __( 'There was an error saving the contact form.', 'contact-form-7' );
} elseif ( 'validated' === $message_type ) {
$bulk_validate = WPCF7::get_option( 'bulk_validate', array() );
$count_invalid = absint( $bulk_validate['count_invalid'] ?? 0 );
if ( $count_invalid ) {
$notice_type = 'warning';
$message = sprintf(
/* translators: %s: number of contact forms */
_n(
'Configuration validation completed. %s invalid contact form was found.',
'Configuration validation completed. %s invalid contact forms were found.',
$count_invalid, 'contact-form-7'
),
number_format_i18n( $count_invalid )
);
} else {
$message = __( 'Configuration validation completed. No invalid contact form was found.', 'contact-form-7' );
}
}
if ( ! empty( $message ) ) {
wp_admin_notice(
$message,
array( 'type' => $notice_type )
);
}
}