Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: jpeg_quality

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
88
89      // The directory containing the original file may no longer exist when
90      // using a replication plugin.
91      wp_mkdir_p( dirname( $dst_file ) );
92
93      $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) );
94
95      if ( 'image/png' == $image_type && imagepng( $dst, $dst_file ) )
96           return $dst_file;
97      elseif ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) )
98           return $dst_file;
99      else
100           return false;
101 }
102
103 /**
104  * Generate post thumbnail attachment meta data.
105  *
106  * @since 2.1.0