Created
July 2, 2014 19:01
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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