Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WillBontrager

    (@willbontrager)

    benreneke, values in URLs are $_GET values instead of $_POST values.

    Whether or not the GET parameter survives depends on your Permalink Settings. The available $_GET values can be displayed like this:

    <pre>
    [insert_php]
    echo print_r($_GET,true);
    [/insert_php]
    </pre>

    When you know what’s available, you know what you can use.

    I’m uncertain what the do_shortcode() function is supposed to do. It might or might not be compatible with Insert PHP.

    (Although it looks like it, [insert_php]…[/insert_php] is not a shortcode. Instead, they are placeholders for PHP code for the plugin to run.)

    https://php.net/search.php is a good reference for PHP functions.

    https://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php is a good reference for Insert PHP.

    Will

    Thread Starter benreneke

    (@benreneke)

    It works for me!

    [insert_php]
    echo do_shortcode('[myshortcode att="'.$_GET[myurlparam].'"]');
    [/insert_php]

    Thx a lot for your reactivity!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pass URL param into shortcode’ is closed to new replies.