Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: upload_dir

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
871
872         // Make sure we have a monthly dir
873         if ( ! file_exists( $pathym ) ) {
874                 if ( ! @ mkdir( $pathym ) )
875                         return array('error' => "Unable to create directory $pathym. Is $pathy writable?");
876           @ chmod( $pathym, $dir_perms );
877      }
878
879     $uploads = array('path' => $pathym, 'url' => get_option('siteurl') . "/$dir/$y/$m", 'error' => false);
880      return apply_filters('upload_dir', $uploads);
881 }
882
883 function wp_upload_bits($name, $type, $bits) {
884      if ( empty($name) )
885           return array('error' => "Empty filename");
886
887      $upload = wp_upload_dir();
888      
889      if ( $upload['error'] !== false )