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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.