• Resolved pauldotmac

    (@pauldotmac)


    Hi,

    Is it possible to insert php code in the description part of the table for a tablepress table? I tried it and couldn’t get it to work. I inserted <?php echo (“Hello World”) ?> and it got converted to <!–?php echo (“Hello World”) ?–>

    Thanks

    Paul

    Great plugin BTW

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    No, this is not possible, by default, for security reasons.
    I would recommend to instead maybe use a custom Shortcode that “wraps” your PHP code, which you can then use in the post/page where you are showing the table.

    Out of curiosity: What are you planning to do with that PHP code?

    Regards,
    Tobias

    Thread Starter pauldotmac

    (@pauldotmac)

    The description field includes a link to an external php file that generates a pdf document. Some people seem to be having caching issues with the version of the pdf file that gets generated so I thought I might add a random value pair to the query string to make sure the correct latest version of the pdf file gets generated. About the time you posted it occurred to me that maybe I could do it with a shortcode.

    Thanks for the quick reply.

    Thanks

    Paul

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Paul,

    ah, ok. Interesting problem… PHP could indeed solve this, but a Shortcode would really be better. Good to hear that this helped! 🙂

    Best wishes,
    Tobias
     
    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP code in table description’ is closed to new replies.