wpcf7_file_display_warning_message

The Contact Form 7 wpcf7 file display warning message function.

Description

wpcf7_file_display_warning_message(); 

Usage

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

Defined (1)

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

/modules/file.php  
  1. function wpcf7_file_display_warning_message() { 
  2. if ( ! $contact_form = wpcf7_get_current_contact_form() ) { 
  3. return; 
  4.  
  5. $has_tags = (bool) $contact_form->scan_form_tags( 
  6. array( 'type' => array( 'file', 'file*' ) ) ); 
  7.  
  8. if ( ! $has_tags ) { 
  9. return; 
  10.  
  11. $uploads_dir = wpcf7_upload_tmp_dir(); 
  12.  
  13. if ( ! is_dir( $uploads_dir ) || ! wp_is_writable( $uploads_dir ) ) { 
  14. $message = sprintf( __( 'This contact form contains file uploading fields, but the temporary folder for the files (%s) does not exist or is not writable. You can create the folder or change its permission manually.', 'contact-form-7' ), $uploads_dir ); 
  15.  
  16. echo '<div class="notice notice-warning"><p>' . esc_html( $message ) . '</p></div>';