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

In block-template - Shortcode block does not work #21519

Closed
Bowriverstudio opened this issue Apr 9, 2020 · 3 comments
Closed

In block-template - Shortcode block does not work #21519

Bowriverstudio opened this issue Apr 9, 2020 · 3 comments

Comments

@Bowriverstudio
Copy link

Describe the bug

In block-templates

[greeting]

Displays [greeting] instead of "Hello World"

To reproduce
Steps to reproduce the behavior:

  1. Download parisienne theme from https://github.com/WordPress/theme-experiments
  2. Activate Gutenberg Experiments
  3. Add the function in functions.php
function demo_shortcode() { 
 
    // Things that you want to do. 
    $message = 'Hello world!'; 
     
    // Output needs to be return
    return $message;
    } 
    // register shortcode
    add_shortcode('greeting', 'demo_shortcode'); 


  1. add the code

app/public/wp-content/themes/theme-experiments/parisienne/block-templates/index.html

[greeting]

  1. Add the same code in the post editor.

Expected behavior

I see "Hello World" from the post, and [greeting] from the block-template

Additional context

  • Gutenberg - 7.8.1
  • Wordpress 5.4
@Bowriverstudio
Copy link
Author


<!-- wp:shortcode -->
[greeting]
<!-- /wp:shortcode -->

Sorry the HTML comments was removed by github.

@johnstonphilip
Copy link
Contributor

Shortcodes were intentionally removed from template parts here:
#20343 (comment)

@Bowriverstudio
Copy link
Author

@johnstonphilip thank you for letting me know.

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

2 participants