Ticket #14106: demo-plugin.php
File demo-plugin.php, 351 bytes (added by , 13 years ago) |
---|
Line | |
---|---|
1 | <?php |
2 | add_image_size( 'mythumb_bw', 200, 50, true ); |
3 | add_image_size( 'mythumb', 200, 50, true ); |
4 | add_filter( 'image_resize_mythumb_bw', 'bw' ); |
5 | function bw( $image ) { |
6 | imagefilter( $image, IMG_FILTER_GRAYSCALE ); |
7 | return $image; |
8 | } |
9 | add_filter( 'image_resize_suffix_mythumb_bw', 'bwfilename' ); |
10 | function bwfilename( $suffix ) { |
11 | return "$suffix-bw"; |
12 | } |