Shortcodes in Form INPUT tags

It seems that Shortcodes don't work in INPUT tags e.g

<input name="custom webpage" type="hidden" value=[wbcr_php_snippet id="15311"] />

just sets the value to the literal [wbcr_php_snippet id="15311"] rather than processing the shortcode.

Is this a BeTheme limitation or a general Wordpress one ?

If it's a BeTheme one is there a reason for it and anyway to fix it ?

Many Thanks

Comments

  • Hello,

    How it would look like? Send the rendered shortcode to someone's mail or just a plain string with the shortcode?

    I'm not sure what you want to achieve by inserting shortcode there.

    Thanks

  • My Shortcode is a shortcode for a string.

    Elsewhere the shortcode expands correctly.

    e.g

    Shortcode

    [wbcr_php_snippet id="15311"] = Hello World

    This works correctly in a regular text block e.g

    Design side:

    <p>[wbcr_php_snippet id="15311"]</p>

    Generated HTML client side:

    <p>Hello World</p>

    Similarly if I add the shortcode to an INPUT tag, it should expand in a similar way

    Design Side:

    <input name="custom webpage" type="hidden" value=[wbcr_php_snippet id="15311"] />

    Generated HTML client side:

    <input name="custom webpage" type="hidden" value=Hello World />

  • Hi,

    Did you use some plugins to create this shortcode? If yes can you tell me the name of it, please?

    You can also attach a link to the page where you used that structure.

    You can check that in the Gutenberg editor, also you can switch to some default theme like Twenty Twenty to check if it is Betheme related.


    Thanks

  • Yes. The shortcode is created using the Woody code snippets plugin.

    I've asked the plugin's authors to confirm whether the plugin should work in an <INPUT /> tag. Will report back when I hear from them.

  • Then I am waiting for your response. First, however, please notice that we do not support this plugin, and I cannot guarantee that it will work with our theme.

    But if this structure works in the Gutenberg, you can use the Content WP element to put it in our builder.

    https://muffingroup.com/betheme/elements/content-wp/


    Best regards

  • Sadly all the plug in developers have said is that it's either a bug in Wordpress or in the Theme.

    I don't know enough about wordpress to test on a different theme - do I need to create a new wordpress site with a different theme in order to test ?

  • You do not have to create another website. A testing page will be enough.

    In the WP Editor, put the structure you want to test and update the page when you create it.

    After that, you can check if it is working as you intended.

    To test with another theme, go to Appearance -> Themes and switch to the free theme like Twenty Twenty or Twenty Twenty-Two. If you see only a Betheme there, you will have to add a new theme.

    When you end testing, you can switch back to the Betheme. None of your content will be lost because it is stored in the database.


    Best regards

Sign In or Register to comment.