From 6ebe3e38eca5bf932653659d32a485f887e90812 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Fri, 14 Jul 2023 16:44:43 -0600 Subject: [PATCH] Add command to go to the new image generation stand-alone page --- src/js/gutenberg-plugins/commands.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 }; };