WordPress.org

Ready to get started?Download WordPress

Forums

Shortcode Exec PHP
[resolved] Shortcode posts as text (8 posts)

  1. Jeff M.
    Member
    Posted 2 years ago #

    I am attempting to use the Shortcode Exec PHP plug-in at the following test site:

    One Boston Fan

    For some reason, when I use the suggested call-out:

    [shortcode arg="hello_value"]

    it simply posts as text. However, when I use the default:

    [hello_value]

    it executes the script.

    Any ideas?

    http://wordpress.org/extend/plugins/shortcode-exec-php/

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    What do you mean by "it simply posts as text" ?
    How is your shortcode defined?

  3. Jeff M.
    Member
    Posted 2 years ago #

    Hi, Marcel:

    I am using the default shortcode that was included with your plug-in.

    extract(shortcode_atts(array('arg' => 'default'), $atts));
    echo "Hello world!" . PHP_EOL;
    echo "Arg=" . $arg . PHP_EOL;
    echo "Content=" . $content . PHP_EOL;

    If you check the site, I have examples executing (or attempting to execute) the code in both posts and pages.

  4. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    I don't see anything wrong. 'hello_world' is the name of the plugin, so you should use the shortcode [hello_world] in your posts or [hello_world arg="Bob"]).

  5. Jeff M.
    Member
    Posted 2 years ago #

    I think that I see the problem.

    Instead of

    [shortcode arg="hello_world"]

    I should be doing this

    [hello_world arg="Joe"]

  6. Jeff M.
    Member
    Posted 2 years ago #

    This is what happens when I attempt to work on my site late at night when I should be in bed. :-)

    Thanks, Marcel!

  7. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    Maybe the argument should have been called 'Arghhh' ;-)

  8. Jeff M.
    Member
    Posted 2 years ago #

    Haha, yeah, it was coming to that! :-)

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic