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

Closed
bobbingwide opened this issue Apr 17, 2019 · 3 comments
Closed

Shortcodes not being expanded in saved blocks #129

bobbingwide opened this issue Apr 17, 2019 · 3 comments
Assignees

Comments

@bobbingwide
Copy link
Owner

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
Copy link
Owner Author

bobbingwide 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
Copy link
Owner Author

bobbingwide 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.

@bobbingwide
Copy link
Owner Author

This was fixed in v3.3.6, but only for the version delivered from oik-plugins.com. It’s now in v4.0.0 on wordpress.org, so closing.

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

No branches or pull requests

1 participant