We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Call { _site_root } inside a plugin?

Nico del Castillo September 23, 2014 by Nico del Castillo

Not a huge issue, but could come in handy later. I'm just curious if this is possible, it would clean up some of my code.

From the plugin, I'd like this to be possible:

return '<a href="'.{ _site_root }.'" class="my_class" target="_blank">'.$label.'</a>';

Obviously this doesn't work, but I don't know how to call the { _site_root } from inside this plugin because it's not in the documentation. Is there a way for me to store the site root in a $var ? I do need this to be a variable so that the plugin works in both a localhost staging environment and on the live site.

Answered by Ethan Beyer!
>>>>>>> Answered <<<<<<<
4 Replies