Skip to content

Instantly share code, notes, and snippets.

@starryeyez024
Created July 2, 2014 19:01
Show Gist options
  • Save starryeyez024/25b35d24348dcb4078e1 to your computer and use it in GitHub Desktop.
Save starryeyez024/25b35d24348dcb4078e1 to your computer and use it in GitHub Desktop.
Add this file to your ~/.drush directory, then run the "drush imagestyles" command to display settings for all existing image styles
<?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