Skip to content

Shortcodes are evaluated instead of printed as text #668

@TobiasBg

Description

@TobiasBg

When adding a Shortcode to a core/code block, the Shortcode is printed as text instead of being evaluated (this is useful e.g. for documentation pages of a plugin's Shortcodes).

When then activating "Syntax-highlighting Code Block (with Server-side Rendering)" version 1.3.1 (tested on WP 6.1.1 and trunk), the Shortcode is however evaluated.

To reproduce this:

  1. Add a small plugin that adds a Shortcode:
<?php
/*
Plugin Name: Shortcode Test
Description: Shortcode Test
Version: 1.0
*/

add_shortcode( 'test', 'shortcode_test' );
function shortcode_test( $atts, $content ) {
    return 'Just a test';
}
  1. Add a "Code" block to a post or page with the Shortcode [test] as the content.
  2. Compare the page output with "Syntax-highlighting Code Block (with Server-side Rendering)" deactivated and activated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions