• So I’m trying to make a variable contain the output of a shortcode and output it to a text file like so:

    $login_logo_url = do_shortcode( $jf_options['loginlogolk'] );
    file_put_contents( $file, $login_logo_url);

    But when I look at the text file it’s just the shortcode itself. I tested the shortcode in a page and it’s working. What am I doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    What is the value of $jf_options['loginlogolk']? It must be a simple string, if it were a string element in a one element array for example, do_shortcode() will fail. As a test, hardcode the actual string and see what happens.

    Where is this code executed? Could it run before the corresponding add_shortcode() is called?

    Could another plugin (or your theme?) be interfering with shortcode handling?

    These are the only things I can think of. Several people have had issues with do_shortcode() not doing, I don’t think there’s any kind of elusive bug, probably some variation of the above.

    Hello bcworkz!

    We’d like to exchange with you, but can’t seem to find how to reach you, so we’re writing here.

    We’re the guys behind this plugin: http://wordpress.org/support/view/plugin-reviews/wysija-newsletters

    And we’d like to poke your mind about some support work. Get in touch with Kim here: http://www.mailpoet.com/contact/

    Thanks, and sorry again for disturbing this thread.

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

The topic ‘Run do_shortcode() inside variable, not working…’ is closed to new replies.