BUG in design – setting custom sizes
-
It seems like there is a bug in the architecture of the plugin.
The filter ‘cycloneslider_image_sizes’ is in theory made available to set up custom sizes:
$plugin['image_sizes'] = apply_filters('cycloneslider_image_sizes', $plugin['image_sizes']);
This can’t ever get called though because the plugin activates itself on the ‘plugins_loaded’ event which is called before anything in functions.php so by the time any custom ‘cycloneslider_image_sizes’ filters are defined the filter has already been called.
If you look in codex action reference you will see that it says normally plugins are set up in the ‘init’ event which would fire after the functions.php has a chance to set itself up.
SOLUTION
In
cyclone-slider.php
line 30 edit ‘plugins_loaded’ to ‘init’.Then users of the plugin can set up custom image sizes in functions.php like this:
// wire up extra sizes in plugin function custom_template_size($template_sizes) { $template_sizes['440_266_crop'] = array( 'width' => 440, 'height' => 266, 'resize_option' => 'crop', ); return $template_sizes; } add_filter('cycloneslider_image_sizes', 'custom_template_size');
- The topic ‘BUG in design – setting custom sizes’ is closed to new replies.