-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert post content into blocks on save #13
Comments
Maybe try something like this:
I did a quick test and it seems to works. |
@palmiak thanks, but it has caveats:
As a reference, if we have
and we save it and then we go to wp-admin editor and click button "convert into blocks" it will be saved as:
with your proposed solution it will be saved as:
( It is not so trivial :) I am thinking about using the same logic which runs when user clicks "convert into blocks" button in wp-admin but it triggers some JS function which is not available when processing with PHP of course. As no one is asking for this feature for time being, I keep this ticket open but with low priority. If it would be done, I'd prefer to use some WP native functions which are not present yet but planned:
|
I missed the fact of using other blocks than paragraphs (and images, which I had in mind). I went through some block converters plugins and all using are using JS to trigger the conversion. In some rare cases, it's about manual wrapping some tags like I mentioned above. |
Now post content is being save as is and displayed in Gutenberg editor as "classic". This classic block has option in Gutenberg to convert into blocks.
There must be some function to convert it. The task here is to find it and inspect if this could, be done automatically in the moment of the first post save.
The text was updated successfully, but these errors were encountered: