Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: image_edit_before_change

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
320                }
321                if ( !$combined )
322                     $filtered[++$i] = $changes[$j];
323           }
324           $changes = $filtered;
325           unset($filtered);
326      }
327
328      // image resource before applying the changes
329      $img = apply_filters('image_edit_before_change', $img, $changes);
330
331      foreach ( $changes as $operation ) {
332           switch ( $operation->type ) {
333                case 'rotate':
334                     if ( $operation->angle != 0 )
335                          $img = _rotate_image_resource($img, $operation->angle);
336                     break;
337                case 'flip':
338                     if ( $operation->axis != 0 )