Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: admin_memory_limit

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
524  */
525 function unzip_file($file, $to) {
526      global $wp_filesystem;
527
528      if ( ! $wp_filesystem || !is_object($wp_filesystem) )
529           return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
530
531      // Unzip can use a lot of memory, but not this much hopefully
532      /** This filter is documented in wp-admin/admin.php */
533      @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
534
535      $needed_dirs = array();
536      $to = trailingslashit($to);
537
538      // Determine any parent dir's needed (of the upgrade directory)
539      if ( ! $wp_filesystem->is_dir($to) ) { //Only do parents if no children exist
540           $path = preg_split('![/\\\]!', untrailingslashit($to));
541           for ( $i = count($path); $i >= 0; $i-- ) {
542                if ( empty($path[$i]) )