• Resolved harchvertelol

    (@harchvertelol)


    I want to edit some descriptions (in my plugin) that contain the shortcode for inserting pdf, but inside the textarea block, the shortcode is also replaced with what the plugin inserts. How can I get around this so that this does not happen inside the textarea? Or to prevent this from happening on a certain page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter harchvertelol

    (@harchvertelol)

    For example, I want edit text: “Very cool PDF: [pdf-embedder url=’cool.pdf’]”.

    But in textarea showing “Very cool PDF: *many tags for embedding*”.

    Hi @harchvertelol,

    Forgive me if I misunderstand the question but you are wanting to display the shortcode in your text and not have the PDF viewer displayed (and throwing an error on the “fake” file path, correct?

    To do that you can either wrap the shortcode in a <pre> tag to indicate the output is actually a code snippet and not a shortcode to be rendered, or write the shortcode with the HTML entities. For example:

    &lbrack;pdf-embedder url=&quot;path-to-pdf&quot; &rbrack;

    • This reply was modified 3 years, 2 months ago by PDFG Support. Reason: coding wrapping hiccup
    Thread Starter harchvertelol

    (@harchvertelol)

    I’m sorry, but tag <pre> is not working.
    Code:
    <pre><textarea id="desc_value_inp" rows="10" cols="45" name="desc_value"><? echo stripcslashes($desc_text); ?></textarea></pre>

    In textarea form we have:

    ...
    <a href="source.pdf" class="pdfemb-viewer" style="" data-width="max" data-height="max"  data-toolbar="bottom" data-toolbar-fixed="off">source<br/></a>
    ...

    but we should have:

    ...
    [pdf-embedder url='source.pdf']
    ...

    Variable $desc_text containted text with tags for my editing, but I can’t do this, because in editbox (textarea tag) we have replaced tag [pdf-embedder].

    But on other page we load $desc_text, and I want that on this page this tag is working.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode in textarea’ is closed to new replies.