Skip to content
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

Option to avoid changing block names #61

Open
bobbingwide opened this issue Oct 28, 2019 · 2 comments
Open

Option to avoid changing block names #61

bobbingwide opened this issue Oct 28, 2019 · 2 comments

Comments

@bobbingwide
Copy link

Problem

I just used BSR to change all instances of Verse to Step then ran it again to change all instances of verse to step.
Then I noticed something strange.
What should have been Verse blocks were now appearing as Classic, with preformatted blocks within them.

Explanation

I'd accidentally changed wp:verse to wp:step.

Expected result

All instances of the word Verse to be changed to Step in post content.
All instances of the word verse to be changed to step in post content.

Actual result

The block type names were changed as well.

Requirement

It would be nice if there was an option to NOT change block type names.
Or at least a warning.

Is this part of the Pro version?

Workaround

Run BRS again changing wp:step to wp:verse.

PS

The irony is that I'd run BRS against my Problem Solving website.
So, I can now use this Issue as a problem solving example.
https://bobbingwide.com/problem-solving/oik_presentation/steps/step-13-whats-changed/

PPS
I also created a problem with permalinks; by changing verse to Step.

@bobbingwide
Copy link
Author

BTW: The workaround didn't work. My blocks had become wp:Step and they included a pre tag with class wp-block-Step.

@bobbingwide
Copy link
Author

You may just find the following code useful.
https://github.com/bobbingwide/oik-clone/blob/master/admin/class-oik-clone-block-relationships.php

It contains logic to parse post_content into blocks ( using WordPress core functionality) then reform post_content from the parsed blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant