Is there any known plugins that would replace WordPress classes in editor with their Bootstrap 4 equivalent?


Context: I’m using WordPress as a backend for article writing on a non-wordpress site (built with Laravel, using Corcel to access the data, if that matters). That website is built with Bootstrap 4, and when fetching the posts written in WordPress, there’s a couple of classes that is added by WordPress for styling that, of course, does not translate to Bootstrap.

For example, when centering an image in a post, WordPress adds an aligncenter css class that, if rendered in a Bootstrap (4) context, does nothing. To acheive the centering of the image, I would have to manually add the mx-auto d-block classes to each and every images of the post… In every post. But I’d like this to be done automatically.

I did try to install some themes in WP that where specifically designed for Bootstrap 4, thinking it might force the editor to use the wanted classes, but it doesn’t.

This question/answer provides a couple of example on how it could be acheived but before reinventing the wheel, I’d like to know if there is any know plugin that would do this? Or even some stylesheet that I could add to the non wordpress site that would understand WP classes in a bootstrap context maybe ?

A quick search in WordPress’ plugin page and Google returns nothing in that regard, but I fear that I’m just lacking of the right search terms for a successfull search.

Jean-Philippe Murray 2 years 2020-12-17T10:10:32-05:00 0 Answers 6 views 0

Leave an answer