Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save albertvolkman/5ba1a7eb21964430c484 to your computer and use it in GitHub Desktop.
Save albertvolkman/5ba1a7eb21964430c484 to your computer and use it in GitHub Desktop.
<?php
/**
* Implements hook_drush_command().
*/
function imagestyles_drush_command() {
$items = array();
$items['imagestyles'] = array(
'callback' => 'imagestyles_drush_callback',
'description' => "Display a list of all image styles.",
);
return $items;
}
/**
* Implements hook_drush_help().
*/
function imagestyles_drush_help($section) {
switch ($section) {
case 'drush:imagestyles':
return dt("Displays a list of all image styles. Example: drush imagestyles");
}
}
/**
* Drush callback: Prints out an array of image styles and their settings.
*/
function imagestyles_drush_callback() {
$styles = image_styles();
foreach ($styles as $style) {
print "\n\n" . $style['name'] . "\n";
foreach ($style['effects'] as $substyle) {
print_r($substyle['data']);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment