Skip to content

Commit

Permalink
Convert function passed to before_invoke into closure
Browse files Browse the repository at this point in the history
  • Loading branch information
thrijith committed Apr 19, 2019
1 parent a2d940d commit ff6ce68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions media-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
*
* @throws \WP_CLI\ExitException
*/
function wpcli_media_assert_image_editor_support() {
$wpcli_media_assert_image_editor_support = function () {
if ( ! wp_image_editor_supports() ) {
WP_CLI::error(
'No support for generating images found. '
. 'Please install the Imagick or GD PHP extensions.'
);
}
}
};

WP_CLI::add_command(
'media',
'Media_Command',
[ 'before_invoke' => 'wpcli_media_assert_image_editor_support' ]
[ 'before_invoke' => $wpcli_media_assert_image_editor_support ]
);

0 comments on commit ff6ce68

Please sign in to comment.