diff --git a/src/js/gutenberg-plugins/commands.js b/src/js/gutenberg-plugins/commands.js index 426a3a345..0626e1929 100644 --- a/src/js/gutenberg-plugins/commands.js +++ b/src/js/gutenberg-plugins/commands.js @@ -1,5 +1,5 @@ import { useCommandLoader } from '@wordpress/commands'; -import { edit, settings } from '@wordpress/icons'; +import { edit, image, settings } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; import { registerPlugin } from '@wordpress/plugins'; @@ -57,6 +57,19 @@ const Commands = () => { } ); } + // Command to go to the image generation page. + if ( typeof classifaiDalleData !== 'undefined' ) { + commands.push( { + name: 'classifai/generate-image', + label: __( 'ClassifAI: Generate image', 'classifai' ), + icon: image, + callback: () => { + document.location.href = + 'upload.php?action=classifai-generate-image'; + }, + } ); + } + return { commands }; };