-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
FSE templates not rendering shortcodes used in blocks #35258
Comments
There is a similar findings that was reported in WordPress/twentytwentytwo/issues/280, but turns out it's more like the behaviour described in this issue. |
This issue is not actually solved by the above pull request. Can we re-open this? |
Please include the full details about what, more precisely, is not working, and how to reproduce it without third party plugins. |
@Stiofan I tried to install the plugin from zip, and it ran into a 500 error. |
Edit no. 4: (sorry for the edits---been a while since I've tested shortcodes). I have tested this with a custom shortcode and haven't been able to reproduce. I'd like to see more detailed steps too. Here's what I tried:
add_action( 'init', function() {
add_shortcode( 'test', function() {
return '<p>Hello, world</p>';
} );
} );
<!-- wp:shortcode -->
[test]
<!-- /wp:shortcode -->
<p>Hello, world</p> |
With information still missing on how the PR #37545 is not working, I close this again. |
I'm having this exact same issue on 6.2.1 which according to this should've been fixed long ago. All shortcodes in our templates are being output as plaintext, but in the post content is working fine. |
@hastinbe This is a very old ticket and has nothing to do with the recent 6.2.1 change. Please voice your concerns at https://core.trac.wordpress.org/ticket/58333 and leave this ticket archived. |
It does however have the same symptom, which is how I ended up here for those of us who searched the issues. But thanks for the link, I did find it earlier after I made that comment and I'm sure it will help others who end up here like I did |
Description
If a block output contains a shortcode it will be renedered when used in a page/post or block widget, however if used on a template such as single-post.html then the shortcode will not be rendered. The backend editor WILL render it, but the frontend will not.
Step-by-step reproduction instructions
I have a framework that serverside renders blocks as they are shortcodes. It can be installed as a plugin to test.
https://github.com/AyeCode/wp-super-duper
There is a "Hello World" example, add the example to a normal post and view the source code, you will see it's contens as a shortcode. If used on a single-post.html template it will render in the backend but not on the front end. I guess as it does not get put through "the_content" filter.
Screenshots, screen recording, code snippet
Untitled_.Sep.30.2021.1_42.PM.mp4
Environment info
WP 5.8.1
GB 11.6.0
Theme: armando (theme experiments)
Chrome
Ubuntu
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: