wpcf7_admin_updated_message

The Contact Form 7 wpcf7 admin updated message function.

Description

wpcf7_admin_updated_message(); 

Usage

  1. if ( !function_exists( 'wpcf7_admin_updated_message' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/admin/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wpcf7_admin_updated_message(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/admin/admin.php  
  1. function wpcf7_admin_updated_message() { 
  2. if ( empty( $_REQUEST['message'] ) ) { 
  3. return; 
  4.  
  5. if ( 'created' == $_REQUEST['message'] ) { 
  6. $updated_message = __( "Contact form created.", 'contact-form-7' ); 
  7. } elseif ( 'saved' == $_REQUEST['message'] ) { 
  8. $updated_message = __( "Contact form saved.", 'contact-form-7' ); 
  9. } elseif ( 'deleted' == $_REQUEST['message'] ) { 
  10. $updated_message = __( "Contact form deleted.", 'contact-form-7' ); 
  11.  
  12. if ( ! empty( $updated_message ) ) { 
  13. echo sprintf( '<div id="message" class="notice notice-success is-dismissible"><p>%s</p></div>', esc_html( $updated_message ) ); 
  14. return; 
  15.  
  16. if ( 'failed' == $_REQUEST['message'] ) { 
  17. $updated_message = __( "There was anerrorsaving the contact form.",  
  18. 'contact-form-7' ); 
  19.  
  20. echo sprintf( '<div id="message" class="notice notice-error is-dismissible"><p>%s</p></div>', esc_html( $updated_message ) ); 
  21. return; 
  22.  
  23. if ( 'validated' == $_REQUEST['message'] ) { 
  24. $bulk_validate = WPCF7::get_option( 'bulk_validate', array() ); 
  25. $count_invalid = isset( $bulk_validate['count_invalid'] ) 
  26. ? absint( $bulk_validate['count_invalid'] ) : 0; 
  27.  
  28. if ( $count_invalid ) { 
  29. $updated_message = sprintf( 
  30. _n( 
  31. "Configuration validation completed. An invalid contact form was found.",  
  32. "Configuration validation completed. %s invalid contact forms were found.",  
  33. $count_invalid, 'contact-form-7' ),  
  34. number_format_i18n( $count_invalid ) ); 
  35.  
  36. echo sprintf( '<div id="message" class="notice notice-warning is-dismissible"><p>%s</p></div>', esc_html( $updated_message ) ); 
  37. } else { 
  38. $updated_message = __( "Configuration validation completed. No invalid contact form was found.", 'contact-form-7' ); 
  39.  
  40. echo sprintf( '<div id="message" class="notice notice-success is-dismissible"><p>%s</p></div>', esc_html( $updated_message ) ); 
  41.  
  42. return;