Skip to content

Commit

Permalink
Add command to go to the new image generation stand-alone page
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Jul 14, 2023
1 parent b495448 commit 6ebe3e3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/js/gutenberg-plugins/commands.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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 };
};

Expand Down

0 comments on commit 6ebe3e3

Please sign in to comment.