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

    (@willbontrager)

    return should be used only within a function. Try echo, instead. Or neither, just urlencode('do_shortcode([slp_location name])');

    It’s also possible the function do_shortcode() is unavailable to Insert PHP. Insert PHP works by putting the code between the tags through eval() and anything that’s not local in scope won’t function.

    More info about Insert PHP idiosyncrasies is here:

    http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php

    Will

    Thread Starter ashworth

    (@ashworth)

    Interesting. I tried echo first…with no luck.

    Let me try with your example.

    Thread Starter ashworth

    (@ashworth)

    That didn’t work.

    Here’s the oddity that I was trying to say in my first post, though. [insert_php] isn’t even being executed in their area that I put your shortcode. I’m confident that if I can get your shortcode function to work, that this will work as intended…but I don’t know what to do in order to get [insert_php] to actually execute as PHP.

    Right now, the shortcode itself (yours) is getting output to the URL, which means it’s not being parsed. As for what needs to be done in order to force it to be parsed…not sure.

    Plugin Author WillBontrager

    (@willbontrager)

    Check the server error log. It may contain a clue.

    Will

    Plugin Author WillBontrager

    (@willbontrager)

    Another thing to consider is that Store Locator Plus may be doing something with the PHP codes.

    Thread Starter ashworth

    (@ashworth)

    Thanks. I will check that.

    Unfortunately, what I’m seeing…is about the equivalent to what I would see when a shortcode text outputs to a post or page. Generally that means that a shortcode isn’t being evaluated at all in said content area.

    Plugin Author WillBontrager

    (@willbontrager)

    Perhaps Store Locator preempts the shortcode on the page.

    Thread Starter ashworth

    (@ashworth)

    Also, your shortcode work in the page their solution is embedded onto. Just not within the content areas they give me to place content. So I know your plugin works (I’ve used it before). Just not sure how to get the shortcode to be read and evaluated in this “other area” of WordPress.

    Checked the logs…nothing there. 🙁

    Thread Starter ashworth

    (@ashworth)

    Perhaps Store Locator preempts the shortcode on the page.

    The funny thing is, their own shortcodes do work in that same content area.

    [slp_location name]

    Plugin Author WillBontrager

    (@willbontrager)

    Something to try. Use Insert PHP somewhere above the current section to store the URL to a global variable. Then use the global variable for the URL. Don’t know whether or not it would work, but a different way to approach it.

    Plugin Author WillBontrager

    (@willbontrager)

    Also, see what happens when you remove the do_shortcode() function and feed [slp_location name] to urlencode() straight.

    Plugin Author WillBontrager

    (@willbontrager)

    I gotta run in a moment, just one more thing I thought of.

    Perhaps Insert PHP is trying to run before Store Locator has replaced the [slp_location name] shortcode.

    Sorry I can’t stand by. I’ll check back in the morning (Chicago time).

    Will

    Thread Starter ashworth

    (@ashworth)

    Tried a few things. I put this at the top of the content area they give me:

    [insert_php]echo 'test';[/insert_php]

    And this is what outputs to the browser when I do:

    [insert_php]echo 'test';[/insert_php]

    It’s basically not even being read in as a shortcode. Totally weird.

    Plugin Author WillBontrager

    (@willbontrager)

    Let’s make sure Insert PHP plugin is activated.

    If yes, I’m thinking Store Locator is preventing the plugin from doing its job.

    Will

    Thread Starter ashworth

    (@ashworth)

    Yep. Your plugin is certainly activated, as I can use it elsewhere in the WP site.

    Just wasn’t sure how to “force” compatibility to let it work in their field, necessarily (or anyone else’s plugin for that matter). Would be a good trick to know if it’s something that can be re-used in various other plugins doing the same thing.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[insert_php] won't execute when used inside Store Locator Plus plugin’ is closed to new replies.