` to every block-editor REST request, with no check for * whether the post type is localizable. For a non-localizable CPT such as * eshb_accomodation, Gutenberg's post fetch then becomes * /wp/v2/eshb_accomodation/?context=edit&lang= * When that slug is a bare language (e.g. "en", which Bogo emits when the * locale is "alone"), the request triggers a _doing_it_wrong notice. With * WP_DEBUG_DISPLAY on, that notice HTML is dumped into the REST response, so the * JSON is no longer parseable. Gutenberg's getEntityRecord then resolves empty * and renders: "You attempted to edit an item that doesn't exist." * * Bogo's own Language panel renders nothing for non-localizable post types, so * the script has no purpose on these screens. Dequeue it there. */ add_action( 'admin_enqueue_scripts', 'eshb_dequeue_bogo_block_editor', 999 ); function eshb_dequeue_bogo_block_editor( $hook_suffix ) { if ( ! in_array( $hook_suffix, array( 'post.php', 'post-new.php' ), true ) ) { return; } if ( ! function_exists( 'bogo_is_localizable_post_type' ) ) { return; // Bogo not active. } $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( ! $screen || empty( $screen->post_type ) ) { return; } // Leave Bogo alone for post types it actually localizes (post, page, ...). if ( bogo_is_localizable_post_type( $screen->post_type ) ) { return; } wp_dequeue_script( 'bogo-block-editor' ); }