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

Shortcodes not being expanded in saved blocks #129

Open
bobbingwide opened this issue Apr 17, 2019 · 2 comments

Comments

Projects
None yet
1 participant
@bobbingwide
Copy link
Owner

commented Apr 17, 2019

In wp-pompey.org.uk I have a paragraph that includes the [bw_link] shortcode to two internal pages. I saved the block as a reusable block and used it in another post. On the front end of the new post the shortcodes have not been expanded.

Thank you to our group sponsors [bw_link 833] and 
[bw_link 1002] for supporting us with a venue and refreshments.

Expected output

Shortcodes to be expanded in the reusable block.

Workaround

Change the shortcodes to standard WordPress links.

@bobbingwide

This comment has been minimized.

Copy link
Owner Author

commented Jun 6, 2019

This needs to be investigated. Find out if the proposed fix to #120 is affecting the results.

It's not a problem in s.b/hm. Shortcodes are being expanded. This could be because oik_add_shortcodes has been run.
It is a problem in s.b/wordpress.
I also expect it to fail in s.b/wp52 with Twenty Nineteen.

@bobbingwide bobbingwide self-assigned this Jun 6, 2019

@bobbingwide

This comment has been minimized.

Copy link
Owner Author

commented Jun 6, 2019

Problem explanation

This could be because oik_add_shortcodes has been run.

This was the case. oik_do_shortcode does not notice the shortcodes in the reusable blocks since the post content just contains, as an example, <!-- wp:block {"ref":20793} /-->.

A simple fix is to change the test to check that there aren't any reusable blocks in the content.
A better fix might be to change the priority of the filter function against the_content.
do_blocks is performed at priority 9. So the oik_do_shortcode filter function should be run after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.