NO BUG: ShortCode doesn't work in "Standard Text" Block

Hello,
I have created a function in the plugin CodeSnippet, which should be inserted arbitrarily via shortcode.
The snippet works fine, but not when the shortcode is inserted in the standard text block.
There are three scenarios shown in the screenshot:

  1. formatted text block → shortcode works
  2. standard text block → shortcode does not work
  3. shortcode block itself → shortcode works

The whole thing runs in a loop.

Thanks for your support.

Is it foreseeable when the bug will be fixed?

Hey @MedienHusky,

sorry. Missed this one.

After bringing this up internally this is not a bug but just not supported at the moment. Feel free to submit an idea.

As you already created a function in a code snippet plugin you can easily use this function via the dynamic echo tag.

Your custom function:

function prefix_get_staytime() {
  // generate / calculate the staytime here
  return $staytime;
}

In the builder you can then just use the echo tag:

Seit {echo:prefix_get_staytime} Tagen in der Auffangstation.

If you’re familiar with PHP you can even create your own dynamic data tag.

Let me know if that helps.

Best,

André

Hello @aslotta, what’s up?

After bringing this up internally this is not a bug but just not supported at the moment. Feel free to submit an idea.

The shortcodes work everywhere:
– in Gutenberg
– in formated text block
– in shortcode block
only in “Standard text block” it doesn’t work.

Now you tell me it’s not a bug.
What is a bug then?

About the history: first it was on “accepted”, then on “waiting” and now on “no bug”.
You make it damn easy for yourselves!

New Slogan for bricks: “It’s not a bug, it’s a unsupported feature”

regards,
Ralf

Hey @MedienHusky,

what’s wrong with using the echo tag to use this function as recommended?

Best,

André

Hey @aslotta,

The correct question should be: Why was the report first confirmed as a bug, then put on hold, and now set to “no bug”?
This is not a reliable way to process with messages.

Especially in the simple text block it would be important that shortcodes work. With the fomartierenden textblock I had not even suspected.

It is just disappointing. Let’s leave it at that.

regards,
Ralf

Hey @MedienHusky,

I’m sorry that my answer did not satisfy you.

Especially in the simple text block it would be important that shortcodes work.

I (personally) disagree in this regard as shortcodes are (usually) there to insert more or less complex html markup into a page. Using them to output single strings within a text element is (imho) an exception and not the usual use case.

The API enables plugin developers to create special kinds of content (e.g. forms, content generators) that users can attach to certain pages by adding the corresponding shortcode into the page text.

Source: Shortcode API « WordPress Codex

You are welcome to submit an idea if you think the text element should be able to handle shortcodes.

Best,

André

Hey @aslotta,

here is another user who would like to have shortcodes in lists.
Please take a look to Shortcodes in lists

regards,
Ralf

Its counter intuitive, but it makes since.

The element in question renders p, span or similar tags. If your shortcode renders a <div> it would effectively break the html of the page as you can’t insert that within p or span.

Would be nice if this was documented somewhere quick to find.