ddw_wcde_get_site_upload_location

Get the Blog/ Site upload location location for URL or path, and for Multisite or not.

Description

(string) ddw_wcde_get_site_upload_location( (string) $type ); 

Takes account of multisite usage, and domain mapping.

Returns (string)

String of path or URL of WordPress upload directory.

Parameters (1)

0. $type (string)
Either url or anything else e.g. path..

Usage

  1. if ( !function_exists( 'ddw_wcde_get_site_upload_location' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/wcde-functions.php'; 
  3.  
  4. // Either 'url' or anything else e.g. 'path'. 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ddw_wcde_get_site_upload_location($type); 
  9.  

Defined (1)

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

/includes/wcde-functions.php  
  1. function ddw_wcde_get_site_upload_location( $type ) { 
  2.  
  3. /** Get the uploads directory -- supports Multisite of course */ 
  4. $uploads = wp_upload_dir(); 
  5. $dir = ( 'url' == $type ) ? $uploads[ 'baseurl' ] : $uploads[ 'basedir' ]; 
  6.  
  7. /** Return Blog/ Site upload location */ 
  8. return apply_filters( 'wcde_filter_get_site_upload_location', $dir . '/' ); 
  9.  
  10. } // end of function ddw_wcde_get_site_upload_location