WordPress not loaded!'; exit; } if (!current_user_can('edit_posts')) { wp_die(esc_html__('You are not authorized to use this capability.', 'photonic')); } require_once 'Admin_Page.php'; class Shortcode_Replace extends Admin_Page { private static ?Shortcode_Replace $instance = null; public static function get_instance(): Shortcode_Replace { if (null === self::$instance) { self::$instance = new Shortcode_Replace(); } return self::$instance; } public function render_content() { ?>

What is the gallery shortcode?

The gallery shortcode is the backbone of creating galleries in WordPress. By default Photonic uses this and adds on a bunch of goodies to it. If you happen to deactivate Photonic, you wouldn't be dealing with a mess of shortcodes, since the gallery shortcode fails gracefully and without any ugly errors.

So why might you want to replace it?

Let's say you have an established website and have made heavy use of Photonic galleries. Then, one fine day, you change themes or add some plugin, which also uses the gallery shortcode. You now have a conflict! This page gives you a very easy way to work around this conflict.

In addition, this method also lets you separate your shortcodes, so that in case you decide to switch over the shortcodes to Gutenberg blocks, you would only be targeting Photonic's shortcodes instead of others.

Alright, let's do it!

You have not defined a shortcode to which you can convert. Please do so from Photonic → Settings → Generic Options → Generic settings → Custom Shortcode.

Please use something other than gallery as your custom shortcode. Using photonic is probably a good idea.

You have your custom shortcode set up as .

tag), '

', '

', '', '', '', '' ); $usage->prepare_items(); $usage->display(); ?>