wpcf7_upload_dir

The Contact Form 7 wpcf7 upload dir function.

Description

wpcf7_upload_dir( (bool) $type = false ); 

Parameters (1)

0. $type — Optional. (bool) => false
The type.

Usage

  1. if ( !function_exists( 'wpcf7_upload_dir' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/functions.php'; 
  3.  
  4. // The type. 
  5. $type = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpcf7_upload_dir($type); 
  9.  

Defined (1)

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

/includes/functions.php  
  1. function wpcf7_upload_dir( $type = false ) { 
  2. $uploads = wp_get_upload_dir(); 
  3.  
  4. $uploads = apply_filters( 'wpcf7_upload_dir', array( 
  5. 'dir' => $uploads['basedir'],  
  6. 'url' => $uploads['baseurl'] ) ); 
  7.  
  8. if ( 'dir' == $type ) { 
  9. return $uploads['dir']; 
  10. } if ( 'url' == $type ) { 
  11. return $uploads['url']; 
  12.  
  13. return $uploads;