-
-
Save albertvolkman/5ba1a7eb21964430c484 to your computer and use it in GitHub Desktop.
This file contains hidden or 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