• Hello, I have the following code:

    <?php
    echo '<iframe src="https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id=' . htmlspecialchars($_GET["txn_id"]) . '" style="width:100%;border:0;min-height:500px;"></iframe>';
    ?>

    And I need to turn it into shortcode to implement it into a specific page.
    I tried reading online but didn’t find a clear answer.
    Can someone please help me? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Always that exact string or would something vary from use to use?

    Thread Starter XLFR

    (@xlfr)

    That one exactly.
    Thanks.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    function my_junkie_shortcode( $atts, $content) {
      return '<iframe src="https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id=' . htmlspecialchars($_GET["txn_id"]) . '" style="width:100%;border:0;min-height:500px;"></iframe>';
       }
    add_shortcode( 'junkie', 'my_junkie_shortcode' );

    Put that in your theme’s functions.php or create a simple plugin (example) for it.

    To use it, just put [junkie] in the content.

    Thread Starter XLFR

    (@xlfr)

    Steve, you’re the man! Thanks a lot!

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

The topic ‘Turning Php Code Into Shortcode (?)’ is closed to new replies.