Skip to content

Instantly share code, notes, and snippets.

@KittenCodes
Last active May 9, 2025 07:40
Show Gist options
  • Save KittenCodes/7b53e99932f17899520a862cd165ab73 to your computer and use it in GitHub Desktop.
Save KittenCodes/7b53e99932f17899520a862cd165ab73 to your computer and use it in GitHub Desktop.
Fix: Oxygen Classic - WordPress v6.8 prevents changing images in Gutenberg

How to Use

I've found that the markup seems to differ on some sites.
Usually, the code from fix-gutenberg-image.php resolves this, but if that doesn't work for you, please try the code from fix-gutenberg-image-2.php.

The code can be added to the site using a snippets type plugin, such as WPCodeBox.

add_action('admin_head', 'oxygen_support_fix_gutenberg_image');
function oxygen_support_fix_gutenberg_image() {
echo '<style>
/* WordPress 6.8 CSS Override to allow images to be changed in Gutenberg */
.wp-block img.ct-image:not([draggable]) {
pointer-events: unset !important;
}
</style>';
}
<?php
add_action('admin_head', 'oxygen_support_fix_gutenberg_image');
function oxygen_support_fix_gutenberg_image() {
echo '<style>
/* WordPress 6.8 CSS Override to allow images to be changed in Gutenberg */
[data-type*="oxygen-vsb"] .wp-block img:not([draggable]),
[data-type*="oxygen-vsb"] .wp-block svg:not([draggable]) {
pointer-events: unset;
}
</style>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment