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.0.5
function wpcf7_admin_updated_message( $page, $action, $object ) { if ( ! in_array( $page, array( 'wpcf7', 'wpcf7-new' ), true ) ) { return; } if ( empty( $_REQUEST['message'] ) ) { return; } if ( 'created' === $_REQUEST['message'] ) { $message = __( "Contact form created.", 'contact-form-7' ); } elseif ( 'saved' === $_REQUEST['message'] ) { $message = __( "Contact form saved.", 'contact-form-7' ); } elseif ( 'deleted' === $_REQUEST['message'] ) { $message = __( "Contact form deleted.", 'contact-form-7' ); } if ( ! empty( $message ) ) { wp_admin_notice( esc_html( $message ), array( 'type' => 'success' ) ); } if ( 'failed' === $_REQUEST['message'] ) { $message = __( "There was an error saving the contact form.", 'contact-form-7' ); wp_admin_notice( esc_html( $message ), array( 'type' => 'error' ) ); } if ( 'validated' === $_REQUEST['message'] ) { $bulk_validate = WPCF7::get_option( 'bulk_validate', array() ); $count_invalid = absint( $bulk_validate['count_invalid'] ?? 0 ); if ( $count_invalid ) { $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 ) ); wp_admin_notice( esc_html( $message ), array( 'type' => 'warning' ) ); } else { $message = __( "Configuration validation completed. No invalid contact form was found.", 'contact-form-7' ); wp_admin_notice( esc_html( $message ), array( 'type' => 'success' ) ); } } }